Giter Site home page Giter Site logo

guicho271828 / latplan Goto Github PK

View Code? Open in Web Editor NEW
80.0 8.0 17.0 3.36 MB

LatPlan : A domain-independent, image-based classical planner

Python 84.99% Shell 7.01% Makefile 2.03% Common Lisp 5.34% Awk 0.63%
deeplearning search-algorithm automated-reasoning

latplan's Introduction

./img/latplanlogo-simple.svg.png

LatPlan : A domain-independent, image-based classical planner

Use tagged versions for reliable reproduction of the results.

  • NEWS Updates on version 4.0: Updates for Cube-Space AE in IJCAI2020 paper.
  • NEWS Updates on version 4.1.3: Minor refactoring. We also released the trained weights. See Releases.
  • NEWS Updates on version 5: Updates for Bidirectional Cube-Space AE in JAIR paper.
    • AMA3+ Cube-Space AE : A revised version of AMA3 Cube-Space AE (IJCAI20 version) which is now modeled as a sound generative model.
    • AMA4+ Bidirectional Cube-Space AE : An extension of Cube-Space AE which can learn both effects and preconditions.

See older news in ./NEWS.org

This repository contains the source code of LatPlan.

  • Asai, Kajino, Fukunaga, Muise: 2021. Classical Planning in Deep Latent Space.
  • Asai, M; Muise, C.: 2020. Learning Neural-Symbolic Descriptive Planning Models via Cube-Space Priors: The Voyage Home (to STRIPS).
  • Asai, M.: 2019. Neural-Symbolic Descriptive Action Model from Images: The Search for STRIPS.
  • Asai, M.: 2019. Unsupervised Grounding of Plannable First-Order Logic Representation from Images (code available from https://github.com/guicho271828/latplan-fosae)
  • Asai, M.; Kajino, F: 2019. Towards Stable Symbol Grounding with Zero-Suppressed State AutoEncoder
  • Asai, M.; Fukunaga, A: 2018. Classical Planning in Deep Latent Space: Breaking the Subsymbolic-Symbolic Boundary.
  • Asai, M.; Fukunaga, A: 2017. Classical Planning in Deep Latent Space: From Unlabeled Images to PDDL (and back).
    • In Knowledge Engineering for Planning and Scheduling (KEPS) Workshop (ICAPS2017).
    • In Cognitum Workshop at ICJAI-2017.
    • In Neural-Symbolic Workshop 2017.

Notes on NVIDIA port of Tensorflow

The system is built on Tensorflow 1.15. Since the official Tensorflow by Google (both the source code and the package) no longer supports 1.15, machines with recent GPUs require a port maintained by NVIDIA. Our installation script installs this port. The port only supports Linux, therefore we do not support OSX and Windows.

Setup with Anaconda / Miniconda (recommended)

anaconda / miniconda (https://docs.conda.io/en/latest/miniconda.html) is a dependency management system that can install both python and non-python dependencies into a local, encapsulated environment. It is conceptually similar to docker, but it does not use virtualization or container infrastructure. We recommend using miniconda, as it is smaller.

After the installation, run the following code:

conda config --add channels conda-forge
conda config --set channel_priority strict
source ./install.sh   # This takes about 15-30 min. Conda does not provide an informative progress, so be patient

Command Line Interface

Installing the latest version of Latplan via pip creates a runnable latplan script in ~/.local/bin. The script is not usable for running the experiments (see the next section) because it has an empty hyperparameter. However, it has the same command line API as train_common.py, train_kltune.py, and so on, therefore it may be useful for you to understand the command line API for those scripts.

(latplan) 07/05 08:08 latplan$ latplan -h
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.
Using TensorFlow backend.
Default float: float32
usage: latplan [-h] mode subcommand ...

positional arguments:
  mode     A string which contains mode substrings.
           Recognized modes are:
           
           learn     : perform the training with a hyperparameter tuner. Results are stored in samples/[experiment]/logs/[hyperparameter].
                       If 'learn' is not specified, it attempts to load the stored weights.
           plot      : produce visualizations
           dump      : dump the csv files necessary for producing the PDDL models
           summary   : perform extensive performance evaluations and collect the statistics, store the result in performance.json
           debug     : debug training limited to epoch=2, batch_size=100. dataset is truncated to 200 samples
           reproduce : train the best hyperparameter so far three times with different random seeds. store the best results.
           iterate   : iterate plot/dump/summary commands above over all hyperparmeters that are already trained and stored in logs/ directory.
           
           For example, learn_plot_dump contains 'learn', 'plot', 'dump' mode.
           The separater does not matter because its presense is tested by python's `in` directive, i.e., `if 'learn' in mode:` .
           Therefore, learnplotdump also works.

optional arguments:
  -h, --help    show this help message and exit

subcommand:
  
  A string which matches the name of one of the dataset functions in latplan.main module.
  
  Each task has a different set of parameters, e.g.,
  'puzzle' has 'type', 'width', 'height' where 'type' should be one of 'mnist', 'spider', 'mandrill', 'lenna',
  while 'lightsout' has 'type' being either 'digital' and 'twisted', and 'size' being an integer.
  See subcommand help.

  subcommand
    hanoi       Tower of Hanoi.
    puzzle      Sliding tile puzzle.
    puzzle_objs
                Object-based sliding tile puzzle.
    lightsout   LightsOut game (see https://en.wikipedia.org/wiki/Lights_Out_(game))
    sokoban     Sokoban environment rendered by PDDLGym.
    sokoban_objs
                Object-based Sokoban environment rendered by PDDLGym.
    blocks      Blocksworld environment.
    blocks_objs
                Object-based blocksworld environment.
(latplan) 07/05 08:09 latplan$ latplan learn hanoi -h
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.
Using TensorFlow backend.
Default float: float32
usage: latplan mode hanoi [-h] disks towers num_examples aeclass [comment]

positional arguments:
  disks         The number of disks in the environment.
  towers        The number of towers, or the width of the environment.
  num_examples  Number of data points to use. 90% of this number is used for training, and 5% each for validation and testing. It is
                assumed that the user has already generated a dataset archive in latplan/puzzles/, which contains a larger number of
                data points using the setup-dataset script provided in the root of the repository.
  aeclass       A string which matches the name of the model class available in latplan.model module. It must be one of: AE StateAE
                ZeroSuppressStateAE VanillaTransitionAE HammingTransitionAE CosineTransitionAE PoissonTransitionAE
                ConcreteDetConditionalEffectTransitionAE ConcreteDetBoolMinMaxEffectTransitionAE
                ConcreteDetBoolSmoothMinMaxEffectTransitionAE ConcreteDetLogitAddEffectTransitionAE
                ConcreteDetLogitAddEffect2TransitionAE ConcreteDetNormalizedLogitAddEffectTransitionAE CubeSpaceAE_AMA3
                ConcreteDetNormalizedLogitAddBidirectionalTransitionAE CubeSpaceAE_AMA4 ConcreteDetLogitAddEffectTransitionAEPlus
                ConcreteDetLogitAddEffect2TransitionAEPlus ConcreteDetNormalizedLogitAddEffectTransitionAEPlus
                ConvolutionalConcreteDetNormalizedLogitAddEffectTransitionAEPlus CubeSpaceAE_AMA3Plus CubeSpaceAE_AMA3Conv
                ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus
                ConvolutionalConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus CubeSpaceAE_AMA4Plus CubeSpaceAE_AMA4Conv
  comment       A string which is appended to the directory name to label each experiment. (default: )

optional arguments:
  -h, --help    show this help message and exit

Running

Next, customize the following files for your job scheduler before running. The job submission commands are stored in a variable $common, which by default has the value like jbsub -mem 32g -cores 1+1 -queue x86_24h, which means the jobs are submitted to a 24 hour runtime limit queue, requesting 1 cpu, 1 gpu (1+1) and 32g memory. You also need to uncomment the commands to run. By default, everything is commented out and nothing runs.

# Submit the jobs for training AMA3+ (Cube-Space AEs) and AMA4+ (Bidirectional Cube-Space AEs)
./train_propositional.sh

# Submit the jobs for converting the training results into PDDL files
./pddl-ama3.sh

# Copy the problem instances into a target directory.
problem-generators/copy propositional problem-instances-10min-0.0-1

# Edit run_ama3_all.sh to specify appropriate target directory and then submit the jobs for planning.
# To reproduce the exact same experiments in the paper,
# approximately 400 jobs are submitted. Each job requires 8 cores, no GPUs, and takes 6 hours maximum.
# Details can be customized for your compute environment.
./run_ama3_all.sh 

# After the experiments, run this to generate the tables and figures.
# for details read the source code.
make -C tables

file structure

  • Library code
    latplan/main/*.py
    Each file contains source code for loading the dataset and launching the training.
    latplan/model.py
    network definitions.
    latplan/mixins/*.py
    Contains various mixin classes used to build a complex neural network.
    latplan/util/
    contains general-purpose utility functions for python code.
    latplan/puzzles/
    code for domain generators/validators.
    latplan/puzzles/*.py
    each file represents a domain.
    latplan/puzzles/model/*.py
    the core model (successor rules etc.) of the domain. this is disentangled from the images.
  • Scripts
    train_{common,kltune,notune,nozsae}.py
    Scripts for training Latplan. Each file specifies a different set of hyperparameters.
    ama{1,2}-planner.py
    Latplan using AMA1/AMA2. (obsolete)
    ama3-planner.py
    Latplan using visual inputs (init, goal) and a PDDL domain file.
    run_ama{1,2,3}_all.sh
    Run all experiments.
    helper/
    helper scripts for AMA1.
    problem-generators/
    scripts for generating problem instances.
tests/
test files, mostly the unit tests for domain generator/validator
samples/
where the learned results should go. Each SAE training results are stored in a subdirectory.
tables/
code for storing experimental results into SQLITE and generating tables and figures.
(git submodule) planner-scripts/
My personal scripts for invoking domain-independent planners. Not just Fast Downward.
(git submodule) downward/
Fast Downward installation.

Gallery

./img/hanoi_4_3_36_81_conv_blind_path_0.png ./img/lightsout_digital_4_36_20000_conv_Astar_path_0.png ./img/lightsout_twisted_4_36_20000_conv_Astar_path_0.png ./img/puzzle_mandrill_3_3_36_20000_conv_blind_path_0.png ./img/puzzle_mnist_3_3_36_20000_conv_blind_path_0.png ./img/puzzle_spider_3_3_36_20000_conv_blind_path_0.png

latplan's People

Contributors

dependabot[bot] avatar guicho271828 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

latplan's Issues

grovelling +magic-version+ from MAGIC_VERSION in magic.h header file failed!

Dear Mr. @guicho271828,

This issue is similar to the previous issue #13, however installing header file by sudo apt-get install libmagic-dev does not solve it.
The magic.h file exists, but i do not know why it fails. Please guide me to tackle with this problem.

To load "magicffi":
Load 1 ASDF system:
magicffi
; Loading "magicffi"
[1/3] System 'magicffi' found. Loading the system..Aborted during step [1/3].
Unhandled SIMPLE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
{1001549123}>:
grovelling +magic-version+ from MAGIC_VERSION in magic.h header file failed!

Thank you very much,
Sincerely, Ulzhalgas Rakhman

Should I run setup again?

I have git cloned the repository and run ./setup.py install and ./setup-dataset.sh, but then I realized train_all.sh was not present. Later I found it in the 4.1.3 release. Do I need to set up once again in the 4.1.3 directory or just copy train_all.sh, train_others.sh and other script files? Thank you.

Building Arrival validator

Hello,

I try to build ARRIVAL validator through roswell with this command (see from this script)

    ros dynamic-space-size=8000 install numcl arrival eazy-gnuplot magicffi dataloader

But I get

; 
; compilation unit aborted
;   caught 1 fatal ERROR condition
;   caught 1 WARNING condition
[2/3] Processing build-hook..
[3/3] Attempting to install the scripts in roswell/ subdirectory of the system...
No roswell scripts found.

Any idea why that is ?

Thank you

How to use the Cube-Space AE (with trained weights) to encode images

I'm trying to use the Cube-Space AE with the trained weights to encode some MNIST 8-puzzle images, could you please explain the requirement of these images and procedures (or code) for this task?

The environment:

  • I am using the 4.1.3 version of source code; run ./setup-dataset.py
  • ./samples now contains a bunch of directories
...
puzzle_mnist_3_3_5000_None_100_None_False_ConcreteDetNormalizedLogitAddEffectTransitionAE_fixedactions
puzzle_mnist_3_3_5000_None_200_None_False_ConcreteDetNormalizedLogitAddEffectTransitionAE_fixedactions
puzzle_mnist_3_3_5000_None_300_None_False_ConcreteDetNormalizedLogitAddEffectTransitionAE_fixedactions
puzzle_mnist_3_3_5000_None_50_None_False_ConcreteDetNormalizedLogitAddEffectTransitionAE_fixedactions
puzzle_mnist_3_3_5000_None_None_0.0_False_ConcreteDetNormalizedLogitAddEffectTransitionAE_nodirect
puzzle_mnist_3_3_5000_None_None_None_False_ConcreteDetBoolAddEffectTransitionAE_arch
puzzle_mnist_3_3_5000_None_None_None_False_ConcreteDetBoolMinMaxEffectTransitionAE_arch
puzzle_mnist_3_3_5000_None_None_None_False_ConcreteDetBoolSmoothMinMaxEffectTransitionAE_arch
puzzle_mnist_3_3_5000_None_None_None_False_ConcreteDetLogitAddEffectTransitionAE_arch
puzzle_mnist_3_3_5000_None_None_None_False_ConcreteDetNormalizedLogitAddEffectTransitionAE_arch
puzzle_mnist_3_3_5000_None_None_None_False_ConcreteDetNormalizedLogitAddEffectTransitionAE_planning
puzzle_mnist_3_3_5000_None_None_None_False_ConcreteDetNoSucNormalizedLogitAddEffectTransitionAE_arch
puzzle_mnist_3_3_5000_None_None_None_False_VanillaTransitionAE_vanilla
...
  • I uncompressed the trained weight archive to a separate directory and I saw the following subdirectory puzzle_mnist_3_3_5000_None_None_None_False_ConcreteDetNormalizedLogitAddEffectTransitionAE_planning in ./weights/samples/.
    let P := puzzle_mnist_3_3_5000_None_None_None_False_ConcreteDetNormalizedLogitAddEffectTransitionAE_planning
  • I notice the single file grid_search.log in ./samples/P/, but this file is not in ./weights/samples/P/. I guess grid_search.log is used to record the result of grid-searching hyper parameters, and the floating point number of each line is the performance for that grid.

My questions are

  1. If I am trying to use the weights for MNIST 8-puzzle, do I just copy every file in ./weights/samples/P/ to ./samples/P/?
  2. Say I have an image of a MNIST 8-puzzle state [1 _ 2; 3 4 5; 6 7 8] and I want to use Cube-Space AE to encode the image into bit-vector representation, and maybe decode the vector back to image representation, where do I put the image file and what are the image file requirement (weight/height, format)?
  3. Are there any functions that directly encode/decode the image/vector? If not, which part of the code should I look into?

Error when trying to train CubeSpace-AE

I am trying to train CubeSpace-AE using the provided script and running into an error saying that I am giving more arguments than taken by the environment function.

  • I am running version 4.1.3 of the code. I have successfully run the setup-dataset.sh script.
  • In train_all.sh I uncomment the line task-planning learn_plot_dump_summary and only leave one of the function calls in task-planning uncommented. i.e. function task-planning only contains the call for the environment lightsout digital. I also set common to be the empty string.
  • After running ./train_all.sh I get the following error:
args: ['./strips.py', 'learn_plot_dump_summary', 'lightsout', 'digital', '4', '{}', 'planning', ':::', '5000', ':::', 'None', ':::', 'None', ':::', 'None', ':::', 'False', ':::', 'ConcreteDetNormalizedLogitAddEffectTransitionAE']
Fancy Traceback (most recent call last):
  File ./strips.py line 294 function <module> : main()
                    mode = 'learn_plot_dump_summary'
                sae_path = 'lightsout_digital_4_{}_planning_:::_5000_:::_None_:::_None_:::_None_:::_False_:::_ConcreteDetNormalizedLogitAddEffectTransitionAE'
      default_parameters = {'epoch': 200, 'batch_size': 500, 'optimizer': 'radam', 'max_temperature': 5.0, 'min_temperature': 0.7, 'M': 2, 'train_gumbel': True, 'train_softmax': True, 'test_gumbel': False, 'test_softmax': False, 'locality': 0.0, 'locality_delay': 0.0}
              parameters = {'beta': [-0.3, -0.1, 0.0, 0.1, 0.3], 'lr': [0.1, 0.01, 0.001], 'N': [100, 200, 500, 1000], 'M': [2], 'layer': [1000], 'clayer': [16], 'dropout': [0.4], 'noise': [0.4], 'dropout_z': [False], 'activation': ['relu'], 'num_actions': [100, 200, 400, 800, 1600], 'aae_width': [100, 300, 600], 'aae_depth': [0, 1, 2], 'aae_activation': ['relu', 'tanh'], 'aae_delay': [0], 'direct': [0.1, 1.0, 10.0], 'direct_delay': [0.05, 0.1, 0.2, 0.3, 0.5], 'zerosuppress': [0.1, 0.2, 0.5], 'zerosuppress_delay': [0.05, 0.1, 0.2, 0.3, 0.5], 'loss': ['BCE']}

  File ./strips.py line 290 function main : globals()[task](*map(myeval,sys.argv))
                    task = 'lightsout'


TypeError: lightsout() takes from 0 to 9 positional arguments but 16 were given

Could you let me know what I am doing wrong here? I have not made any modifications to other parts of the code.

No such file or directory: ...aux.json

Hello,

I re-installed latplan from the begining and did not modify any file.

When I execute this command:

./train_kltune.py learn_summary_plot_dump puzzle mnist 3 3 40000 CubeSpaceAE_AMA4Plus

Here is the error that appears:



WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.
Using TensorFlow backend.
0:00:00 0 | Estimated finish time:  ----/--/-- --:--:-- ------
0:00:00 1 | 2022-05-24 17:18:29 [t] elbo 4.27e+05  kl_a_z0     1.05  kl_a_z1     1.05  kl_z0     60.8  kl_z0z3      107  kl_z1     60.9  kl_z1z2      107  loss 9.62e+05  pdiff_z0z1   0.0832  pdiff_z0z2    0.312  pdiff_z0z3    0.338  pdiff_z1z2    0.337  tau        5  x0y0 2.12e+05  x0y3 2.16e+05  x1y1 2.12e+05  x1y2 2.16e+05
Fancy Traceback (most recent call last):
  File latplan/main/common.py line 115 function main : task(args)
              parameters = {'test_noise': False, 'test_hard': True, 'train_noise': True, 'train_hard': False, 'dropout_z': False, 'noise': 0.2, 'dropout': 0.2, 'optimizer': 'radam', 'min_temperature': 0.5, 'epoch': 2000, 'gs_annealing_start': 0, 'gs_annealing_end': 1000, 'clipnorm': 0.1, 'batch_size': [400], 'lr': [0.001], 'N': [50, 100, 300], 'zerosuppress': 0.1, 'densify': False, 'max_temperature': [5.0], 'conv_channel': [32], 'conv_channel_increment': [1], 'conv_kernel': [5], 'conv_pooling': [1], 'conv_per_pooling': [1], 'conv_depth': [3], 'fc_width': [100], 'fc_depth': [2], 'A': [6000], 'aae_activation': ['relu'], 'aae_width': [1000], 'aae_depth': [2], 'eff_regularizer': [None], 'beta_d': [1, 10, 100, '...<2 more>'], 'beta_z': [1, 10], 'output': 'GaussianOutput(sigma=0.1)'}

  File latplan/main/puzzle.py line 45 function puzzle : ae = run(os.path.join("samples",common.sae_path), transitions)
                    args = Namespace(aeclass='CubeSpaceAE_AMA4Plus', comment='', height=3, mode='learn_summary_plot_dump', num_examples=40000, type='mnist', width=3)
             transitions = '<numpy.ndarray float32  (40000, 2, 48, 48, 1)>'
                  states = '<numpy.ndarray float32  (80000, 48, 48, 1)>'

  File latplan/main/common.py line 228 function run : simple_genetic_search(
                   extra = None
                    path = 'samples/puzzle_mnist_3_3_40000_CubeSpaceAE_AMA4Plus'
                    test = '<numpy.ndarray float32  (2000, 2, 48, 48, 1)>'
                   train = '<numpy.ndarray float32  (36000, 2, 48, 48, 1)>'
             transitions = '<numpy.ndarray float32  (40000, 2, 48, 48, 1)>'
                     val = '<numpy.ndarray float32  (2000, 2, 48, 48, 1)>'

  File latplan/util/tuning.py line 531 function simple_genetic_search : open_list, close_list = _iter(config)
              parameters = {'test_noise': [False], 'test_hard': [True], 'train_noise': [True], 'train_hard': [False], 'dropout_z': [False], 'noise': [0.2], 'dropout': [0.2], 'optimizer': ['radam'], 'min_temperature': [0.5], 'epoch': [2000], 'gs_annealing_start': [0], 'gs_annealing_end': [1000], 'clipnorm': [0.1], 'batch_size': [400], 'lr': [0.001], 'N': [50, 100, 300], 'zerosuppress': [0.1], 'densify': [False], 'max_temperature': [5.0], 'conv_channel': [32], 'conv_channel_increment': [1], 'conv_kernel': [5], 'conv_pooling': [1], 'conv_per_pooling': [1], 'conv_depth': [3], 'fc_width': [100], 'fc_depth': [2], 'A': [6000], 'aae_activation': ['relu'], 'aae_width': [1000], 'aae_depth': [2], 'eff_regularizer': [None], 'beta_d': [1, 10, 100, '...<2 more>'], 'beta_z': [1, 10], 'output': ['GaussianOutput(sigma=0.1)'], 'mode': ['learn_summary_plot_dump'], 'type': ['mnist'], 'width': [3], 'height': [3], 'num_examples': [40000], 'aeclass': ['CubeSpaceAE_AMA4Plus'], 'comment': [''], 'generator': ['
      initial_population = 100
              population = 100
               open_list = []
              close_list = {}
              max_trials = 100
              gen_config = <generator object _random_configs at 0x154442ea9f20>
                    done = False
                       _ = 0
                  config = {'test_noise': False, 'test_hard': True, 'train_noise': True, 'train_hard': False, 'dropout_z': False, 'noise': 0.2, 'dropout': 0.2, 'optimizer': 'radam', 'min_temperature': 0.5, 'epoch': 2000, 'gs_annealing_start': 0, 'gs_annealing_end': 1000, 'clipnorm': 0.1, 'batch_size': 400, 'lr': 0.001, 'N': 100, 'zerosuppress': 0.1, 'densify': False, 'max_temperature': 5.0, 'conv_channel': 32, 'conv_channel_increment': 1, 'conv_kernel': 5, 'conv_pooling': 1, 'conv_per_pooling': 1, 'conv_depth': 3, 'fc_width': 100, 'fc_depth': 2, 'A': 6000, 'aae_activation': 'relu', 'aae_width': 1000, 'aae_depth': 2, 'eff_regularizer': None, 'beta_d': 10000, 'beta_z': 1, 'output': 'GaussianOutput(sigma=0.1)', 'mode': 'learn_summary_plot_dump', 'type': 'mnist', 'width': 3, 'height': 3, 'num_examples': 40000, 'aeclass': 'CubeSpaceAE_AMA4Plus', 'comment': '', 'generator': 'latplan.puzzles.puzzle_mnist', 'picsize': [48, 48], 'mean': [[[0.0], [0.0], [0.0], '...<45 more>'], [[0.0], [0.0], [0.
                   limit = 100
                    path = 'samples/puzzle_mnist_3_3_40000_CubeSpaceAE_AMA4Plus'
             report_best = None

  File latplan/util/tuning.py line 513 function _iter : artifact, eval = task(config)
              time_start = datetime.datetime(2022, 5, 24, 17, 18, 10, 209150)
                  config = {'test_noise': False, 'test_hard': True, 'train_noise': True, 'train_hard': False, 'dropout_z': False, 'noise': 0.2, 'dropout': 0.2, 'optimizer': 'radam', 'min_temperature': 0.5, 'epoch': 2000, 'gs_annealing_start': 0, 'gs_annealing_end': 1000, 'clipnorm': 0.1, 'batch_size': 400, 'lr': 0.001, 'N': 100, 'zerosuppress': 0.1, 'densify': False, 'max_temperature': 5.0, 'conv_channel': 32, 'conv_channel_increment': 1, 'conv_kernel': 5, 'conv_pooling': 1, 'conv_per_pooling': 1, 'conv_depth': 3, 'fc_width': 100, 'fc_depth': 2, 'A': 6000, 'aae_activation': 'relu', 'aae_width': 1000, 'aae_depth': 2, 'eff_regularizer': None, 'beta_d': 10000, 'beta_z': 1, 'output': 'GaussianOutput(sigma=0.1)', 'mode': 'learn_summary_plot_dump', 'type': 'mnist', 'width': 3, 'height': 3, 'num_examples': 40000, 'aeclass': 'CubeSpaceAE_AMA4Plus', 'comment': '', 'generator': 'latplan.puzzles.puzzle_mnist', 'picsize': [48, 48], 'mean': [[[0.0], [0.0], [0.0], '...<45 more>'], [[0.0], [0.0], [0.
                   limit = 100
                    path = 'samples/puzzle_mnist_3_3_40000_CubeSpaceAE_AMA4Plus'
             report_best = None

  File latplan/util/util.py line 2 function <lambda> : return lambda *args,**kwargs: fn(*args1,*args,**{**kwargs1,**kwargs})
                    args = ({'test_noise': False, 'test_hard': True, 'train_noise': True, 'train_hard': False, 'dropout_z': False, 'noise': 0.2, 'dropout': 0.2, 'optimizer': 'radam', 'min_temperature': 0.5, 'epoch': 2000, 'gs_annealing_start': 0, 'gs_annealing_end': 1000, 'clipnorm': 0.1, 'batch_size': 400, 'lr': 0.001, 'N': 100, 'zerosuppress': 0.1, 'densify': False, 'max_temperature': 5.0, 'conv_channel': 32, 'conv_channel_increment': 1, 'conv_kernel': 5, 'conv_pooling': 1, 'conv_per_pooling': 1, 'conv_depth': 3, 'fc_width': 100, 'fc_depth': 2, 'A': 6000, 'aae_activation': 'relu', 'aae_width': 1000, 'aae_depth': 2, 'eff_regularizer': None, 'beta_d': 10000, 'beta_z': 1, 'output': 'GaussianOutput(sigma=0.1)', 'mode': 'learn_summary_plot_dump', 'type': 'mnist', 'width': 3, 'height': 3, 'num_examples': 40000, 'aeclass': 'CubeSpaceAE_AMA4Plus', 'comment': '', 'generator': 'latplan.puzzles.puzzle_mnist', 'picsize': [48, 48], 'mean': [[[0.0], [0.0], [0.0], '...<45 more>'], [[0.0], [0.0], [0
                  kwargs = {}
                   args1 = ((<class 'latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus'>, 0), ('samples/puzzle_mnist_3_3_40000_CubeSpaceAE_AMA4Plus', 1), ('<numpy.ndarray float32  (36000, 2, 48, 48, 1)>', 2), ('...<3 more>', None))
                 kwargs1 = {}

  File latplan/util/tuning.py line 142 function nn_task : net.train(train_in,
                    path = 'samples/puzzle_mnist_3_3_40000_CubeSpaceAE_AMA4Plus'
                train_in = '<numpy.ndarray float32  (36000, 2, 48, 48, 1)>'
               train_out = '<numpy.ndarray float32  (36000, 2, 48, 48, 1)>'
                  val_in = '<numpy.ndarray float32  (2000, 2, 48, 48, 1)>'
                 val_out = '<numpy.ndarray float32  (2000, 2, 48, 48, 1)>'
              parameters = {'test_noise': False, 'test_hard': True, 'train_noise': True, 'train_hard': False, 'dropout_z': False, 'noise': 0.2, 'dropout': 0.2, 'optimizer': 'radam', 'min_temperature': 0.5, 'epoch': 2000, 'gs_annealing_start': 0, 'gs_annealing_end': 1000, 'clipnorm': 0.1, 'batch_size': 400, 'lr': 0.001, 'N': 100, 'zerosuppress': 0.1, 'densify': False, 'max_temperature': 5.0, 'conv_channel': 32, 'conv_channel_increment': 1, 'conv_kernel': 5, 'conv_pooling': 1, 'conv_per_pooling': 1, 'conv_depth': 3, 'fc_width': 100, 'fc_depth': 2, 'A': 6000, 'aae_activation': 'relu', 'aae_width': 1000, 'aae_depth': 2, 'eff_regularizer': None, 'beta_d': 10000, 'beta_z': 1, 'output': 'GaussianOutput(sigma=0.1)', 'mode': 'learn_summary_plot_dump', 'type': 'mnist', 'width': 3, 'height': 3, 'num_examples': 40000, 'aeclass': 'CubeSpaceAE_AMA4Plus', 'comment': '', 'generator': 'latplan.puzzles.puzzle_mnist', 'picsize': [48, 48], 'mean': [[[0.0], [0.0], [0.0], '...<45 more>'], [[0.0], [0.0], [0.
                  resume = False
                     net = <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>

  File latplan/network.py line 448 function train : clist.on_epoch_end(self.epoch,logs)
                        val_data = ['<numpy.ndarray float32  (2000, 2, 48, 48, 1)>']
                     val_data_to = ['<numpy.ndarray float32  (2000, 2, 48, 48, 1)>']
                          resume = False
                          kwargs = {'test_noise': False, 'test_hard': True, 'train_noise': True, 'train_hard': False, 'dropout_z': False, 'noise': 0.2, 'dropout': 0.2, 'optimizer': 'radam', 'min_temperature': 0.5, 'epoch': 2000, 'gs_annealing_start': 0, 'gs_annealing_end': 1000, 'clipnorm': 0.1, 'batch_size': 400, 'lr': 0.001, 'N': 100, 'zerosuppress': 0.1, 'densify': False, 'max_temperature': 5.0, 'conv_channel': 32, 'conv_channel_increment': 1, 'conv_kernel': 5, 'conv_pooling': 1, 'conv_per_pooling': 1, 'conv_depth': 3, 'fc_width': 100, 'fc_depth': 2, 'A': 6000, 'aae_activation': 'relu', 'aae_width': 1000, 'aae_depth': 2, 'eff_regularizer': None, 'beta_d': 10000, 'beta_z': 1, 'output': 'GaussianOutput(sigma=0.1)', 'mode': 'learn_summary_plot_dump', 'type': 'mnist', 'width': 3, 'height': 3, 'num_examples': 40000, 'aeclass': 'CubeSpaceAE_AMA4Plus', 'comment': '', 'generator': 'latplan.puzzles.puzzle_mnist', 'picsize': [48, 48], 'mean': [[[0.0], [0.0], [0.0], '...<45 more>'], [[0.0], [0
                           epoch = 2000
                     input_shape = ((2, 0), (48, 1), (48, 2), ('...<1 more>', None))
                             net = <keras.engine.training.Model object at 0x1544133b69d0>
                     index_array = '<numpy.ndarray int64    (36000,)>'
                           clist = <keras.callbacks.CallbackList object at 0x154413026460>
                         aborted = True
                            logs = {'t_loss': 961513.807638889, 't_tau': 5.0, 't_pdiff_z1z2': 0.33723170194360946, 't_pdiff_z0z3': 0.33751753667990364, 't_pdiff_z0z1': 0.08319545677966542, 't_pdiff_z0z2': 0.31239486038684844, 't_kl_z0': 60.83786286248101, 't_kl_z1': 60.90224732293023, 't_kl_a_z0': 1.053026196691725, 't_kl_a_z1': 1.0494115193684896, 't_kl_z1z2': 106.98173166910807, 't_kl_z0z3': 107.01499065823025, 't_x0y0': 212392.99565972222, 't_x1y1': 212254.3015625, 't_x0y3': 216092.028125, 't_x1y2': 215806.39965277776, 't_elbo': 426575.5024305555, 'v_loss': 963629.525, 'v_tau': 5.0, 'v_pdiff_z1z2': 0.33807403445243833, 'v_pdiff_z0z3': 0.3383484840393066, 'v_pdiff_z0z1': 0.0833947628736496, 'v_pdiff_z0z2': 0.3129697561264038, 'v_kl_z0': 60.833403778076175, 'v_kl_z1': 60.89156723022461, 'v_kl_a_z0': 1.040119481086731, 'v_kl_a_z1': 1.0365202665328979, 'v_kl_z1z2': 107.33934173583984, 'v_kl_z0z3': 107.41255035400391, 'v_x0y0': 212206.8, 'v_x1y1': 212671.03125, 'v_x0y3': 216667.725, 'v_x
                   indices_cache = ['<numpy.ndarray int64    (400,)>', '<numpy.ndarray int64    (400,)>', '<numpy.ndarray int64    (400,)>', '...<87 more>']
                train_data_cache = [['<numpy.ndarray float32  (400, 2, 48, 48, 1)>'], ['<numpy.ndarray float32  (400, 2, 48, 48, 1)>'], ['<numpy.ndarray float32  (400, 2, 48, 48, 1)>'], '...<87 more>']
             train_data_to_cache = [['<numpy.ndarray float32  (400, 2, 48, 48, 1)>'], ['<numpy.ndarray float32  (400, 2, 48, 48, 1)>'], ['<numpy.ndarray float32  (400, 2, 48, 48, 1)>'], '...<87 more>']
             train_subdata_cache = ['<numpy.ndarray float32  (400, 2, 48, 48, 1)>']
          train_subdata_to_cache = ['<numpy.ndarray float32  (400, 2, 48, 48, 1)>']
       train_subdata_batch_cache = '<numpy.ndarray float32  (400, 2, 48, 48, 1)>'
    train_subdata_to_batch_cache = '<numpy.ndarray float32  (400, 2, 48, 48, 1)>'
                               k = 'elbo'
                               v = 426803.48125
                      batch_size = 400
                        clipnorm = 0.1
                              lr = 0.001
                       optimizer = 'radam'
                   plot_val_data = '<numpy.ndarray float32  (1, 2, 48, 48, 1)>'
                            self = <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>
                      train_data = ['<numpy.ndarray float32  (36000, 2, 48, 48, 1)>']
                   train_data_to = ['<numpy.ndarray float32  (36000, 2, 48, 48, 1)>']

  File ../../../g100/home/userexternal/abarbin0/.conda/envs/latplan/lib/python3.8/site-packages/keras/callbacks.py line 152 function on_epoch_end : callback.on_epoch_end(epoch, logs)
                    self = <keras.callbacks.CallbackList object at 0x154413026460>
                   epoch = 0
                    logs = {'t_loss': 961513.807638889, 't_tau': 5.0, 't_pdiff_z1z2': 0.33723170194360946, 't_pdiff_z0z3': 0.33751753667990364, 't_pdiff_z0z1': 0.08319545677966542, 't_pdiff_z0z2': 0.31239486038684844, 't_kl_z0': 60.83786286248101, 't_kl_z1': 60.90224732293023, 't_kl_a_z0': 1.053026196691725, 't_kl_a_z1': 1.0494115193684896, 't_kl_z1z2': 106.98173166910807, 't_kl_z0z3': 107.01499065823025, 't_x0y0': 212392.99565972222, 't_x1y1': 212254.3015625, 't_x0y3': 216092.028125, 't_x1y2': 215806.39965277776, 't_elbo': 426575.5024305555, 'v_loss': 963629.525, 'v_tau': 5.0, 'v_pdiff_z1z2': 0.33807403445243833, 'v_pdiff_z0z3': 0.3383484840393066, 'v_pdiff_z0z1': 0.0833947628736496, 'v_pdiff_z0z2': 0.3129697561264038, 'v_kl_z0': 60.833403778076175, 'v_kl_z1': 60.89156723022461, 'v_kl_a_z0': 1.040119481086731, 'v_kl_a_z1': 1.0365202665328979, 'v_kl_z1z2': 107.33934173583984, 'v_kl_z0z3': 107.41255035400391, 'v_x0y0': 212206.8, 'v_x1y1': 212671.03125, 'v_x0y3': 216667.725, 'v_x1y2': 21
                callback = <keras.callbacks.LambdaCallback object at 0x1544130263d0>

  File latplan/network.py line 370 function <lambda> : self.plot_transitions(
                   epoch = 0
                    logs = {'t_loss': 961513.807638889, 't_tau': 5.0, 't_pdiff_z1z2': 0.33723170194360946, 't_pdiff_z0z3': 0.33751753667990364, 't_pdiff_z0z1': 0.08319545677966542, 't_pdiff_z0z2': 0.31239486038684844, 't_kl_z0': 60.83786286248101, 't_kl_z1': 60.90224732293023, 't_kl_a_z0': 1.053026196691725, 't_kl_a_z1': 1.0494115193684896, 't_kl_z1z2': 106.98173166910807, 't_kl_z0z3': 107.01499065823025, 't_x0y0': 212392.99565972222, 't_x1y1': 212254.3015625, 't_x0y3': 216092.028125, 't_x1y2': 215806.39965277776, 't_elbo': 426575.5024305555, 'v_loss': 963629.525, 'v_tau': 5.0, 'v_pdiff_z1z2': 0.33807403445243833, 'v_pdiff_z0z3': 0.3383484840393066, 'v_pdiff_z0z1': 0.0833947628736496, 'v_pdiff_z0z2': 0.3129697561264038, 'v_kl_z0': 60.833403778076175, 'v_kl_z1': 60.89156723022461, 'v_kl_a_z0': 1.040119481086731, 'v_kl_a_z1': 1.0365202665328979, 'v_kl_z1z2': 107.33934173583984, 'v_kl_z0z3': 107.41255035400391, 'v_x0y0': 212206.8, 'v_x1y1': 212671.03125, 'v_x0y3': 216667.725, 'v_x1y2': 21
           plot_val_data = '<numpy.ndarray float32  (1, 2, 48, 48, 1)>'
                    self = <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>

  File latplan/model.py line 1117 function plot_transitions : z = self.encode(x)
                    self = <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>
                    data = '<numpy.ndarray float32  (1, 2, 48, 48, 1)>'
                    path = 'samples/puzzle_mnist_3_3_40000_CubeSpaceAE_AMA4Plus/logs/15e7c133e5909c7240fdef903911e195/'
                 verbose = False
                   epoch = 0
                basename = 'samples/puzzle_mnist_3_3_40000_CubeSpaceAE_AMA4Plus/logs/15e7c133e5909c7240fdef903911e195/'
                     ext = ''
                pre_path = 'samples/puzzle_mnist_3_3_40000_CubeSpaceAE_AMA4Plus/logs/15e7c133e5909c7240fdef903911e195/_pre'
                suc_path = 'samples/puzzle_mnist_3_3_40000_CubeSpaceAE_AMA4Plus/logs/15e7c133e5909c7240fdef903911e195/_suc'
                       x = '<numpy.ndarray float32  (1, 2, 48, 48, 1)>'

  File latplan/model.py line 487 function encode : return self.adaptively(super().encode, data, *args, **kwargs)
                    self = <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>
                    data = '<numpy.ndarray float32  (1, 2, 48, 48, 1)>'
                    args = ()
                  kwargs = {}

  File latplan/model.py line 481 function adaptively : return fn(data,*args,**kwargs)
                    self = <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>
                      fn = <bound method AE.encode of <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>>
                    data = '<numpy.ndarray float32  (1, 2, 48, 48, 1)>'
                    args = ()
                  kwargs = {}

  File latplan/model.py line 119 function encode : self.load()
                    self = <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>
                    data = '<numpy.ndarray float32  (1, 2, 48, 48, 1)>'
                  kwargs = {}

  File latplan/network.py line 202 function load : self._load(path)
                    self = <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>
           allow_failure = False
                    path = ''

  File latplan/model.py line 1410 function _load : super()._load(path)
                    self = <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>
                    path = ''

  File latplan/network.py line 213 function _load : with open(self.local(os.path.join(path,"aux.json")), "r") as f:
                    self = <latplan.model.ConcreteDetNormalizedLogitAddBidirectionalTransitionAEPlus object at 0x154442e85b80>
                    path = ''


FileNotFoundError: [Errno 2] No such file or directory: 'samples/puzzle_mnist_3_3_40000_CubeSpaceAE_AMA4Plus/logs/15e7c133e5909c7240fdef903911e195/aux.json'



Any idea why it's creating this error ?

Thank you

some command line examples ?

Hello,

Could you give a command line example on how to generate a PDDL for the 8-puzzle with your trained weights and with a specific version of AMA (for instance AMA2, or AMA4), as well as how to visualize the actions sampled by the model (starting from a random state) ?

It would be of great help!

Thanks

no such file or directory; LD_LIBRARY_PATH

Hi there,
after executing the install.sh script,
when trying to run some experiments using the command

latplan mode hanoi 6 3 50 StateAE

I get the following error:
latplan_error

I checked for the value of LD_LIBRARY_PATH but it seems to be empty (also in the installation script is seems to be remained as empty)

I suspect that the problem relies in the versions of python packages,
is it possible that you provide the exact versions for all packages inside the environment.yml file?
or else - do you have any idea what this could happen and how to solve?
thanks in advance!

error while installing

Hello,

When running ./install.sh, I get an error:

49: (EVAL (ROSWELL:RUN (QUOTE ((:EVAL "(ros:quicklisp)") (:SCRIPT "/usr/local/etc/roswell/install.ros" "numcl" "arrival" "eazy-gnuplot" "magicffi" "dataloader") (:QUIT NIL)))))
50: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(progn #-ros.init(cl:load \"/usr/local/etc/roswell/init.lisp\"))") (:EVAL . "(ros:run '((:eval\"(ros:quicklisp)\")(:script \"/usr/local/etc/roswell/install.ros\"\"numcl\"\"arrival\"\"eazy-gnuplot\"\"magicffi\"\"dataloader\")(:quit ())))")))
51: (SB-IMPL::TOPLEVEL-INIT)
52: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
53: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
54: (SB-IMPL::START-LISP)

unhandled condition in --disable-debugger mode, quitting
;
; compilation unit aborted
;   caught 1 fatal ERROR condition

I cannot see where the error comes from.

Any idea ?

Thank you

Could you please add more information for ZSAE?

Hi,

I am very interested in LatPlan and i used SAE+AMA1(old version) with my own dataset, however when i increase width, height to 5 in puzzle function, training process was killed. (I guess it was caused by out-of-memory, not sure).
Ubuntu 16.04
CUDA 10.0
GPU NVIDIA TU102 -> 10989 MiB
For this reason, i wanted to use ZSAE, because according to your paper, ZSAE is SAE with additional regularization. It was said that it reduces the memory usage of the network by pruning some unused neurons. Then in your code, there are additional parameters such as zerosuppress, zerosuppress_delay for ZSAE. Could you please provide more information what are the meanings of those parameters?

Thank you very much,
Sincerely, Ulzhalgas Rakhman

lack of file latplan.py

An error occured when i ran the file train_all.sh. The command line implied no moudle named 'latplan' when running strips.py at line 6. I would be delighted if you can offer me the complete file.Thanks.

Compatibility issue + error

Hello,

Your code is supposed to run with tensorflow 1.15 and python 3.8, nevertheless tensorflow 1.15 is not compatible with 3.8, see screenshot below.

image

Also, when running your code with a different version of tensorflow (2.4), for instance with this command line:
latplan dump puzzle mnist 3 3 55 AE

it creates an error:
TypeError: Could not build a TypeSpec for <KerasTensor: shape=(None, 48, 48) dtype=float32 (created by layer 'tf.reshape_2')> with type KerasTensor

Questions about train_propositional.sh

Hello,

It seems that jbsub is a custom scheduler that we don't have access to. On my cluster one is using srun

So I tried to replace the first line (l.47) in train_propositional.sh that calls jbsub with srun, here is my file so far:


#!/bin/bash

set -e

trap exit SIGINT


ulimit -v 16000000000

export PYTHONUNBUFFERED=1
# sokoban problem 2 has the same small screen size as problem 0, and has more than 20000 states unlike problem 0.
# ('sokoban_image-20000-global-global-0-train.npz', array([56, 56,  3]), (3613, 1, 9408)) --- probelm 0 has only 3613 states!
# ('sokoban_image-20000-global-global-2-train.npz', array([56, 56,  3]), (19999, 1, 9408))
export skb_train=sokoban_image-20000-global-global-2-train
export SHELL=/bin/bash
export common


task (){
    script=$1 ; shift
    mode=$1
    # main training experiments. results are used for planning experiments

    $common $script $mode hanoi     4 4           {} $comment ::: 5000 ::: CubeSpaceAE_AMA{3,4}Conv
    $common $script $mode hanoi     3 9           {} $comment ::: 5000 ::: CubeSpaceAE_AMA{3,4}Conv
    $common $script $mode hanoi     4 9           {} $comment ::: 5000 ::: CubeSpaceAE_AMA{3,4}Conv
    $common $script $mode hanoi     5 9           {} $comment ::: 5000 ::: CubeSpaceAE_AMA{3,4}Conv
    $common $script $mode puzzle    mnist    3 3  {} $comment ::: 5000 ::: CubeSpaceAE_AMA{3,4}Conv
    $common $script $mode lightsout digital    5  {} $comment ::: 5000 ::: CubeSpaceAE_AMA{3,4}Conv
    $common $script $mode lightsout twisted    5  {} $comment ::: 5000 ::: CubeSpaceAE_AMA{3,4}Conv
    $common -queue x86_12h $script $mode puzzle    mandrill 4 4  {} $comment ::: 20000 ::: CubeSpaceAE_AMA3Conv
    $common -queue x86_24h $script $mode puzzle    mandrill 4 4  {} $comment ::: 20000 ::: CubeSpaceAE_AMA4Conv
    $common -queue x86_6h  $script $mode sokoban   $skb_train    {} $comment ::: 20000 ::: CubeSpaceAE_AMA3Conv
    $common -queue x86_12h $script $mode sokoban   $skb_train    {} $comment ::: 20000 ::: CubeSpaceAE_AMA4Conv
    $common -queue x86_12h $script $mode blocks    cylinders-4-flat {} $comment ::: 20000 ::: CubeSpaceAE_AMA3Conv
    $common -queue x86_24h $script $mode blocks    cylinders-4-flat {} $comment ::: 20000 ::: CubeSpaceAE_AMA4Conv
}

export -f task


proj=$(date +%Y%m%d%H%M)sae-planning
number=2

################################################################
## Train the network, and run plot, summary, dump for as the job finishes
#common="parallel -j 1 --keep-order jbsub -mem 16g -cores 1+1 -queue x86_6h -proj $proj -require 'v100||a100'"
common="parallel -j 1 --keep-order srun -N 1 -p g100_usr_interactive --gres=gpu:1 -proj $proj -require 'v100||a100'"



export comment=kltune$number
parallel -j 1 --keep-order task ./train_kltune.py learn_summary_plot_dump ::: {1..30}

exit

Which creates the error:

srun: fatal: Can not execute 202205230755sae-planning

I have hard time understanding what the "202205230755sae-planning" executable corresponds to, as well as what is the "-proj" argument of jbsub

Best regards

Aymeric

Issues with MagicFFI

Working in parallel with issue #12, I have had trouble extracting the PDDL files using ./train_others.sh

For each of the subdirectories I have generated by training new versions of the Cube-Space AE, the following .err file is created:

Unhandled UNBOUND-VARIABLE in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                        {10039A8103}>:
  The variable MAGICFFI::+MAGIC-VERSION+ is unbound.

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10039A8103}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<UNBOUND-VARIABLE +MAGIC-VERSION+ {1003A18EC3}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK SB-EXT:*INVOKE-DEBUGGER-HOOK* #<UNBOUND-VARIABLE +MAGIC-VERSION+ {1003A18EC3}>)
2: (INVOKE-DEBUGGER #<UNBOUND-VARIABLE +MAGIC-VERSION+ {1003A18EC3}>)
3: (ERROR #<UNBOUND-VARIABLE +MAGIC-VERSION+ {1003A18EC3}>)
4: (LPARALLEL.KERNEL::UNWRAP-RESULT #<unavailable argument>)
5: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN LPARALLEL.PROMISE::REPLACE-ERROR))
6: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-THREAD::CALL-WITH-MUTEX))
7: (SB-THREAD::CALL-WITH-MUTEX #<FUNCTION (FLET SB-THREAD::WITH-MUTEX-THUNK :IN LPARALLEL.PROMISE::REPLACE-ERROR) {7FCFB9FFEE8B}> #<SB-THREAD:MUTEX "Anonymous lock" owner: #<SB-THREAD:THREAD "main thread" RUNNING {10039A8103}>> T ())
8: (LPARALLEL.PROMISE::REPLACE-ERROR #S(LPARALLEL.PROMISE::%FUTURE :RESULT (#S(LPARALLEL.KERNEL::WRAPPED-ERROR :VALUE #<UNBOUND-VARIABLE +MAGIC-VERSION+ {1003A18EC3}>)) :LOCK #<SB-THREAD:MUTEX "Anonymous lock" owner: #<SB-THREAD:THREAD "main thread" RUNNING {10039A8103}>> :FN () :CANCELEDP ()))
9: (FORCE #S(LPARALLEL.PROMISE::%FUTURE :RESULT (#S(LPARALLEL.KERNEL::WRAPPED-ERROR :VALUE #<UNBOUND-VARIABLE +MAGIC-VERSION+ {1003A18EC3}>)) :LOCK #<SB-THREAD:MUTEX "Anonymous lock" owner: #<SB-THREAD:THREAD "main thread" RUNNING {10039A8103}>> :FN () :CANCELEDP ()))
10: ((LAMBDA () :IN MAIN))
11: (SB-EXT:CALL-WITH-TIMING #<FUNCTION SB-IMPL::PRINT-TIME> #<FUNCTION (LAMBDA () :IN MAIN) {100056F9EB}>)
12: (MAIN "samples/puzzle_mnist_3_3_5000_None_None_None_False_ConcreteDetNormalizedLogitAddEffectTransitionAE_planning_0.75/" "3" "actions_both+ids.csv" "0" "1.00")
13: (ROSWELL::ENTRY "ACTIONLEARNER::MAIN")
14: (ROSWELL:RUN ((:ENTRY "ACTIONLEARNER::MAIN")))
15: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
16: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-IMPL::START-LISP))
17: (SB-IMPL::START-LISP)

unhandled condition in --disable-debugger mode, quitting
Evaluation took:
  0.000 seconds of real time
  0.005002 seconds of total run time (0.004099 user, 0.000903 system)
  100.00% CPU
  6,278,368 processor cycles
  163,536 bytes consed
  
  before it was aborted by a non-local transfer of control.

I presume that this is due to a faulty installation of the magicffi library. I attempted to reinstall that package following the directions in the README and install.sh (running ros dynamic-space-size=8000 install guicho271828/magicffi) but get the following output indicating that there's a fatal error and compilation was aborted, without any information where I may have gone astray in my setup...
The output:

tkillian@vws82:~/Research/latplan$ ros dynamic-space-size=8000 install guicho271828/magicffi
Installing from github guicho271828/magicffi
To load "magicffi":
  Load 1 ASDF system:
    magicffi
; Loading "magicffi"
...
; compiling file "/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/package.lisp" (written 22 APR 2021 05:23:12 PM):
; processing (IN-PACKAGE :CL-USER)
; processing (DEFPACKAGE :MAGICFFI ...)

; wrote /h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/package-tmp9V47YWQF.fasl
; compilation finished in 0:00:00.004
[1/3] System 'magicffi' found. Loading the system..; cc -o /h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/grovel__grovel-tmp9BN22RMA.o -c -idirafter /usr/include/linux -I/usr/include -I/usr/local/include -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wunused-parameter -fno-omit-frame-pointer -momit-leaf-frame-pointer -fPIC -I/h/tkillian/.roswell/lisp/quicklisp/dists/quicklisp/software/cffi_0.24.1/ /h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/grovel__grovel.c
/h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/grovel__grovel.c: In function ‘main’:
/h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/grovel__grovel.c:11:7: warning: unused variable ‘autotype_tmp’ [-Wunused-variable]
   int autotype_tmp;
       ^~~~~~~~~~~~
; cc -o /h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/grovel__grovel-tmp1CXFJSK9 -g -Wl,--export-dynamic /h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/grovel__grovel.o
; /h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/grovel__grovel /h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/grovel__grovel.grovel-tmp.lisp
; compiling file "/h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/grovel.processed-grovel-file" (written 27 APR 2021 09:06:16 PM):
; processing (IN-PACKAGE #:MAGICFFI)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; processing (WARN (QUOTE CFFI-GROVEL:MISSING-DEFINITION) ...)
; 
; caught WARNING:
;   No definition for NONE

; 
; caught WARNING:
;   No definition for DEBUG

; 
; caught WARNING:
;   No definition for SYMLINK

; 
; caught WARNING:
;   No definition for COMPRESS

; 
; caught WARNING:
;   No definition for DEVICES

; 
; caught WARNING:
;   No definition for MIME-TYPE

; 
; caught WARNING:
;   No definition for CONTINUE

; 
; caught WARNING:
;   No definition for CHECK

; 
; caught WARNING:
;   No definition for PRESERVE-ATIME

; 
; caught WARNING:
;   No definition for RAW

; 
; caught WARNING:
;   No definition for ERROR

; 
; caught WARNING:
;   No definition for MIME-ENCODING

; 
; caught WARNING:
;   No definition for MIME

; 
; caught WARNING:
;   No definition for APPLE

; 
; caught WARNING:
;   No definition for EXTENSION

; 
; caught WARNING:
;   No definition for COMPRESS-TRANSP

; 
; caught WARNING:
;   No definition for NO-CHECK-COMPRESS

; 
; caught WARNING:
;   No definition for NO-CHECK-TAR

; 
; caught WARNING:
;   No definition for NO-CHECK-SOFT

; 
; caught WARNING:
;   No definition for NO-CHECK-APPTYPE

; 
; caught WARNING:
;   No definition for NO-CHECK-ELF

; 
; caught WARNING:
;   No definition for NO-CHECK-TEXT

; 
; caught WARNING:
;   No definition for NO-CHECK-CDF

; 
; caught WARNING:
;   No definition for NO-CHECK-TOKENS

; 
; caught WARNING:
;   No definition for NO-CHECK-ENCODING

; 
; caught WARNING:
;   No definition for NO-CHECK-BUILTIN

; 
; caught WARNING:
;   No definition for NO-CHECK-ASCII

; 
; caught WARNING:
;   No definition for NO-CHECK-FORTRAN

; 
; caught WARNING:
;   No definition for NO-CHECK-TROFF

; processing (DEFBITFIELD (MAGIC-FLAGS) ...)

; wrote /h/tkillian/.cache/common-lisp/sbcl-2.1.3-linux-x64/h/tkillian/.roswell/local-projects/guicho271828/magicffi/src/grovel-tmpX4BRKI0R.fasl
; compilation finished in 0:00:00.016
; 
; compilation unit aborted
;   caught 1 fatal ERROR condition
;   caught 29 WARNING conditions
[2/3] Processing build-hook..
[3/3] Attempting to install the scripts in roswell/ subdirectory of the system...
No roswell scripts found.

@guicho271828 any ideas where I may have gone wrong in setting up the lisp code? All other set-up ran without error. I was also able to run ./train_all.sh without issue as well.

No definition of plot_transitions in network.py

In latplan\latplan\network.py there is this piece of code:

              on_epoch_end = lambda epoch,logs: \
                    self.plot_transitions(
                        plot_val_data,
                        self.path+"/",
                        epoch=epoch),

But no definition of plot_transitions function in network.py

So for instance, when I run

latplan learn puzzle mnist 3 3 40000 StateAE

I get this error:

  File latplan/network.py line 450 function <lambda> : self.plot_transitions(
                   epoch = 50
                    logs = {'t_loss': 237913.65086805556, 'v_loss': 236870.45}
           plot_val_data = '<numpy.ndarray float32  (1, 2, 48, 48, 1)>'
                    self = <latplan.model.StateAE object at 0x14b2840da4c0>

                     AttributeError: 'StateAE' object has no attribute 'plot_transitions'

Best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.