Closed ncble closed 5 years ago
Since the srl_zoo is less popular than robotic-rl-srl, I decided to post the changelog here:
Note: Before, we need to modify 8 scripts in order to add one new model, now only two scripts (at most three): models/modules.py and models/my_custom_model.py (see the template models/new_model_template.py)
Support any image resolution for the entire toolbox (--img-shape="(3,128,128)"), including the DataLoader, Environment, SRL models. Before, the SRL models are not scalable with respect to image shape, and it's not sufficient to modify only the input shape (e.g. need to manually calculate each layers' shape, size, etc). Now, all models function more like keras.
Support adversarial state representation learning. (e.g. GAN)
[New scripts] models/base_trainer.py, models/new_model_template.py, models/gan.py
Better (simpler, ~10 times faster) plots
Support new monitor mode (--monitor) "loss" (before, there is only "pbar" progressbar): monitor losses during training, calculate GTC per epoch.
Support control of number of CPU for dataloader (--num-worker).
Support "anytime training": load the previous trained SRL model weights to continue the training --srl-pre-weights (weights path)
Change validation mechanism to the classic one (i.e. within one epoch: train then valid). Before, we alternate between training and validation mode at batch level.
Support specific GPU number. (by --gpu-num=0, --gpu_num1, etc)
[Remove]: preprocessing/preprocess.py (it's useless), models/custom_layers.py
[Rename] the models/models.py is renamed to models/base_models.py, since it's more intuitive for the outsider. Currently, there are several confusing names "custom_layers.py", "modules.py", "learner.py" "models.py
support any image shape.
support specific GPU number. (by --gpu-num=0, --gpu_num1, etc)
support --srl-model-path indicate the SRL model weights path. Before, we can only load either the latest (by calling --latest) or manually change the config/srl_model.yaml model weights path.
register new srl models
fix issues:
[New] replay/plot_pipeline.py: aggregate all losses and plot on one figure. (draft code to be refined, merged with replay/aggregate_plots.py, compare_plots.py, gather_results.py)
Btw, why did you use a branch on your repo where you could create a branch on the original repo? (you are part of the collaborators), same for srl-robotics repo
The original version (master) of srl_zoo has 5719 lines of code. My pull-request has already added and removed +4145/-1453 lines of code, thus 5598 lines of code have been modified (~97% of code). There is no need to be merged to the master branch.
Image rotated by 90 degrees
Image preprocessing
Instead of using specific image preprocessing (mode='imagenet') as
the mode='tf' that rescale pixel value to [-1,1] is preferable and could avoid unwanted effect when applying training with the other datasets/networks.