Repository: RomeroBarata/skeleton_based_anomaly_detection Branch: master Commit: 37c3203866d1 Files: 110 Total size: 626.7 KB Directory structure: gitextract_xhfl4dwo/ ├── .gitignore ├── README.md ├── environment.yml ├── evaluate.py ├── pretrained/ │ └── CVPR19/ │ ├── Avenue/ │ │ └── combined_model/ │ │ └── _mp_Grobust_Lrobust_Orobust_concatdown_/ │ │ └── 01_2018_11_13_06_36_20/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_082_0.18.h5 │ └── ShanghaiTech/ │ └── combined_model/ │ └── _mp_Grobust_Lrobust_Orobust_concatdown_/ │ ├── 01_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ ├── 02_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ ├── 03_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ ├── 04_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ ├── 05_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ ├── 06_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ ├── 07_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ ├── 08_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ ├── 09_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ ├── 10_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ ├── 11_2018_11_09_10_55_13/ │ │ ├── architecture.txt │ │ ├── global_scaler.pkl │ │ ├── local_scaler.pkl │ │ ├── out_scaler.pkl │ │ ├── training_report.csv │ │ └── weights_065_0.14.h5 │ └── 12_2018_11_09_10_55_13/ │ ├── architecture.txt │ ├── global_scaler.pkl │ ├── local_scaler.pkl │ ├── out_scaler.pkl │ ├── training_report.csv │ └── weights_065_0.14.h5 ├── tbad/ │ ├── __init__.py │ ├── autoencoder/ │ │ ├── __init__.py │ │ ├── autoencoder.py │ │ ├── data.py │ │ ├── evaluate.py │ │ └── train.py │ ├── combined_model/ │ │ ├── __init__.py │ │ ├── data.py │ │ ├── evaluate.py │ │ ├── fusion.py │ │ ├── message_passing.py │ │ └── train.py │ ├── data.py │ ├── eval.py │ ├── gpu.py │ ├── losses.py │ ├── rnn_autoencoder/ │ │ ├── __init__.py │ │ ├── data.py │ │ ├── evaluate.py │ │ ├── rnn.py │ │ └── train.py │ ├── train.py │ ├── utils.py │ └── visualisation.py ├── train.py ├── utils/ │ ├── metrics.py │ └── score_scaling.py └── visualise.py ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ pip-wheel-metadata/ share/python-wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ .pytest_cache/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py db.sqlite3 # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # IPython profile_default/ ipython_config.py # pyenv .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. # However, in case of collaboration, if having platform-specific dependencies or dependencies # having no cross-platform support, pipenv may install dependencies that don’t work, or not # install all needed dependencies. #Pipfile.lock # celery beat schedule file celerybeat-schedule # SageMath parsed files *.sage.py # Environments .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ .dmypy.json dmypy.json # Pyre type checker .pyre/ ================================================ FILE: README.md ================================================ This is the code for the CVPR'19 paper ["Learning Regularity in Skeleton Trajectories for Anomaly Detection in Videos".](https://openaccess.thecvf.com/content_CVPR_2019/html/Morais_Learning_Regularity_in_Skeleton_Trajectories_for_Anomaly_Detection_in_Videos_CVPR_2019_paper.html) # Environment Setup First please create an appropriate environment using conda: > conda env create -f environment.yml > conda activate tbad # Download Data Due to space constraints in the Github repository, please download the data from the following link and place the `data` folder in this directory. Link: [trajectories](https://bit.ly/2TWCxFY) # Test Pre-Trained Models To evaluate pre-trained models run the evaluate.py script. Some examples: #### Evaluate MPED-RNN on all cameras individually and all cameras combined on HR-ShanghaiTech. > python evaluate.py --gpu_ids 0 --gpu_memory 0.2 combined_models ./pretrained/CVPR19/ShanghaiTech/combined_model/\_mp_Grobust_Lrobust_Orobust_concatdown\_ ./data/HR-ShanghaiTech/testing/trajectories ./data/HR-ShanghaiTech/testing/frame_level_masks --video_resolution 856x480 --overlapping_trajectories #### Evaluate MPED-RNN on HR-Avenue. > python evaluate.py --gpu_ids 0 --gpu_memory 0.2 combined_model ./pretrained/CVPR19/Avenue/combined_model/\_mp_Grobust_Lrobust_Orobust_concatdown\_/01_2018_11_13_06_36_20 ./data/HR-Avenue/testing/trajectories/01 ./data/HR-Avenue/testing/frame_level_masks/01 --video_resolution 640x360 --overlapping_trajectories # Train Models from Scratch To train a model from scratch you should look up the model's configuration options using the option --help on the training.py script. Here is one example: #### Train MPED-RNN on the ShanghaiTech data set. > python train.py --gpu_ids 0 --gpu_memory 0.1 combined_model ./data/HR-ShanghaiTech/training/trajectories/00 --video_resolution 856x480 --message_passing --reconstruct_original_data --multiple_outputs --multiple_outputs_before_concatenation --input_length 12 --rec_length 12 --pred_length 6 --reconstruct_reverse --cell gru --global_hidden 8 --local_hidden 16 --output_activation linear --optimiser adam --learning_rate 0.001 --loss mse --epochs 5 --batch_size 256 --global_normalisation robust --local_normalisation robust --out_normalisation robust ================================================ FILE: environment.yml ================================================ name: tbad channels: - defaults dependencies: - _tflow_180_select=1.0=gpu - absl-py=0.2.2=py36_0 - astor=0.6.2=py36_0 - blas=1.0=mkl - bleach=1.5.0=py36_0 - bzip2=1.0.6=h14c3975_5 - ca-certificates=2018.03.07=0 - cairo=1.14.12=h7636065_2 - certifi=2018.10.15=py36_0 - cloudpickle=0.6.1=py36_0 - cudatoolkit=9.0=h13b8566_0 - cudnn=7.1.2=cuda9.0_0 - cupti=9.0.176=0 - cycler=0.10.0=py36h93f1223_0 - dask-core=0.20.1=py36_0 - dbus=1.13.2=h714fa37_1 - decorator=4.3.0=py36_0 - expat=2.2.5=he0dffb1_0 - ffmpeg=4.0=h04d0a96_0 - fontconfig=2.12.6=h49f89f6_0 - freetype=2.8=hab7d2ae_1 - gast=0.2.0=py36_0 - glib=2.56.1=h000015b_0 - graphite2=1.3.11=h16798f4_2 - grpcio=1.12.0=py36hdbcaa40_0 - gst-plugins-base=1.14.0=hbbd80ab_1 - gstreamer=1.14.0=hb453b48_1 - h5py=2.8.0=py36ha1f6525_0 - harfbuzz=1.7.6=h5f0a787_1 - hdf5=1.10.2=hba1933b_1 - html5lib=0.9999999=py36_0 - icu=58.2=h9c2bf20_1 - imageio=2.4.1=py36_0 - intel-openmp=2018.0.3=0 - jasper=1.900.1=hd497a04_4 - jpeg=9b=h024ee3a_2 - keras=2.1.6=py36_0 - kiwisolver=1.0.1=py36h764f252_0 - libedit=3.1.20170329=h6b74fdf_2 - libffi=3.2.1=hd88cf55_4 - libgcc-ng=8.2.0=hdf63c60_1 - libgfortran-ng=7.2.0=hdf63c60_3 - libopenblas=0.2.20=h9ac9557_7 - libopencv=3.4.1=h1a3b859_1 - libopus=1.2.1=hb9ed12e_0 - libpng=1.6.34=hb9fc6fc_0 - libprotobuf=3.5.2=h6f1eeef_0 - libstdcxx-ng=8.2.0=hdf63c60_1 - libtiff=4.0.9=he85c1e1_1 - libvpx=1.7.0=h439df22_0 - libxcb=1.13=h1bed415_1 - libxml2=2.9.8=h26e45fe_1 - markdown=2.6.11=py36_0 - matplotlib=2.2.2=py36h0e671d2_1 - mkl=2018.0.3=1 - mkl_fft=1.0.6=py36h7dd41cf_0 - mkl_random=1.0.1=py36h4414c95_1 - ncurses=6.1=hf484d3e_0 - networkx=2.2=py36_1 - numpy=1.15.3=py36h1d66e8a_0 - numpy-base=1.15.3=py36h81de0dd_0 - olefile=0.46=py36_0 - opencv=3.4.1=py36h6fd60c2_2 - openssl=1.0.2p=h14c3975_0 - pcre=8.42=h439df22_0 - pillow=5.1.0=py36h3deb7b8_0 - pip=10.0.1=py36_0 - pixman=0.34.0=hceecf20_3 - protobuf=3.5.2=py36hf484d3e_0 - py-opencv=3.4.1=py36h0676e08_1 - pyparsing=2.2.0=py36hee85983_1 - pyqt=5.9.2=py36h751905a_0 - python=3.6.5=hc3d631a_2 - python-dateutil=2.7.3=py36_0 - pytz=2018.4=py36_0 - pywavelets=1.0.1=py36hdd07704_0 - pyyaml=3.12=py36hafb9ca4_1 - qt=5.9.5=h7e424d6_0 - readline=7.0=ha6073c6_4 - scikit-image=0.14.0=py36hf484d3e_1 - scikit-learn=0.20.0=py36h4989274_1 - scipy=1.1.0=py36hfa4b5c9_1 - setuptools=39.2.0=py36_0 - sip=4.19.8=py36hf484d3e_0 - six=1.11.0=py36h372c433_1 - sqlite=3.23.1=he433501_0 - tensorboard=1.8.0=py36hf484d3e_0 - tensorflow=1.8.0=hb11d968_0 - tensorflow-base=1.8.0=py36hc1a7637_0 - tensorflow-gpu=1.8.0=h7b35bdc_0 - termcolor=1.1.0=py36_1 - tk=8.6.7=hc745277_3 - toolz=0.9.0=py36_0 - tornado=5.0.2=py36_0 - werkzeug=0.14.1=py36_0 - wheel=0.31.1=py36_0 - xz=5.2.4=h14c3975_4 - yaml=0.1.7=had09818_2 - zlib=1.2.11=ha838bed_2 - pip: - chardet==3.0.4 - dask==0.20.1 - easydict==1.7 - idna==2.7 - msgpack==0.5.6 - nibabel==2.3.0 - pandas==0.23.4 - pyzmq==17.1.2 - requests==2.19.1 - tqdm==4.23.4 - urllib3==1.23 - visdom==0.1.8.5 - websocket-client==0.52.0 ================================================ FILE: evaluate.py ================================================ import argparse from tbad.autoencoder.evaluate import eval_ae, eval_aes from tbad.rnn_autoencoder.evaluate import eval_rnn_ae, eval_rnn_aes from tbad.combined_model.evaluate import eval_combined_model, eval_combined_models from tbad.gpu import configure_gpu_resources def create_arg_parser(): parser = argparse.ArgumentParser(description='Functions for Evaluation of Trained Trajectory-Based Anomaly Models.') gp_gpu = parser.add_argument_group('GPU') gp_gpu.add_argument('--gpu_ids', default='0', type=str, help='Which GPUs to use.') gp_gpu.add_argument('--gpu_memory_fraction', default=0.20, type=float, help='Fraction of the memory to grab from each GPU.') subparsers = parser.add_subparsers(title='sub-commands', description='Valid sub-commands.') # Create sub-parser for evaluation of a pre-trained Autoencoder model parser_ae = subparsers.add_parser('autoencoder', help='Evaluate a Trained Autoencoder Model.') parser_ae.add_argument('pretrained_model', type=str, help='Directory containing pre-trained model architecture definition, model weights and ' 'data scaler.') parser_ae.add_argument('trajectories', type=str, help='Directory containing skeleton\'s trajectories.') parser_ae.add_argument('frame_level_anomaly_masks', type=str, help='Directory containing .npy files for each video in the specific camera.') parser_ae.add_argument('--video_resolution', default='856x480', type=str, help='Resolution of the trajectories\' original video(s). It should be specified ' 'as WxH, where W is the width and H the height of the video.') parser_ae.set_defaults(func=eval_ae) # Create sub-parser for evaluation of multiple pre-trained Autoencoder models parser_aes = subparsers.add_parser('autoencoders', help='Evaluate Several Trained Autoencoder Models.') parser_aes.add_argument('pretrained_models', type=str, help='Directory containing a folder for each pre-trained model.') parser_aes.add_argument('all_trajectories', type=str, help='Directory containing a folder for each camera, where each folder contains the ' 'trajectories for the associated camera.') parser_aes.add_argument('all_frame_level_anomaly_masks', type=str, help='Directory containing a folder for the anomaly masks of each camera.') parser_aes.add_argument('--video_resolution', default='856x480', type=str, help='Resolution of the trajectories\' original video(s). It should be specified ' 'as WxH, where W is the width and H the height of the video.') parser_aes.set_defaults(func=eval_aes) # Create sub-parser for evaluation of a pre-trained RNN Autoencoder model parser_rnn_ae = subparsers.add_parser('rnn_autoencoder', help='Evaluate a Trained RNN Autoencoder model.') parser_rnn_ae.add_argument('pretrained_model', type=str, help='Directory containing pre-trained model architecture definition, model weights and ' 'data scaler.') parser_rnn_ae.add_argument('trajectories', type=str, help='Directory containing skeleton\'s trajectories.') parser_rnn_ae.add_argument('frame_level_anomaly_masks', type=str, help='Directory containing .npy files for each video in the specific camera.') parser_rnn_ae.add_argument('--video_resolution', default='856x480', type=str, help='Resolution of the trajectories\' original video(s). It should be specified ' 'as WxH, where W is the width and H the height of the video.') parser_rnn_ae.add_argument('--overlapping_trajectories', action='store_true') gp_rnn_ae_logging = parser_rnn_ae.add_argument_group('Evaluation Logging') gp_rnn_ae_logging.add_argument('--write_reconstructions', type=str, help='TO DO') parser_rnn_ae.set_defaults(func=eval_rnn_ae) # Create sub-parser for evaluation of multiple pre-trained RNN Autoencoder models parser_rnn_aes = subparsers.add_parser('rnn_autoencoders', help='Evaluate Multiple Pre-Trained RNN Autoencoder models.') parser_rnn_aes.add_argument('pretrained_models', type=str, help='Directory containing a folder for each pre-trained model.') parser_rnn_aes.add_argument('all_trajectories', type=str, help='Directory containing a folder for each camera, where each folder contains the ' 'trajectories for the associated camera.') parser_rnn_aes.add_argument('all_frame_level_anomaly_masks', type=str, help='Directory containing a folder for the anomaly masks of each camera.') parser_rnn_aes.add_argument('--video_resolution', default='856x480', type=str, help='Resolution of the trajectories\' original video(s). It should be specified ' 'as WxH, where W is the width and H the height of the video.') parser_rnn_aes.add_argument('--overlapping_trajectories', action='store_true') gp_rnn_aes_logging = parser_rnn_aes.add_argument_group('Evaluation Logging') gp_rnn_aes_logging.add_argument('--write_reconstructions', type=str, help='TO DO') parser_rnn_aes.set_defaults(func=eval_rnn_aes) # Create a sub-parser for evaluation of a trained Combined model parser_combined_model = subparsers.add_parser('combined_model', help='Evaluate a Trained Combined Model.') parser_combined_model.add_argument('pretrained_model', type=str, help='Directory containing pre-trained model architecture definition, model ' 'weights and data scaler.') parser_combined_model.add_argument('trajectories', type=str, help='Directory containing skeleton\'s trajectories.') parser_combined_model.add_argument('frame_level_anomaly_masks', type=str, help='Directory containing .npy files for each video in the specific camera.') parser_combined_model.add_argument('--video_resolution', default='856x480', type=str, help='Resolution of the trajectories\' original video(s). It should be ' 'specified as WxH, where W is the width and H the height of the video.') parser_combined_model.add_argument('--overlapping_trajectories', action='store_true') gp_combined_model_logging = parser_combined_model.add_argument_group('Evaluation Logging') gp_combined_model_logging.add_argument('--write_reconstructions', action='store_true') gp_combined_model_logging.add_argument('--write_bounding_boxes', action='store_true') gp_combined_model_logging.add_argument('--write_predictions', action='store_true') gp_combined_model_logging.add_argument('--write_predictions_bounding_boxes', action='store_true') gp_combined_model_logging.add_argument('--write_anomaly_masks', action='store_true') gp_combined_model_logging.add_argument('--write_mistakes', action='store_true') parser_combined_model.set_defaults(func=eval_combined_model) # Create a sub-parser for evaluation of multiple pre-trained Combined models parser_combined_models = subparsers.add_parser('combined_models', help='Evaluate Multiple Pre-Trained Combined Models.') parser_combined_models.add_argument('pretrained_models', type=str, help='Directory containing a folder for each pre-trained model.') parser_combined_models.add_argument('all_trajectories', type=str, help='Directory containing a folder for each camera, where each folder ' 'contains the trajectories for the associated camera.') parser_combined_models.add_argument('all_frame_level_anomaly_masks', type=str, help='Directory containing a folder for the anomaly masks of each camera.') parser_combined_models.add_argument('--video_resolution', default='856x480', type=str, help='Resolution of the trajectories\' original video(s). It should be ' 'specified as WxH, where W is the width and H the height of the video.') parser_combined_models.add_argument('--overlapping_trajectories', action='store_true') gp_combined_models_logging = parser_combined_models.add_argument_group('Evaluation Logging') gp_combined_models_logging.add_argument('--write_reconstructions', action='store_true') gp_combined_models_logging.add_argument('--write_bounding_boxes', action='store_true') gp_combined_models_logging.add_argument('--write_predictions', action='store_true') gp_combined_models_logging.add_argument('--write_predictions_bounding_boxes', action='store_true') gp_combined_models_logging.add_argument('--write_anomaly_masks', action='store_true') gp_combined_models_logging.add_argument('--write_mistakes', action='store_true') parser_combined_models.set_defaults(func=eval_combined_models) return parser def main(): arg_parser = create_arg_parser() args = arg_parser.parse_args() configure_gpu_resources(args.gpu_ids, args.gpu_memory_fraction) args.func(args) if __name__ == '__main__': main() ================================================ FILE: pretrained/CVPR19/Avenue/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/01_2018_11_13_06_36_20/architecture.txt ================================================ input_length 8 global_input_dim 4 local_input_dim 34 reconstruction_length 8 prediction_length 4 global_hidden_dims 4 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/Avenue/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/01_2018_11_13_06_36_20/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_17_loss,lambda_18_loss,lambda_19_loss,lambda_20_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_17_loss,val_lambda_18_loss,val_lambda_19_loss,val_lambda_20_loss,val_loss 0,0.11800168941915744,0.12459907877734619,0.12586481022780693,0.16076345357456853,0.1202342000710101,0.15309949816478202,0.8025627316204612,0.060672088723322165,0.06335619812880999,0.07390559731545025,0.1306328365820894,0.0666653175880493,0.12943479693468724,0.5246668432825918 1,0.04264999330079231,0.04385549256414593,0.06630541469995441,0.11840400360256138,0.057461323533256926,0.1206354320535614,0.44931166026063707,0.02645336641235743,0.02559398967844407,0.04045831857793713,0.11343651213107976,0.03943298323152784,0.12211376363394202,0.3674889352753028 2,0.0223515782107815,0.021640446626767885,0.03882002682909945,0.09935061318155074,0.039582240617523634,0.1104181403907091,0.3321630442527624,0.021369165546086765,0.019295117848458533,0.026530996953558657,0.09779851006321993,0.033549534963949135,0.11240843725104571,0.3109517656613551 3,0.018138549421584375,0.016958347521040803,0.028113804411931304,0.08774068994051425,0.03341998055000445,0.10239329661187563,0.2867646686391194,0.019328966377213975,0.01667258001443098,0.02160795821856261,0.09092963825908972,0.031172390660695375,0.10687807927048036,0.2865896110557607 4,0.01602760045705867,0.014243821566534287,0.023466028865341045,0.08104862331049724,0.029935479593409028,0.09722613338845162,0.26194768828435594,0.0187493067305283,0.015375004891100358,0.019106957452137006,0.08576107946872563,0.02954086463281007,0.10328987426708974,0.27182308681110356 5,0.014545547784136446,0.012497422414354451,0.02053044248489673,0.07614609705565907,0.027615578276897177,0.0933698176362264,0.24470490563908523,0.017284015009745097,0.014231618829672749,0.017661438904550044,0.08204657967132414,0.028299877596967046,0.10073499422703079,0.2602585246665074 6,0.013524692510845725,0.011486068657158417,0.018573216259022092,0.07254207473313533,0.026008217375627234,0.09037917734772465,0.2325134463609628,0.016446538675058468,0.013315639342687225,0.016243875308816734,0.07906991099761851,0.027229519851140395,0.09880589374672323,0.2511113788736007 7,0.012850218394891233,0.010708142304256308,0.017098088250055404,0.06962974746702863,0.024824778847978388,0.08800856618361357,0.22311954137677573,0.01576625138999863,0.012992358896569167,0.015708209195796893,0.07654268260117941,0.026110631568111078,0.09706135146426237,0.24418148374350304 8,0.012177510851335338,0.01008746272316847,0.015983029682428984,0.06730052186830093,0.023692554392465506,0.08604705961411113,0.21528813967824806,0.014964405152123493,0.012124704249511911,0.014854501910891538,0.07451717784220131,0.02517199753376081,0.09577476664970633,0.2374075511221853 9,0.011746880256041918,0.009642291125248828,0.015116656247212501,0.0654251147367586,0.02270544195866444,0.08452923154366195,0.20916561583903281,0.014563912246260656,0.011475063315844181,0.014405440740301178,0.07274399700324259,0.024188843049330975,0.09466896786323843,0.2320462259204398 10,0.011436837722206357,0.00931382515887141,0.01443028824285912,0.06395260486395363,0.02186692913463362,0.08323793617878938,0.20423842047112759,0.014335946150154134,0.011134353914650182,0.013771377648975559,0.07147267368557955,0.023472696747966135,0.09366070305723939,0.22784775073745842 11,0.0110998794502289,0.008978029784968403,0.013845564414612153,0.06275961753566368,0.021143397410453676,0.08217032224219044,0.19999681103275757,0.01416677831366316,0.010787042390559769,0.01336460638950879,0.07041644734867532,0.022780737547697598,0.09277280787044176,0.22428841732585747 12,0.010901352640319486,0.008729673560467778,0.013382402663040933,0.061737400239619676,0.02057610578773129,0.08125559949817304,0.19658253521369415,0.013589264235611308,0.010498014199798945,0.013189884768665984,0.06954466931239779,0.022265554308627682,0.09196414548989262,0.22105153229649507 13,0.010659124778987715,0.00849514162993697,0.01296030283096234,0.06087530283456027,0.02003871871949786,0.08044538255474935,0.19347397400843386,0.013530310221978368,0.010213057765786893,0.012583797981397178,0.06877626761248362,0.02171956003868454,0.09145275936511124,0.21827575199023896 14,0.010477417132225213,0.008297237355618745,0.012553393201904758,0.060172433244922954,0.019615092337303786,0.07969372297342171,0.190809296108004,0.013229618312630278,0.010049707466397668,0.01246526240458461,0.06812385497886449,0.02130542615223919,0.09072568126989403,0.21589954938302494 15,0.01032478898495958,0.008138345060032812,0.012269161868950725,0.05952667525253959,0.019231348567381287,0.07902742977617715,0.18851774935479232,0.012866691650948786,0.00983280172192305,0.0122101296139459,0.06761135093631913,0.020982494407225327,0.09018122580556823,0.2136846960497376 16,0.010191289738311588,0.00799879209752122,0.011950293182181777,0.05893194159566931,0.018947722604016778,0.07840007639902623,0.18642011492280963,0.012750160608678816,0.00956717255299253,0.011991719070135215,0.06713177873056399,0.020656028587872903,0.08964139675405883,0.21173825648206868 17,0.01005044005330611,0.007898199009632697,0.01170024063150851,0.05841205597724198,0.01864649181932212,0.07782521728134667,0.1845326441549748,0.012901631498120812,0.009428109883485115,0.011544604760881982,0.0665694621734409,0.020463824720763035,0.08915331783518889,0.21006095059757127 18,0.009906318020335217,0.007739048784462473,0.011414728108985002,0.05784927367183228,0.018365046244202824,0.07726791785209187,0.18254233169202805,0.012470669450133132,0.009315572102096863,0.01139561083482279,0.06616040639704167,0.019996960039818826,0.08867163042532665,0.20801085050545592 19,0.009750975987859217,0.007653524365934713,0.011203634984601,0.05729626520207635,0.01814295339755983,0.07676857045081639,0.18081592531890928,0.0124553181265708,0.009303331954958534,0.01122260906442787,0.06558261998113381,0.019875413071639342,0.08806855351306281,0.20650784299471303 20,0.009689291188929063,0.007613773303615723,0.011065034126743414,0.05675972614000219,0.018001302826628544,0.07627664163797557,0.1794057697186394,0.012213250159671557,0.009155070057403571,0.011082501928215069,0.06496334406602168,0.019604042581728272,0.0877558909689581,0.20477410007677488 21,0.00960458595435714,0.007492870176132966,0.01083636793619514,0.056214556786994684,0.017774629456142964,0.07576345497474665,0.17768646601336327,0.012380685336416106,0.00925055750724319,0.011149982970339737,0.06464736442955142,0.0196088448861726,0.08733627153184753,0.20437370622698228 22,0.009494057130006523,0.007417745341795484,0.010656945806893938,0.05568818561466979,0.017612299936158083,0.07530888633542263,0.1761781200802002,0.01209447354345376,0.0089488286264287,0.01076391095400763,0.06410659587185329,0.019586183345795122,0.08687239679294592,0.20237238799504506 23,0.009440535405491056,0.007369678701100959,0.010533671961063909,0.05519107952201468,0.017488487911687358,0.07483623633699923,0.1748596902141098,0.012148142662211503,0.009130114655072259,0.010821242289517068,0.06352008748764876,0.019994526377732823,0.08657366259128761,0.20218777539084817 24,0.009317133333024911,0.007253636531888924,0.01034160007370231,0.054715803565764755,0.01728236796006237,0.07440379243705952,0.17331433412933284,0.012039918421861882,0.009030442997064004,0.010654237716788834,0.06318224526937151,0.01928932808945447,0.08611625016040864,0.20031242301048216 25,0.009271950292806891,0.007227062066104208,0.010248282905859525,0.05426524038539403,0.017167852727793007,0.07397056576463604,0.1721509541041904,0.01216979021256215,0.008914646456419293,0.010474829318858615,0.06286040072639783,0.019424026407657537,0.08571985055484956,0.19956354286306618 26,0.00920455878266741,0.007169179138709255,0.010117410042166321,0.053876704023573384,0.017047923953167076,0.07355676377510066,0.17097253885810798,0.01185481378827117,0.008872618095042828,0.01047339468378132,0.06242155373179713,0.019330725453049407,0.08543495241203418,0.19838805906451465 27,0.009143204149618674,0.007108272343046893,0.010009288534489071,0.053494050056516466,0.01693781701214989,0.07318936678809622,0.169881999489374,0.01189852514362609,0.009162895475536779,0.010428875903838876,0.06218343905637458,0.01927520601803808,0.08505789445126967,0.1980068356187206 28,0.009108170696519665,0.007064030584210144,0.009888988398249258,0.05319549127080705,0.01679630360433968,0.07277870729621777,0.16883169227175757,0.011819624886018456,0.008841513793523556,0.01049758031245143,0.06184724240588668,0.01917218807668493,0.08474880668509828,0.19692695565859328 29,0.009086060466460244,0.007070579592470153,0.009817500541413353,0.05289527426925742,0.01671202331490381,0.07248034867654014,0.16806178635321517,0.011780992757313966,0.00886212310116116,0.010148741346497776,0.061609385263412954,0.019290272344174332,0.08445714964935455,0.19614866589589713 30,0.009017746680568178,0.007002196083141312,0.009718746060935476,0.05260831917195532,0.016580709973354597,0.07212208289441657,0.16704980132161604,0.01177286619695122,0.008736548972334007,0.01023352578858146,0.06146271069881562,0.0192677605420832,0.08415743265784283,0.19563084633582722 31,0.008990007566377323,0.006960089193686141,0.00963689457446049,0.05233893757040966,0.016504515417277026,0.07181968784371312,0.1662501322088421,0.01177544875734114,0.008721863983625639,0.010097658256453841,0.061194443086672094,0.01940044851177028,0.0837882056388331,0.1949780687995019 32,0.008976882353098172,0.006931328584511373,0.009576388693385562,0.05212827774900745,0.016394780110905158,0.07156315868983681,0.16557081594437853,0.011764791355486253,0.008831590152456015,0.009995551346867703,0.06091151339788751,0.019082613711370808,0.083498509988087,0.19408456920134512 33,0.008911094350216843,0.006880791509534006,0.009481865081620989,0.05189503557561066,0.016318519609617686,0.0712473532697116,0.16473465934812875,0.011615577684559302,0.00880604016034986,0.010128175336832884,0.06086485109145711,0.018972192727339188,0.0832321437261883,0.19361898105089742 34,0.008869275038731438,0.0068510980487063635,0.009421702679832084,0.05168381967922191,0.016247432531253887,0.07099401975888626,0.16406734759455338,0.01183543501024075,0.008737400675933602,0.009888830843302384,0.060614550549798245,0.01922085700980963,0.08297300894185669,0.19327008147960417 35,0.00886342101521352,0.006808834119986915,0.009379140450001539,0.05148132032736968,0.016185799237569815,0.0707469347255525,0.16346545115024388,0.011643062778971142,0.008692542094769665,0.00986427152072658,0.060373951718534914,0.018918021951474292,0.08278329687078571,0.19227514499688578 36,0.008791591286714306,0.006754130935723385,0.009315819370653273,0.05129100576668486,0.01608954490063647,0.07049819570503488,0.16274028773875868,0.011579880190575015,0.008828161010885186,0.009846938521937137,0.06017241195944952,0.01910009027315936,0.08246166604292977,0.1919891475326966 37,0.008773778349358514,0.006745741563212583,0.009252609048137676,0.05105934945949542,0.016033918123424713,0.07029772102658327,0.1621631178416761,0.01167714783504448,0.008687737618829109,0.009676433829122415,0.060063090674870506,0.019095609600474787,0.08235162641554794,0.19155164563844546 38,0.008759426539200537,0.006731035809312823,0.00920399150957559,0.05087929453189237,0.01596349086844859,0.07008247937835238,0.16161971868321043,0.011682512482291772,0.008709611862835438,0.009780693078363888,0.05975217001499929,0.019222302538643966,0.08212142241835446,0.19126871462696313 39,0.00873874740010684,0.00670927877317675,0.009191839108523347,0.05073177855919677,0.015918090533646293,0.0698914059226985,0.1611811400380155,0.011557862823071741,0.008635113448769428,0.009627448689148598,0.059556240334986604,0.018838191013563536,0.08204706298785133,0.19026192247608595 40,0.008743522292275846,0.006711545295726165,0.009153523775296895,0.05054660522352436,0.01588038345243757,0.06971925813672698,0.160754838036499,0.011455491969961972,0.008678058554862946,0.009584060451565027,0.059492254563827535,0.0188388697517438,0.08204539823169518,0.19009413415234255 41,0.008674181921787252,0.006626997177616988,0.00908011536892445,0.05038955518805816,0.015791370286255785,0.06955921015934277,0.16012142970517404,0.011415599120698736,0.00861636985817139,0.009592451758146249,0.05936399141984427,0.018729350220904557,0.08182856811223231,0.1895463300705844 42,0.00865017745460118,0.00659722329467758,0.009038744429183287,0.05019972644224809,0.015749249130605752,0.06938381640707456,0.15961893803321553,0.01151677355815412,0.008926787305407084,0.009573075785645596,0.05910455943550626,0.018568886718571112,0.0815938971728586,0.18928398242801853 43,0.008624835821409528,0.00655539590795314,0.009007949398763813,0.050063805221406694,0.015688123403703912,0.06927152090329361,0.15921163098801897,0.011385075523085028,0.008683904986377645,0.009470142053543115,0.05893633602976725,0.01871405605950539,0.08145127967601234,0.18864079695229646 44,0.00860515855079502,0.006554824330079906,0.00897603351695742,0.04989990030421933,0.01565066704188581,0.06911231145425736,0.15879889550393894,0.01142817772930681,0.00868938210253239,0.009468779259220848,0.05890911622383371,0.018799543206150453,0.08137189827669784,0.1886668966876136 45,0.008581577358797854,0.006524326812430531,0.00893803313132582,0.04973752683859412,0.015588007430213373,0.06896272380756742,0.15833219603297782,0.011383895203239944,0.00858138977826881,0.009403280424177277,0.0587604811390796,0.018521206134330184,0.08122441229022563,0.18787466262453908 46,0.008554877187875561,0.00648692832029365,0.008902815227492505,0.04961175081759309,0.015547000742841642,0.06887289751087318,0.15797627037678325,0.011374130952596886,0.008743227859392466,0.009651235407096935,0.05846977602715895,0.01899856291907885,0.08104118624555258,0.18827812038801384 47,0.008521979091355254,0.0064556316602350184,0.008891787955586575,0.049457807784913634,0.015530849069430249,0.06872196869384156,0.15758002399013418,0.011308330300534034,0.008799784569229299,0.009582057871007719,0.05849523019117276,0.018454279808973875,0.08118923449880731,0.18782891817321545 48,0.008524221524098437,0.0064612647744539614,0.008856570155837443,0.04932210981529088,0.015474510973960784,0.068623411447319,0.15726208848211062,0.011412901791132881,0.008653225868877918,0.009422180951589719,0.05836281301783228,0.018665765934178062,0.08108329898744249,0.18760018661146502 49,0.008519076826552131,0.0064427262739769784,0.008826925585304773,0.0491855745159665,0.01544573489830919,0.06848457404058113,0.1569046124503535,0.011080985652684037,0.008622903408902373,0.009225861279237241,0.058192079783891903,0.01827891516741446,0.08088357446681706,0.18628431892705807 50,0.008459682348562357,0.006422174033964744,0.008773666087913927,0.04909674502904549,0.015416060100462176,0.06840056471142522,0.15656889330249932,0.011308025024440498,0.00837685493116448,0.009286379041572227,0.058099612020173476,0.018343078019935694,0.08075443944766017,0.18616838743973785 51,0.008483211756727673,0.0064086635962988985,0.008745579540226292,0.048952189580574894,0.015368079364129122,0.0683147636096401,0.15627248764707605,0.011189944209666226,0.008428367323194146,0.009325700638033011,0.05786842152633555,0.018427952455760233,0.08058722788256417,0.18582761479156643 52,0.00843428315772054,0.006365253378045479,0.008685669304391993,0.04882188118678831,0.015325108041376118,0.06817360744052013,0.1558058016390096,0.011207668293697596,0.008429245133887141,0.009260379113280055,0.05759122615308957,0.018154696972426755,0.08063141823342171,0.18527463448484222 53,0.008425982461577157,0.0063716253914675855,0.008679417102768679,0.048747656612090094,0.015304525416381342,0.06813387512901185,0.15566308234293275,0.01130589966712523,0.008752482920112742,0.009268342834116323,0.05763608908418318,0.018360909348565328,0.08052554720357144,0.18584927104871365 54,0.008411891551398057,0.006358830119391816,0.008626698797569974,0.048630931287936316,0.01528133533052392,0.06807491345753816,0.1553846013597894,0.01112095548665529,0.008456144674405372,0.009151392187379776,0.05741401257202686,0.01829381299469317,0.08034853506336147,0.1847848522087789 55,0.008387932041729806,0.006355295632949677,0.008634663525100405,0.04852170799566669,0.015231267526914267,0.0679463894805306,0.15507725609028833,0.011086676150680624,0.00851252863763454,0.009478106878554503,0.05730357543003996,0.017956176304450913,0.08013932012636642,0.1844763852040787 56,0.008380537912362561,0.006309523294360157,0.008585222970294527,0.048433557766519364,0.015232364984167121,0.06786188951301843,0.154803096373559,0.010957692482136999,0.008280246154203419,0.009091346796941934,0.05734869448120072,0.01796029127722642,0.08039350442537456,0.18403177571955265 57,0.008345295899214683,0.006324981975605198,0.008549818480851101,0.0483419473354654,0.015187427266602946,0.0677623398301325,0.15451181093398836,0.011034375852382032,0.00826892773285485,0.00907276872450672,0.05711618843497067,0.018212354564513204,0.08022150939098062,0.18392612501137157 58,0.008325615541308945,0.006299902744448664,0.008537059948004386,0.04825345218636316,0.015148093746494257,0.06770536636507807,0.15426949019760242,0.010990209867807786,0.008270306819396627,0.008982319333362217,0.05712461610995857,0.017709752881216158,0.08005512231749307,0.183132326293998 59,0.008299864977735856,0.006242269524055699,0.008479757274493085,0.04815591756426312,0.015097683261327427,0.06761016402822796,0.15388565733148302,0.010933787564120952,0.008236061303554337,0.00902898398399686,0.05693582779757359,0.017675531838461527,0.07996852401803548,0.18277871871886234 60,0.008291746904404753,0.00624096512480385,0.008446764155707392,0.048063526306719666,0.015063443026886343,0.06753705860932757,0.1536435039705051,0.010988911585639503,0.00853075631021237,0.009162548149593087,0.05697437347803776,0.01780105588644336,0.07994291754722743,0.18340056400669796 61,0.008276752107553336,0.006249096297254604,0.008440041782913802,0.04800385663231398,0.015074802710687346,0.06746451051571878,0.15350905960257197,0.010903901332951181,0.008217858383721082,0.008912011851515553,0.056710619687534575,0.01771618917232933,0.07994061914717167,0.18240120054253284 62,0.008278235716784172,0.006248869996364283,0.00842571995590084,0.04795566508122911,0.015077849983328563,0.06739010217275408,0.1533764421581101,0.010917416529921892,0.008275796498722917,0.008967324839887561,0.05676887192937397,0.017841420045051976,0.07976102850947374,0.18253185654615187 63,0.008299416168476842,0.0062634432200562,0.008444287486817772,0.04790946297678216,0.015064933523562989,0.06742778288275532,0.15340932609853408,0.010792776647421013,0.008150792621858857,0.008989368831885667,0.056805297172750326,0.017696196860839015,0.07971718586625186,0.1821516180523133 64,0.008211212639606698,0.006184420752986878,0.008357884543895229,0.04776752801099317,0.014979785620920338,0.06727993491991942,0.15278076571451402,0.010876289117343674,0.008176399114056682,0.008800343170988678,0.056823024673076386,0.017702402851083574,0.07979608062842039,0.18217454131514593 65,0.008188957777069898,0.006184182077460066,0.00834528832371262,0.04769824185522771,0.01496320508196522,0.06721190090822203,0.15259177572808505,0.010943679193070611,0.008299889860843545,0.008870215667960882,0.056706499130292236,0.017820722575534728,0.07972718155315617,0.18236818751013847 66,0.008180428704281704,0.006163718423003547,0.008321907150710663,0.047635476142500625,0.01496223945396631,0.06718034939731735,0.15244411959568663,0.010994863746980289,0.008147109223588663,0.008820383147001822,0.05650378159905797,0.017888970014625902,0.07950966363780844,0.18186477215152436 67,0.008167420412654997,0.006167045192105569,0.008324933897317196,0.047565427206320086,0.014921883464309085,0.06709956257007704,0.1522462725119212,0.010788773509952998,0.008185517665346788,0.008753071709066019,0.05646616831875084,0.01757607064981645,0.0795022976983045,0.181271899720477 68,0.008160267794116095,0.0061571809370960075,0.008278162474266111,0.04750304081922287,0.014914108341869379,0.0670247860990255,0.1520375458041869,0.010796355607923441,0.008106558400273906,0.008726865065317025,0.056524997985211316,0.017461403621063513,0.0795389962452565,0.18115517767614492 69,0.008159121800205739,0.00614615891383392,0.008260877591051334,0.04743723316128139,0.014906533088730392,0.06698170898033154,0.15189163442760392,0.01112184019338439,0.008071431590095024,0.008657805100175848,0.05653853242272253,0.01749130075104872,0.07942852309444245,0.18130943268389527 70,0.008140453194738599,0.0061382124970096735,0.008250602669538209,0.047387275965031415,0.014875461539860618,0.06691691886912646,0.15170892561783117,0.010718518777182159,0.008164193696838998,0.008896218568276241,0.05645895830264822,0.017368080507221613,0.07941857844933377,0.18102454627192885 71,0.008094803223266528,0.006109257459637504,0.008251518139115493,0.04733353833230095,0.014842990377542303,0.0668589707871116,0.15149107834827946,0.010621339276093067,0.008008020439183468,0.008697477559553845,0.05638549597338443,0.017245946612155897,0.07942661845826496,0.18038489846229405 72,0.008086668210025938,0.0060843838627232865,0.008196416020573019,0.047237470348308934,0.01481917213582042,0.06681423338677304,0.151238343695146,0.010696099554827353,0.008076779744810409,0.008548013382076218,0.0562946604417948,0.017559899657751964,0.07935391769765845,0.1805293694841499 73,0.008083263020213493,0.00608319613862037,0.008192865260861075,0.0472164320731908,0.014799006528696325,0.06673608178526434,0.15111084548352138,0.010684927319038329,0.008000028079455403,0.008630012567857457,0.056091455142646754,0.017792070863744177,0.07937904706769372,0.18057754004523296 74,0.008083135558303924,0.006106024953747924,0.008186850704980304,0.04715174426046642,0.014796873345941939,0.0667100741879738,0.15103470275738007,0.010644999962568302,0.00799469853760611,0.008690875249641383,0.05615589078365461,0.017462782971653452,0.07920291910929608,0.18015216692847394 75,0.008075208113049718,0.006078515010693537,0.008170439224090604,0.04709198171182437,0.014774070578132474,0.06667158032796881,0.15086179463830923,0.010701999143847049,0.00839861293775992,0.008707437960836808,0.05624078761746912,0.01735850923343762,0.07920880306542179,0.18061614989272412 76,0.008068196237793843,0.0060882037640447185,0.00815349702567019,0.04702903830911538,0.014764839167256563,0.06661002082528505,0.15071379594821874,0.010702519369595478,0.00800277452038926,0.008847471794274229,0.05601832761546605,0.017200924831885938,0.07908183462977927,0.17985385330307196 77,0.008022936993999912,0.006055169701209578,0.008111031494066537,0.046977151319804934,0.01474213065943939,0.06658326616192277,0.15049168620507866,0.010674810817021204,0.008193872280940321,0.008499016946564358,0.055995529557998545,0.01718013369074192,0.07911632063178303,0.1796596827509239 78,0.008006862506225702,0.006049465853720903,0.008106166331350258,0.04690858230661567,0.01471128992706762,0.06652434170137082,0.15030670993973014,0.01073286466778578,0.008070702858362868,0.00844717802032412,0.05595728712217694,0.017180055048036914,0.07906516426786882,0.17945325117463432 79,0.007998558814454684,0.006040314202644685,0.008075097121759288,0.0468434740195534,0.014682369219313481,0.06649248389761847,0.15013229773787032,0.010733517540085767,0.007998183450426312,0.008463936539922976,0.05595630678347665,0.017304928807401827,0.07902308238507205,0.1794799543792309 80,0.00800126886848456,0.006050388036855771,0.00806446339489218,0.04684039174780914,0.014674830262368517,0.06639827612618061,0.1500296184938209,0.010951925400924342,0.008167459418468782,0.008548015233737426,0.05597885206461989,0.01750953106844392,0.07915453793172286,0.18031032132314348 81,0.007982130451021911,0.006022035118184528,0.008040774177058198,0.04675589723635953,0.014630482784584821,0.06638060832214662,0.14981192773307728,0.01055522491631672,0.007853269447820535,0.008371124100136617,0.05567147015304317,0.017175635177246684,0.07888231056954534,0.17850903482687983 82,0.007947618770909754,0.005993559013454874,0.008001756512405827,0.04670048609407576,0.014625565118903415,0.06632208838905672,0.14959107349959264,0.010580698517425775,0.007996904040547464,0.008476768911675701,0.05568648238153579,0.017078388786992065,0.07888343758663725,0.1787026798702929 83,0.007964899219037692,0.006002817792081711,0.00800093567346207,0.046662179990010336,0.014647371256995584,0.06628438737253636,0.1495625909781387,0.010567610776127032,0.007865115629467468,0.00846442429454041,0.055726411000291874,0.01712266342572216,0.07882683865221889,0.17857306378920726 84,0.007918006421459815,0.005987631081801482,0.007968954626540455,0.04659903546810447,0.01459376438044164,0.06624541120595298,0.14931280354362894,0.010982597595217166,0.008116063946299601,0.008664873745442732,0.05560944684215172,0.017924300303612157,0.07878262762611583,0.18007991033762896 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/01_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/01_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/02_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/02_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/03_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/03_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/04_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/04_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/05_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/05_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/06_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/06_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/07_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/07_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/08_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/08_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/09_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/09_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/10_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/10_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/11_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/11_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/12_2018_11_09_10_55_13/architecture.txt ================================================ input_length 12 global_input_dim 4 local_input_dim 34 reconstruction_length 12 prediction_length 6 global_hidden_dims 8 local_hidden_dims 16 extra_hidden_dims output_activation linear reconstruct_reverse True reconstruct_original_data True multiple_outputs True multiple_outputs_before_concatenation True cell_type gru optimiser adam learning_rate 0.001 loss mse l1_reg 0.0 l2_reg 0.0 ================================================ FILE: pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/12_2018_11_09_10_55_13/training_report.csv ================================================ epoch,dense_14_loss,dense_9_loss,lambda_25_loss,lambda_26_loss,lambda_27_loss,lambda_28_loss,loss,val_dense_14_loss,val_dense_9_loss,val_lambda_25_loss,val_lambda_26_loss,val_lambda_27_loss,val_lambda_28_loss,val_loss 0,0.029125705570853408,0.029847205965794408,0.04481872873383093,0.18057588653412762,0.04289848201920371,0.1828160467525054,0.5100820570405953,0.004735653380491816,0.004381425982601341,0.012086026719442696,0.11879763961383098,0.014986722538376558,0.1300569647686523,0.2850444321984324 1,0.003241854165861908,0.0031851323763014273,0.009876334753333625,0.11588565249155722,0.011695036169829781,0.13155527143591328,0.27543928012522834,0.0023776189865064874,0.0024051106589492166,0.009010716668064649,0.09673793184883701,0.010148880412539283,0.11334251728568229,0.23402277535705246 2,0.0020624825342874433,0.002006102089736452,0.00835313227154338,0.09841402452287085,0.0095990880651096,0.12052887182151656,0.24096370178156876,0.0017630881913961191,0.0017274214911610338,0.008028584224520642,0.08749710036628021,0.009089501632967647,0.10751897039363802,0.21562466552081577 3,0.0016774065966217032,0.0015777490619820972,0.007578286029095361,0.09051340608964388,0.008821162243286489,0.11477660628245266,0.22494461666658452,0.0015362741197251927,0.0014324511512579159,0.007322589812099016,0.08049985427761444,0.008542061366980467,0.10244517179073018,0.2017784005823145 4,0.0014674535954722072,0.0013391816214609713,0.006977109359735158,0.08338759604302212,0.00837477599049125,0.10954692207356907,0.21109303867650164,0.0013341421436740288,0.001204360283134357,0.0065865317237730125,0.07486775121941305,0.00802377888781253,0.09847737560118623,0.1904939402302045 5,0.00126773872688773,0.0011552416579594434,0.0062616433987845365,0.0781978081057097,0.007849926576264923,0.1060986307932635,0.2008309894045685,0.0011516839574313128,0.0010634435492947532,0.005878902360449001,0.07006104793875495,0.0074801128793446975,0.09618700185862837,0.181822192439197 6,0.0011244726937000159,0.0010185253090466376,0.005660027631498085,0.07379045170810995,0.007323994404372241,0.10375700809888061,0.19267447988688224,0.001032941824393958,0.0009677417909673687,0.0053433147306550825,0.06690054809747951,0.0069516347747478795,0.09452911903527889,0.17572529903388853 7,0.0010313739713858927,0.0009137302752238689,0.00525917910389004,0.07130988207991887,0.006854583052465759,0.10202344332476349,0.18739219143870853,0.0009259232486469904,0.0008540316844220044,0.005032719140451775,0.06514489106107511,0.0065148202225315584,0.09363875407769329,0.1721111397289818 8,0.0009689955233615539,0.0008450602998684311,0.005022780766568064,0.06967693309773679,0.006491371175883964,0.1007059088540619,0.18371105015250952,0.0008970686321361717,0.0007840815429754191,0.004844459692612797,0.06391364448713073,0.006233961138940576,0.09229205226674986,0.16896526658675062 9,0.0009073009811210361,0.0007846467166902128,0.004862820446971536,0.068396189712297,0.006245508318007729,0.09964012450107247,0.1808365902110088,0.0008492880513540157,0.0007379862805851587,0.004717444484585733,0.06297408751873983,0.0060762651680441445,0.09156784045505624,0.16692291138226015 10,0.0008713984784643907,0.0007442243140032974,0.004743495009174236,0.06722119500723142,0.0060859601756558055,0.09872339744531432,0.17838967064593128,0.0008166064721014424,0.0006961534448776536,0.004589391763673556,0.06189762959649776,0.0059102633979516836,0.09080950184867616,0.16471954598593297 11,0.0008374930655080777,0.0007097154738029792,0.004614090591145283,0.06610427180840461,0.005963880475164679,0.09783466622358145,0.1760641188276293,0.0007760136011268825,0.000682990035915917,0.004434138910011677,0.06085281671119167,0.0057830653567488375,0.09012591077254285,0.16265493392947866 12,0.0008119078182204317,0.0006868114957133419,0.004430562028369358,0.06507626391059299,0.00586683593442581,0.09703476066246462,0.17390714128286094,0.0008175804639859116,0.0006848252755577496,0.004236954214453897,0.06028657458519279,0.0057084814914026534,0.08962073318373505,0.1613551491006762 13,0.00078793316796032,0.0006620368048715703,0.004216760175350991,0.0642709923187426,0.005779663354721898,0.0963713871255329,0.17208877246371573,0.000742177354030854,0.0006214537361875933,0.004015095072263449,0.05947589561258966,0.005607937430149475,0.08908702170990003,0.15954958068165 14,0.0007609138284408751,0.0006378616350021573,0.004041573392221517,0.06362585588910852,0.005708239646199687,0.09576604463997652,0.17054048827452328,0.0007504390181574597,0.0006056014401164378,0.003847134944604999,0.059068552681841885,0.005545279048459288,0.08867257292519393,0.15848958010129596 15,0.0007399770816408478,0.0006208302212724182,0.003905731552035015,0.06308347117463348,0.005649199968456911,0.09528266696887738,0.16928187732942868,0.0007097828908710124,0.0006019788487431864,0.0037444637681839105,0.0586804000553054,0.005498083515509075,0.08862764713090408,0.1578623554578101 16,0.0007249796720845992,0.0006091269720176375,0.0038024367257400746,0.06254689069313003,0.005602483977520798,0.09482429336657114,0.16811021055023115,0.0007058312126386224,0.0005830459537522977,0.003671854459287303,0.0582985747371584,0.005445715340339034,0.08838630632671003,0.1570913281167368 17,0.0007041729584668064,0.0005958633875174047,0.0037162222283426477,0.06201326607921183,0.00555915119922131,0.09437668788728606,0.16696536375282542,0.0006832726979294873,0.0005777163133622494,0.0035832805158780485,0.05772806891435237,0.0054127052505592325,0.08774353954996067,0.15572858172813442 18,0.0006902640663810697,0.000588541286631492,0.0036460560377078927,0.06147887513625892,0.00552427287418623,0.09396428301094346,0.16589229277920314,0.0007026915187941777,0.0005837160363433421,0.003500643184844065,0.05733401769520581,0.005372440551235387,0.08765712054590048,0.1551506285470361 19,0.0006774166111763158,0.0005806096782509484,0.003578058721612281,0.060961722517995316,0.005494917325161111,0.09362957452409977,0.16492229951051365,0.0006700181928280259,0.0005610242533677402,0.0034481495421893674,0.05691668846407793,0.005334889160765919,0.0872993711819343,0.15423014044095684 20,0.0006696941205962405,0.0005769004906770275,0.0035235914048983644,0.06035008670967826,0.005469622646649863,0.09325112924299807,0.16384102385973306,0.0006817083533817102,0.0005534360949159364,0.003389804388189079,0.05638474991958361,0.005313467707045145,0.08742187553660594,0.15374504168990508 21,0.0006551617716868758,0.0005686646613549185,0.0034691957698543686,0.059710265386126865,0.0054445852952668475,0.09298172027631647,0.16282959354549922,0.0006370179938616062,0.0005500561844570512,0.0033415180064186975,0.05584394331698661,0.00530494870889132,0.0869558752305012,0.15263335894866786 22,0.0006496127163237465,0.0005604618451861787,0.0034150267829602047,0.05902353493212876,0.005426673733831437,0.09264535053907859,0.16172066027789486,0.0006337918353020746,0.0005511392306442823,0.0032849037496628618,0.05513701335498451,0.005270346842086498,0.08677823088512651,0.1516554271349977 23,0.0006354170545975247,0.0005485939606459503,0.0033539587762678826,0.05835583686175855,0.005403104192313467,0.0923688884215756,0.16066579843361833,0.0006503503439449941,0.0005498156587854059,0.0032263736331705727,0.054710971022445896,0.0052793606467194595,0.08694490543477876,0.15136177681709603 24,0.00062566963722934,0.0005389785820835447,0.003287824724245173,0.05780723280845822,0.005378446604480908,0.09210256517498545,0.15974071800706,0.0006337137592877748,0.0005407965908040587,0.003206694663483557,0.054195535966045566,0.005247206344218161,0.086559481631542,0.15038342811762664 25,0.0006214659088994949,0.0005310221285312733,0.003233877899227082,0.05734333621477765,0.005357730479425816,0.09185043836351835,0.15893787065023957,0.000610826668826474,0.0005262214533145104,0.003093740317459801,0.05386596026878464,0.005216193809193581,0.08659757856400241,0.14991052070310387 26,0.0006075028036018381,0.0005205400862338877,0.0031774140110657984,0.05692524017283091,0.005335510220359197,0.09163671001473489,0.15820291795133368,0.0005975794471340546,0.0005136857334823414,0.00304527088894766,0.053492564509879055,0.005209691290467514,0.08603419843554719,0.14889299104079437 27,0.0005990680946694094,0.0005123771804731139,0.0031293270733155376,0.056561431160739695,0.005320348063926892,0.09138387896567773,0.1575064300428839,0.0005805249001695047,0.0004970348292830222,0.0029897694986025657,0.053162899346990956,0.0051792535749309076,0.08605999156698657,0.14846947435800598 28,0.0005948949649083896,0.0005046865532438576,0.003086307192016827,0.05624637599766837,0.005302862600482391,0.09121069089630375,0.15694581809176153,0.0005890038050183663,0.0005014557042012061,0.00298164457829853,0.05307813142350229,0.005174803840062986,0.08618468804895345,0.14850972602523163 29,0.0005865278493204709,0.0004965262327023815,0.0030395418682232452,0.05593872214420507,0.005280868143529296,0.09095692194272147,0.15629910858654172,0.0005887026205235978,0.0004882217479516323,0.0029067434733278112,0.0526468457745663,0.00515598162058486,0.0856976143514936,0.14748410990365016 30,0.0005781321943211299,0.00048648840881031506,0.002996620029146342,0.05565283799677647,0.005265143846667562,0.09074621304086797,0.15572543576342832,0.0005942712342911825,0.00047617664605677197,0.002869204377250432,0.052474133810520844,0.005120115284281406,0.08552180831484239,0.14705570932353457 31,0.0005809329027691221,0.0004808114262850107,0.002951262820575089,0.055459061154345304,0.005253579828509933,0.0906000616623454,0.15532570984854516,0.0005632353878673157,0.00047753373431758296,0.0028575023713622973,0.05215134127752337,0.005130363569335527,0.0856918139867908,0.14687178954511984 32,0.0005746650527925402,0.0004770391761670597,0.0029085996672892733,0.05520561730348044,0.005240494628507606,0.09044494308651833,0.15485135897410238,0.0005564168335051671,0.0004654324082951669,0.0027821729317298346,0.05202841697859386,0.00526293979775426,0.08548089095813774,0.14657627035866647 33,0.0005635431162151592,0.00047030113283762557,0.002865356847062177,0.054980221082667195,0.005232041321546773,0.09025310976505406,0.15436457317042487,0.000570819565565248,0.00046920838903375544,0.0027353620722077943,0.05187206460425619,0.005092625460171202,0.08520315767405563,0.14594323795943964 34,0.0005629502392721029,0.000465542085987497,0.0028199630716591643,0.054767545185613324,0.005214471187506378,0.09005964355233559,0.1538901158345811,0.0005456129249883109,0.0004604464776433766,0.0026993202384320344,0.05189822793923493,0.005083388414628842,0.08520628027758392,0.14589327609913555 35,0.0005597651435381638,0.0004600786608356878,0.0027788449187377056,0.054623431538954825,0.005202035656389144,0.08994713912004834,0.1535712957786046,0.0005437317733956203,0.00046750855749247937,0.0026631940822930467,0.05162559600884613,0.005134158627720681,0.08503823480992383,0.14547242328289559 36,0.0005531263300391408,0.00045478871413301403,0.00273778945775835,0.05444527695259303,0.005191289712700793,0.08980322644953544,0.1531854981453657,0.0005393578267006701,0.0004452804296978405,0.0026021029977415233,0.051468349495954836,0.005049185874206862,0.08483528393476882,0.14493956162888924 37,0.0005503504154550063,0.00045123328363600406,0.002697252001579086,0.0542797683764853,0.005181660663779438,0.08969770322299105,0.1528579681129931,0.0005366623105831901,0.00044549549282404944,0.0026314250405703094,0.05133423379186721,0.005054173682155397,0.08482684399491264,0.14482883394613436 38,0.0005477163567927144,0.00044836524920440217,0.0026624760995926527,0.05412716498326181,0.005176119745436423,0.08957771642032324,0.15253955899037894,0.0005292853909410017,0.00044139152627211916,0.0025564036420992337,0.05125051258018452,0.005054933109195457,0.08503053397684548,0.1448630609399788 39,0.0005392437621470958,0.000441383064313266,0.0026267894308151436,0.05397821812982348,0.005163584348892417,0.08942180773807312,0.15217102616349665,0.0005461102926388066,0.00044315549677332813,0.0025123412951047635,0.0511895840710356,0.005057258869287078,0.0849200302719393,0.1446684822683318 40,0.0005425630233983237,0.0004400929349576275,0.002594735445714848,0.053838631071561914,0.005156851706688742,0.08939997844186257,0.15197285277012962,0.0005251903218422272,0.0004288330498078824,0.0024714123794949156,0.05102128447519101,0.005026304909400278,0.08459364793462588,0.14406667297614317 41,0.0005346830401467614,0.00043524182820423377,0.0025681695786735357,0.05371618571355233,0.005154129039094244,0.08930184966114084,0.15171025810424432,0.0005484700897234414,0.00048073111535347105,0.002474841997206665,0.051126718040782684,0.005098806521486893,0.08522399725763553,0.1449535650182861 42,0.0005346708176584996,0.0004331601199147841,0.0025447298100378436,0.053630701142804285,0.005154966636902788,0.08922860560482969,0.151526834423843,0.0005197105299500769,0.00041913309082614096,0.0024239407920922796,0.0506942577355091,0.005009514884493752,0.08445112120776051,0.14351767766799722 43,0.000528247361177436,0.00042691687303158057,0.002516551479842263,0.05345391254255213,0.005136396135130917,0.08907320976242682,0.15113523452503513,0.0005264656844564107,0.0004174198804559886,0.002400423202198152,0.05082309424331553,0.005036060110699263,0.08447375204581677,0.14367721524327132 44,0.0005321034298189123,0.0004265165771981842,0.0024949107090782756,0.05334245644124499,0.005138122135838559,0.0890089360830713,0.1509430459553826,0.0005230733351347959,0.0004212943083864671,0.0023947888345792843,0.05068052631950138,0.005014471473482607,0.0844583140824519,0.14349246894508605 45,0.0005227385197655302,0.00041937268071903165,0.0024678922792591754,0.053238732420223,0.005131701618806692,0.08890378127494789,0.15068421870321055,0.0005035346866966592,0.0004105933947363336,0.0023464604052513658,0.05049456925773509,0.004994714311559969,0.08436553296942084,0.1431154065648102 46,0.000519757918989863,0.00041746450689652366,0.0024494526012014484,0.05312778948271859,0.00512609905902418,0.08881194059222138,0.15045250489559778,0.0005256244650841459,0.00041528335391927677,0.002352116493883293,0.05041020050607222,0.005004563599222445,0.08481437463363764,0.14352216250594052 47,0.0005153527150855631,0.00041557780415127577,0.0024314406105922773,0.05300022920288894,0.005120101903442904,0.0887049939494163,0.1501876962669756,0.000518053461917005,0.00041471676900766834,0.0023081660456074032,0.050233207658144444,0.004999881503937735,0.08412421226523821,0.14259823732874607 48,0.0005188192593629506,0.0004134436883725547,0.002415132391905439,0.05291842487434806,0.005117335889228339,0.0886941034200423,0.15007725926299195,0.0005366955307994383,0.0004219438746082497,0.00230103779323,0.050367682165690854,0.005072560633769886,0.08482332534278099,0.14352324519236143 49,0.000515613246749983,0.0004094374820784348,0.002398811581238894,0.05284336754797865,0.005110891799500117,0.08857244550694054,0.1498505672342076,0.0004988319014144018,0.00040729882330066555,0.002315222331528309,0.05016724601333411,0.005086949348171716,0.08413644246454784,0.14261199233510907 50,0.0005098651857641496,0.00040673302318158333,0.0023849172315101625,0.05272873462783709,0.005108372547771443,0.08846715085422062,0.14960577301750047,0.0005033080836510845,0.0004049265436968851,0.002283902085324407,0.05007262163355893,0.005019536325710238,0.08412816000214596,0.14241245439177838 51,0.0005073859796583166,0.0004055966187999312,0.00237427772841292,0.05265033740416052,0.005106109774182167,0.08842033449185968,0.1494640418414101,0.0004977331749255394,0.0003992991456185713,0.0022613759105964888,0.04997386440707826,0.004994772956770165,0.08425632044597466,0.14238336635141602 52,0.0005082008182115421,0.00040390638091814766,0.002359698749812425,0.05258164364284824,0.0051112797295553725,0.08842759254767121,0.14939232152200102,0.000512904402104066,0.0003988552553004307,0.002259924233429692,0.04987406646378043,0.005015483322822179,0.0843661165979401,0.1424273511558496 53,0.0005058713492984259,0.00040131655532454425,0.0023519934279946524,0.052519808771474226,0.005112816498085267,0.08833036688209757,0.14922217331884413,0.0005267479704292102,0.0004138784138655206,0.002272521629683752,0.050132583629204204,0.005113375412156018,0.08426967605361799,0.1427287840468875 54,0.0005041318768127883,0.0003999240917553543,0.0023392585404226024,0.052483831800487823,0.005110719071025074,0.08835914606246686,0.1491970111174771,0.0004946159697448109,0.00038682278774164523,0.002235456291024665,0.04986514236025883,0.005033457204698474,0.08391858781970399,0.14193408184928702 55,0.0005028142216338337,0.00039718683602810346,0.0023316856832603277,0.052309566939167135,0.0050949709497633625,0.08816308898930657,0.1487993133470029,0.0004929412767406505,0.0003984687032600363,0.0023015597287382836,0.04984673864503564,0.00500077144815849,0.08401460729993329,0.14205508591340474 56,0.0004990336350201665,0.00039451096775721523,0.0023195725203313104,0.052240389478049015,0.005089513740905616,0.08818293015636368,0.14872595074113568,0.0004998547472522688,0.0003886530331258779,0.002221689853937731,0.049656663959975124,0.005035070269036221,0.08399833654034886,0.14180026753435054 57,0.0004953068130535723,0.0003950382828419276,0.0023089815709801858,0.052121934708096326,0.005082215264198608,0.0880523364129517,0.14845581209535158,0.0004837179826343707,0.0004060174355068258,0.0022070729644365003,0.04952740745710729,0.0049844298886837874,0.08389040344635885,0.14149904861290158 58,0.0004913966101083683,0.0003915531656714461,0.002303127061672185,0.05210726483546802,0.005074451584340501,0.0879798422228349,0.1483476347321261,0.0005085507356796311,0.0003953629481941167,0.002199695317490219,0.04966750116853171,0.00498381113127525,0.08401916368195286,0.1417740854677098 59,0.0004901205980232668,0.00039062716686969043,0.002296368636917664,0.052024402269285196,0.005078676885472758,0.08793091498181924,0.1482111111874228,0.00047282050834548435,0.0003807958294245076,0.0021929671823175748,0.0494730379847938,0.0049611208174996785,0.08390927347591234,0.14139001650753127 60,0.0004885590369879089,0.0003896151016309304,0.0022921213138392365,0.05197202781005783,0.005070226522780231,0.08788359458344412,0.14809614424705694,0.0004837863477037057,0.000384076096035359,0.002200500749392929,0.049381663942326584,0.004929893635948991,0.08403825396109865,0.1414181739763534 61,0.0004884440821141834,0.0003895329707867848,0.0022859549642967464,0.05186799895676119,0.005064944667119035,0.08783130923473174,0.14792818487765327,0.0004777913048717637,0.0004017804860356572,0.0021967371782885673,0.04925296375887745,0.004934024799402812,0.08358287873486357,0.14084617644868067 62,0.00048554823740946094,0.0003878508971615902,0.002280412272992723,0.05182244703085093,0.005063009751015864,0.087783367128172,0.14782263566803824,0.000478432157853958,0.0003816808135345033,0.0021764747146771823,0.04919858168396554,0.004944963439199655,0.08348534387220673,0.1406654768557551 63,0.0004878287183609284,0.00038893905044477014,0.0022767445841830156,0.051764406100712805,0.005063747142926546,0.0877769812227751,0.14775864677672448,0.00047450095625575436,0.0003814916030673566,0.002170029078524133,0.049117389123755996,0.004947593660432364,0.08348531262841215,0.14057631738949508 64,0.0004835257450759322,0.0003863976372193973,0.002270692745811797,0.05165730488407052,0.005048126132761353,0.08764768783601759,0.14749373504284854,0.00047216806796671014,0.00037856794998913045,0.0021677632221555262,0.04905550687297752,0.004965400986915153,0.08329200883135646,0.14033141542680083 65,0.0004804769923691189,0.00038673230343726044,0.002268824882496232,0.051612062303749796,0.00505386877586217,0.0875967870022444,0.14739875168005773,0.0004897116058970158,0.0003793945062086767,0.0021525854823304462,0.04922416170476959,0.004937659717649246,0.083616678636313,0.14080019265383084 66,0.00048202015586534775,0.000387472048453086,0.002268180287791586,0.051604424053742555,0.005048288546025313,0.08763217123373594,0.14742255641966298,0.0005125296064160968,0.00039961444998038467,0.002191520496786235,0.04907090507242103,0.004940777587282311,0.08353542678202824,0.14065077367730086 67,0.0004798473021093861,0.0003870511902934445,0.0022663984311409894,0.05156565849799133,0.005047644960141642,0.08766569884088186,0.14741229977388745,0.0004622827469216649,0.0003754927573726289,0.002161205662158284,0.049060146680445414,0.00500061589875198,0.08355255582019945,0.140612300526285 ================================================ FILE: tbad/__init__.py ================================================ ================================================ FILE: tbad/autoencoder/__init__.py ================================================ ================================================ FILE: tbad/autoencoder/autoencoder.py ================================================ import os import keras from keras.layers import Input, Dense from keras.models import Model from sklearn.externals import joblib from tbad.rnn_autoencoder.rnn import load_architecture_specification from tbad.utils import select_optimiser, select_loss from tbad.losses import binary_crossentropy, mean_absolute_error, mean_squared_error class Autoencoder: def __init__(self, input_dim, hidden_dims=(16,), output_activation='sigmoid', optimiser='adam', learning_rate=0.001, loss='mse'): self.input_dim = input_dim self.hidden_dims = hidden_dims self.output_activation = output_activation self.optimiser = optimiser self.learning_rate = learning_rate self.loss = loss self.model = self.build() def build(self): ae_input = Input(shape=(self.input_dim,), name='ae_input', dtype='float32') encoded = Dense(self.hidden_dims[0], activation='relu')(ae_input) for hidden_dim in self.hidden_dims[1:]: encoded = Dense(hidden_dim, activation='relu')(encoded) decoded = Dense(self.input_dim, activation=self.output_activation)(encoded) return Model(inputs=ae_input, outputs=decoded) def compile(self): self.model.compile(optimizer=select_optimiser(self.optimiser, self.learning_rate), loss=select_loss(self.loss)) def train(self, X_train, y_train, epochs=5, initial_epoch=0, batch_size=256, val_data=None, log_dir=None): self.compile() callbacks_list = [ keras.callbacks.EarlyStopping(monitor='val_loss', patience=3) ] if log_dir is not None: callbacks_list += [ keras.callbacks.ModelCheckpoint( filepath=os.path.join(log_dir, 'weights_{epoch:03d}_{val_loss:.2f}.h5'), monitor='val_loss', save_best_only=True, save_weights_only=True ), keras.callbacks.CSVLogger( filename=os.path.join(log_dir, 'training_report.csv'), append=True ) ] self._maybe_write_architecture(log_dir) self.model.fit(X_train, y_train, batch_size=batch_size, epochs=epochs, callbacks=callbacks_list, validation_data=val_data, shuffle=True, initial_epoch=initial_epoch) return None def predict(self, X_test): return self.model.predict(X_test, batch_size=256) def load_weights(self, weights_path): self.model.load_weights(weights_path) return None def _maybe_write_architecture(self, log_dir): file_path = os.path.join(log_dir, 'architecture.txt') if os.path.isfile(file_path): return None with open(file_path, mode='w') as file: print('input_dim', self.input_dim, file=file) print('hidden_dims', *self.hidden_dims, file=file) print('output_activation', self.output_activation, file=file) print('optimiser', self.optimiser, file=file) print('learning_rate', self.learning_rate, file=file) print('loss', self.loss, file=file) return None def load_ae_pretrained_models(all_pretrained_models_path): pretrained_models, scalers = {}, {} for pretrained_model_name in os.listdir(all_pretrained_models_path): if pretrained_model_name.endswith('.npy') or pretrained_model_name.endswith('.npz'): continue camera_id = pretrained_model_name.split('_')[0] pretrained_model_path = os.path.join(all_pretrained_models_path, pretrained_model_name) pretrained_models[camera_id], scalers[camera_id] = load_pretrained_ae(pretrained_model_path) return pretrained_models, scalers def load_pretrained_ae(pretrained_model_path): model_files = os.listdir(pretrained_model_path) architecture_file = model_files[model_files.index('architecture.txt')] weight_files = [file_name for file_name in model_files if file_name.startswith('weights')] scaler_file = model_files[model_files.index('scaler.pkl')] best_weights = sorted(weight_files)[-1] architecture_path = os.path.join(pretrained_model_path, architecture_file) best_weights_path = os.path.join(pretrained_model_path, best_weights) architecture_specification = load_architecture_specification(architecture_path) ae_model = Autoencoder(**architecture_specification) ae_model.compile() ae_model.load_weights(best_weights_path) scaler = joblib.load(filename=os.path.join(pretrained_model_path, scaler_file)) return ae_model, scaler def _compute_ae_reconstruction_errors(X, X_reconstructed, loss): loss_fn = {'log_loss': binary_crossentropy, 'mae': mean_absolute_error, 'mse': mean_squared_error}[loss] return loss_fn(X, X_reconstructed) def compute_ae_reconstruction_errors(coordinates, coordinates_reconstructed, loss): errors = {trajectory_id: _compute_ae_reconstruction_errors(coordinates[trajectory_id], rec_trajectory_coordinates, loss=loss) for trajectory_id, rec_trajectory_coordinates in coordinates_reconstructed.items()} return errors def reconstruct_skeletons(anomaly_model, trajectories_coordinates): reconstructed_coordinates = {trajectory_id: anomaly_model.predict(trajectory_coordinates) for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} return reconstructed_coordinates ================================================ FILE: tbad/autoencoder/data.py ================================================ # Temporary data manipulating routines for test import os import numpy as np from sklearn.preprocessing import MinMaxScaler, RobustScaler, quantile_transform from tbad.data import StdScaler from tbad.visualisation import compute_bounding_box from tbad.losses import binary_crossentropy, mean_absolute_error, mean_squared_error class Trajectory: def __init__(self, trajectory_id, frames, coordinates): self.trajectory_id = trajectory_id self.person_id = trajectory_id.split('_')[1] self.frames = frames self.coordinates = coordinates self.is_global = False def __len__(self): return len(self.frames) def use_global_features(self, video_resolution, extract_delta=False, use_first_step_as_reference=False): self.coordinates = self._extract_global_features(video_resolution=video_resolution, extract_delta=extract_delta, use_first_step_as_reference=use_first_step_as_reference) self.is_global = True def use_size_features(self, video_resolution): self.coordinates = self._extract_size_features(video_resolution=video_resolution) def _extract_size_features(self, video_resolution): bbs = np.apply_along_axis(compute_bounding_box, axis=1, arr=self.coordinates, video_resolution=video_resolution) bbs_measures = np.apply_along_axis(self._extract_bounding_box_measurements, axis=1, arr=bbs) return bbs_measures def _extract_global_features(self, video_resolution, extract_delta=False, use_first_step_as_reference=False): bounding_boxes = np.apply_along_axis(compute_bounding_box, axis=1, arr=self.coordinates, video_resolution=video_resolution) bbs_measures = np.apply_along_axis(self._extract_bounding_box_measurements, axis=1, arr=bounding_boxes) bbs_centre = np.apply_along_axis(self._extract_bounding_box_centre, axis=1, arr=bounding_boxes) if extract_delta: bbs_delta = np.vstack((np.full((1, 2), fill_value=1e-7), np.diff(bbs_centre, axis=0))) if use_first_step_as_reference: bbs_centre -= bbs_centre[0] # bbs_centre /= np.where(bbs_measures == 0.0, 1.0, bbs_measures) bbs_centre[0] += 1e-6 if extract_delta: return np.hstack((bbs_centre, bbs_delta, bbs_measures)) return np.hstack((bbs_centre, bbs_measures)) @staticmethod def _extract_bounding_box_centre(bb): x = (bb[0] + bb[1]) / 2 y = (bb[2] + bb[3]) / 2 return np.array([x, y], dtype=np.float32) @staticmethod def _extract_bounding_box_measurements(bb): width = bb[1] - bb[0] height = bb[3] - bb[2] return np.array([width, height], dtype=np.float32) def change_coordinate_system(self, video_resolution, coordinate_system='global', invert=False): if invert: if coordinate_system == 'global': self.coordinates = self._from_global_to_image(self.coordinates, video_resolution=video_resolution) else: raise ValueError('Unknown coordinate system. Only global is available for inversion.') else: if coordinate_system == 'global': self.coordinates = self._from_image_to_global(self.coordinates, video_resolution=video_resolution) elif coordinate_system == 'bounding_box_top_left': self.coordinates = self._from_image_to_bounding_box(self.coordinates, video_resolution=video_resolution, location='top_left') elif coordinate_system == 'bounding_box_centre': self.coordinates = self._from_image_to_bounding_box(self.coordinates, video_resolution=video_resolution, location='centre') else: raise ValueError('Unknown coordinate system. Please select one of: global, bounding_box_top_left, or ' 'bounding_box_centre.') @staticmethod def _from_global_to_image(coordinates, video_resolution): original_shape = coordinates.shape coordinates = coordinates.reshape(-1, 2) * video_resolution return coordinates.reshape(original_shape) @staticmethod def _from_image_to_global(coordinates, video_resolution): original_shape = coordinates.shape coordinates = coordinates.reshape(-1, 2) / video_resolution return coordinates.reshape(original_shape) @staticmethod def _from_image_to_bounding_box(coordinates, video_resolution, location='centre'): if location == 'top_left': fn = Trajectory._from_image_to_top_left_bounding_box elif location == 'centre': fn = Trajectory._from_image_to_centre_bounding_box else: raise ValueError('Unknown location for the bounding box. Please select either top_left or centre.') coordinates = fn(coordinates, video_resolution=video_resolution) return coordinates @staticmethod def _from_image_to_top_left_bounding_box(coordinates, video_resolution): for idx, kps in enumerate(coordinates): if any(kps): left, right, top, bottom = compute_bounding_box(kps, video_resolution=video_resolution) xs, ys = np.hsplit(kps.reshape(-1, 2), indices_or_sections=2) xs, ys = np.where(xs == 0.0, float(left), xs), np.where(ys == 0.0, float(top), ys) xs, ys = (xs - left) / (right - left), (ys - top) / (bottom - top) kps = np.hstack((xs, ys)).ravel() coordinates[idx] = kps return coordinates @staticmethod def _from_image_to_centre_bounding_box(coordinates, video_resolution): # TODO: Better implementation # coordinates = np.where(coordinates == 0, np.nan, coordinates) # bounding_boxes = np.apply_along_axis(compute_bounding_box, axis=1, arr=coordinates, # video_resolution=video_resolution) # centre_x = (bounding_boxes[:, 0] + bounding_boxes[:, 1]) / 2 # centre_y = (bounding_boxes[:, 2] + bounding_boxes[:, 3]) / 2 for idx, kps in enumerate(coordinates): if any(kps): left, right, top, bottom = compute_bounding_box(kps, video_resolution=video_resolution) centre_x, centre_y = (left + right) / 2, (top + bottom) / 2 xs, ys = np.hsplit(kps.reshape(-1, 2), indices_or_sections=2) xs, ys = np.where(xs == 0.0, centre_x, xs) - centre_x, np.where(ys == 0.0, centre_y, ys) - centre_y left, right, top, bottom = left - centre_x, right - centre_x, top - centre_y, bottom - centre_y width, height = right - left, bottom - top xs, ys = xs / width, ys / height kps = np.hstack((xs, ys)).ravel() coordinates[idx] = kps return coordinates def is_short(self, input_length, input_gap, pred_length=0): min_trajectory_length = input_length + input_gap * (input_length - 1) + pred_length return len(self) < min_trajectory_length def input_missing_steps(self): """Fill missing steps with a weighted average of the closest non-missing steps.""" trajectory_length, input_dim = self.coordinates.shape last_step_non_missing = 0 consecutive_missing_steps = 0 while last_step_non_missing < trajectory_length - 1: step_is_missing = np.sum(self.coordinates[last_step_non_missing + 1, :] == 0) == input_dim while step_is_missing: consecutive_missing_steps += 1 step_is_missing = \ np.sum(self.coordinates[last_step_non_missing + 1 + consecutive_missing_steps, :] == 0) == input_dim if consecutive_missing_steps: start_trajectory = self.coordinates[last_step_non_missing, :] end_trajectory = self.coordinates[last_step_non_missing + 1 + consecutive_missing_steps, :] for n in range(1, consecutive_missing_steps + 1): a = ((consecutive_missing_steps + 1 - n) / (consecutive_missing_steps + 1)) * start_trajectory b = (n / (consecutive_missing_steps + 1)) * end_trajectory fill_step = a + b fill_step = np.where((start_trajectory == 0) | (end_trajectory == 0), 0, fill_step) self.coordinates[last_step_non_missing + n, :] = fill_step last_step_non_missing += consecutive_missing_steps + 1 consecutive_missing_steps = 0 def load_trajectories(trajectories_path): trajectories = {} folder_names = os.listdir(trajectories_path) for folder_name in folder_names: csv_file_names = os.listdir(os.path.join(trajectories_path, folder_name)) for csv_file_name in csv_file_names: trajectory_file_path = os.path.join(trajectories_path, folder_name, csv_file_name) trajectory = np.loadtxt(trajectory_file_path, dtype=np.float32, delimiter=',', ndmin=2) trajectory_frames, trajectory_coordinates = trajectory[:, 0].astype(np.int32), trajectory[:, 1:] person_id = csv_file_name.split('.')[0] trajectory_id = folder_name + '_' + person_id trajectories[trajectory_id] = Trajectory(trajectory_id=trajectory_id, frames=trajectory_frames, coordinates=trajectory_coordinates) return trajectories def extract_global_features(trajectories, video_resolution, extract_delta=False, use_first_step_as_reference=False): for trajectory in trajectories.values(): trajectory.use_global_features(video_resolution=video_resolution, extract_delta=extract_delta, use_first_step_as_reference=use_first_step_as_reference) return trajectories def extract_size_features(trajectories, video_resolution): for trajectory in trajectories.values(): trajectory.use_size_features(video_resolution=video_resolution) return trajectories def change_coordinate_system(trajectories, video_resolution, coordinate_system='global', invert=False): for trajectory in trajectories.values(): trajectory.change_coordinate_system(video_resolution, coordinate_system=coordinate_system, invert=invert) return trajectories def split_into_train_and_test(trajectories, train_ratio=0.8, seed=42): np.random.seed(seed) trajectories_ids = [] trajectories_lengths = [] for trajectory_id, trajectory in trajectories.items(): trajectories_ids.append(trajectory_id) trajectories_lengths.append(len(trajectory)) sorting_indices = np.argsort(trajectories_lengths) q1_idx = round(len(sorting_indices) * 0.25) q2_idx = round(len(sorting_indices) * 0.50) q3_idx = round(len(sorting_indices) * 0.75) sorted_ids = np.array(trajectories_ids)[sorting_indices] train_ids = [] val_ids = [] quantiles_indices = [0, q1_idx, q2_idx, q3_idx, len(sorting_indices)] for idx, q_idx in enumerate(quantiles_indices[1:], 1): q_ids = sorted_ids[quantiles_indices[idx - 1]:q_idx] q_ids = np.random.permutation(q_ids) train_idx = round(len(q_ids) * train_ratio) train_ids.extend(q_ids[:train_idx]) val_ids.extend(q_ids[train_idx:]) trajectories_train = {} for train_id in train_ids: trajectories_train[train_id] = trajectories[train_id] trajectories_val = {} for val_id in val_ids: trajectories_val[val_id] = trajectories[val_id] return trajectories_train, trajectories_val def scale_trajectories(X, scaler=None, strategy='zero_one'): original_shape = X.shape input_dim = original_shape[-1] X = X.reshape(-1, input_dim) if strategy == 'zero_one': X_scaled, scaler = scale_trajectories_zero_one(X, scaler=scaler) elif strategy == 'three_stds': X_scaled, scaler = scale_trajectories_three_stds(X, scaler=scaler) elif strategy == 'robust': X_scaled, scaler = scale_trajectories_robust(X, scaler=scaler) else: raise ValueError('Unknown strategy. Please select either zero_one or three_stds.') X, X_scaled = X.reshape(original_shape), X_scaled.reshape(original_shape) return X_scaled, scaler def scale_trajectories_zero_one(X, scaler=None): if scaler is None: X = np.where(X == 0.0, np.nan, X) X_min = np.nanmin(X, axis=0, keepdims=True) X_min = np.where(np.isnan(X_min), 0.0, X_min) X_min = np.tile(X_min, reps=[X.shape[0], 1]) eps = 1e-3 X = np.where(np.isnan(X), X_min - eps, X) scaler = MinMaxScaler(feature_range=(0, 1)) scaler.fit(X) num_examples = X.shape[0] X_scaled = np.where(X == 0.0, np.tile(scaler.data_min_, reps=[num_examples, 1]), X) X_scaled = scaler.transform(X_scaled) return X_scaled, scaler def scale_trajectories_three_stds(X, scaler=None): if scaler is None: X = np.where(X == 0.0, np.nan, X) scaler = StdScaler(stds=3) scaler.fit(X) X_scaled = np.where(X == 0.0, np.nan, X) X_scaled = scaler.transform(X_scaled) X_scaled = np.where(np.isnan(X_scaled), 0.0, X_scaled) return X_scaled, scaler def scale_trajectories_robust(X, scaler=None): X_scaled = np.where(X == 0.0, np.nan, X) if scaler is None: scaler = RobustScaler(quantile_range=(10.0, 90.0)) scaler.fit(X_scaled) X_scaled = scaler.transform(X_scaled) X_scaled = np.where(np.isnan(X_scaled), 0.0, X_scaled) return X_scaled, scaler def aggregate_autoencoder_data(trajectories): X = [] for trajectory in trajectories.values(): X.append(trajectory.coordinates) return np.vstack(X) def aggregate_autoencoder_evaluation_data(trajectories): trajectories_ids, frames, X = [], [], [] for trajectory_id, trajectory in trajectories.items(): frames.append(trajectory.frames) X.append(trajectory.coordinates) trajectories_ids.append(np.repeat(trajectory_id, repeats=len(trajectory.frames))) return np.concatenate(trajectories_ids), np.concatenate(frames), np.vstack(X) def remove_missing_skeletons(X, *arrs): non_missing_skeletons = np.sum(np.abs(X), axis=1) > 0.0 X = X[non_missing_skeletons] filtered_arrs = [] for idx, arr in enumerate(arrs): filtered_arrs.append(arr[non_missing_skeletons]) return X, filtered_arrs def compute_ae_reconstruction_errors(X, reconstructed_X, loss): loss_fn = {'log_loss': binary_crossentropy, 'mae': mean_absolute_error, 'mse': mean_squared_error}[loss] return loss_fn(X, reconstructed_X) def load_anomaly_masks(anomaly_masks_path): file_names = os.listdir(anomaly_masks_path) masks = {} for file_name in file_names: full_id = file_name.split('.')[0] file_path = os.path.join(anomaly_masks_path, file_name) masks[full_id] = np.load(file_path) return masks def assemble_ground_truth_and_reconstructions(anomaly_masks, trajectory_ids, reconstruction_frames, reconstruction_errors, return_video_ids=False): y_true, y_hat = {}, {} for full_id in anomaly_masks.keys(): _, video_id = full_id.split('_') y_true[video_id] = anomaly_masks[full_id].astype(np.int32) y_hat[video_id] = np.zeros_like(y_true[video_id], dtype=np.float32) unique_ids = np.unique(trajectory_ids) for trajectory_id in unique_ids: video_id, _ = trajectory_id.split('_') indices = trajectory_ids == trajectory_id frames = reconstruction_frames[indices] y_hat[video_id][frames] = np.maximum(y_hat[video_id][frames], reconstruction_errors[indices]) y_true_, y_hat_, video_ids = [], [], [] for video_id in sorted(y_true.keys()): y_true_.append(y_true[video_id]) y_hat_.append(y_hat[video_id]) video_ids.extend([video_id] * len(y_true_[-1])) y_true_, y_hat_ = np.concatenate(y_true_), np.concatenate(y_hat_) if return_video_ids: return y_true_, y_hat_, video_ids else: return y_true_, y_hat_ def quantile_transform_errors(y_hats): for camera_id, y_hat in y_hats.items(): y_hats[camera_id] = quantile_transform(y_hat.reshape(-1, 1)).reshape(-1) return y_hats def input_trajectories_missing_steps(trajectories): for trajectory in trajectories.values(): trajectory.input_missing_steps() return trajectories ================================================ FILE: tbad/autoencoder/evaluate.py ================================================ from collections import namedtuple import os import numpy as np from sklearn.metrics import roc_auc_score, average_precision_score from tbad.autoencoder.autoencoder import load_pretrained_ae from tbad.autoencoder.data import load_trajectories, extract_global_features, change_coordinate_system from tbad.autoencoder.data import aggregate_autoencoder_evaluation_data, scale_trajectories, remove_missing_skeletons from tbad.autoencoder.data import compute_ae_reconstruction_errors, load_anomaly_masks from tbad.autoencoder.data import assemble_ground_truth_and_reconstructions, quantile_transform_errors def eval_ae(args): # General trajectories_path = args.trajectories camera_id = os.path.basename(trajectories_path) pretrained_model_path = args.pretrained_model # e.g. .../adam_bb-tl_mse/06_2018_09_29_00_35_20 video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) frame_level_anomaly_masks_path = args.frame_level_anomaly_masks # Extract information about the models model_info = os.path.basename(os.path.split(pretrained_model_path)[0]) global_model = 'gm' in model_info coordinate_system = 'global' if 'bb-tl' in model_info: coordinate_system = 'bounding_box_top_left' elif 'bb-c' in model_info: coordinate_system = 'bounding_box_centre' normalisation_strategy = 'zero_one' if '_3stds_' in model_info: normalisation_strategy = 'three_stds' elif '_robust_' in model_info: normalisation_strategy = 'robust' pretrained_ae, scaler = load_pretrained_ae(pretrained_model_path) # Load data trajectories = load_trajectories(trajectories_path) if global_model: trajectories = extract_global_features(trajectories, video_resolution=video_resolution) coordinate_system = 'global' trajectories = change_coordinate_system(trajectories, video_resolution=video_resolution, coordinate_system=coordinate_system, invert=False) trajectories_ids, frames, X = aggregate_autoencoder_evaluation_data(trajectories) X, (trajectories_ids, frames) = remove_missing_skeletons(X, trajectories_ids, frames) X, _ = scale_trajectories(X, scaler=scaler, strategy=normalisation_strategy) # Reconstruct reconstructed_X = pretrained_ae.predict(X) reconstruction_errors = compute_ae_reconstruction_errors(X, reconstructed_X, loss=pretrained_ae.loss) # Evaluate Performance anomaly_masks = load_anomaly_masks(frame_level_anomaly_masks_path) y_true, y_hat = assemble_ground_truth_and_reconstructions(anomaly_masks, trajectories_ids, frames, reconstruction_errors) auroc, aupr = roc_auc_score(y_true, y_hat), average_precision_score(y_true, y_hat) print('Camera %s:\tAUROC\tAUPR' % camera_id) print(' \t%.4f\t%.4f\n' % (auroc, aupr)) # Logging return y_true, y_hat def eval_aes(args): all_trajectories_path = args.all_trajectories pretrained_models_path = args.pretrained_models # e.g. .../adam_bb-tl_mse video_resolution = args.video_resolution all_frame_level_anomaly_masks_path = args.all_frame_level_anomaly_masks EvalAeArgs = namedtuple('EvalAeArgs', ['trajectories', 'pretrained_model', 'frame_level_anomaly_masks', 'video_resolution']) pretrained_models_dirs = sorted(os.listdir(pretrained_models_path)) y_trues, y_hats = {}, {} for pretrained_model_dir in pretrained_models_dirs: camera_id = pretrained_model_dir.split('_')[0] pretrained_model_path = os.path.join(pretrained_models_path, pretrained_model_dir) trajectories_path = os.path.join(all_trajectories_path, camera_id) frame_level_anomaly_masks_path = os.path.join(all_frame_level_anomaly_masks_path, camera_id) eval_ae_args = EvalAeArgs(trajectories_path, pretrained_model_path, frame_level_anomaly_masks_path, video_resolution) y_true, y_hat = eval_ae(eval_ae_args) y_trues[camera_id], y_hats[camera_id] = y_true, y_hat y_hats = quantile_transform_errors(y_hats) camera_ids = sorted(y_hats.keys()) y_trues_flat, y_hats_flat = [], [] for camera_id in camera_ids: y_trues_flat.append(y_trues[camera_id]) y_hats_flat.append(y_hats[camera_id]) y_trues_flat, y_hats_flat = np.concatenate(y_trues_flat), np.concatenate(y_hats_flat) auroc, aupr = roc_auc_score(y_trues_flat, y_hats_flat), average_precision_score(y_trues_flat, y_hats_flat) print('All Cameras\tAUROC\tAUPR') print(' \t%.4f\t%.4f\n' % (auroc, aupr)) ================================================ FILE: tbad/autoencoder/train.py ================================================ import os import numpy as np from sklearn.externals import joblib from sklearn.utils import shuffle from tbad.autoencoder.autoencoder import Autoencoder from tbad.autoencoder.data import load_trajectories, extract_global_features, change_coordinate_system from tbad.autoencoder.data import split_into_train_and_test, aggregate_autoencoder_data, scale_trajectories from tbad.utils import set_up_logging, resume_training_from_last_epoch def train_ae(args): # General trajectories_path = args.trajectories # e.g. .../03 camera_id = os.path.basename(trajectories_path) video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) # Architecture global_model = args.global_model hidden_dims = args.hidden_dims output_activation = args.output_activation coordinate_system = args.coordinate_system normalisation_strategy = args.normalisation_strategy # Training optimiser = args.optimiser learning_rate = args.learning_rate loss = args.loss epochs = args.epochs batch_size = args.batch_size # Logging root_log_dir = args.root_log_dir resume_training = args.resume_training trajectories = load_trajectories(trajectories_path) print('\nLoaded %d trajectories.' % len(trajectories)) if global_model: trajectories = extract_global_features(trajectories, video_resolution=video_resolution) coordinate_system = 'global' print('\nExtracted global features from input skeletons. In addition, the coordinate system has been set ' 'to global.') trajectories = change_coordinate_system(trajectories, video_resolution=video_resolution, coordinate_system=coordinate_system, invert=False) print('\nChanged coordinate system to %s.' % coordinate_system) trajectories_train, trajectories_val = split_into_train_and_test(trajectories, train_ratio=0.8, seed=42) X_train = shuffle(aggregate_autoencoder_data(trajectories_train), random_state=42) X_val = aggregate_autoencoder_data(trajectories_val) X_train, scaler = scale_trajectories(X_train, strategy=normalisation_strategy) X_val, _ = scale_trajectories(X_val, scaler=scaler, strategy=normalisation_strategy) print('\nNormalised input features using the %s normalisation strategy.' % normalisation_strategy) input_dim = X_train.shape[-1] ae = Autoencoder(input_dim=input_dim, hidden_dims=hidden_dims, output_activation=output_activation, optimiser=optimiser, learning_rate=learning_rate, loss=loss) log_dir = set_up_logging(camera_id=camera_id, root_log_dir=root_log_dir, resume_training=resume_training) last_epoch = resume_training_from_last_epoch(model=ae, resume_training=resume_training) ae.train(X_train, X_train, epochs=epochs, initial_epoch=last_epoch, batch_size=batch_size, val_data=(X_val, X_val), log_dir=log_dir) print('Autoencoder anomaly model successfully trained.') if log_dir is not None: file_name = os.path.join(log_dir, 'scaler.pkl') joblib.dump(scaler, filename=file_name) print('log files were written to: %s' % log_dir) return ae, scaler ================================================ FILE: tbad/combined_model/__init__.py ================================================ ================================================ FILE: tbad/combined_model/data.py ================================================ import os import numpy as np from tbad.visualisation import insert_anomaly_mask_from_bounding_box, compute_bounding_box def inverse_scale(X, scaler): original_shape = X.shape input_dim = original_shape[-1] X = X.reshape(-1, input_dim) X = scaler.inverse_transform(X) X = X.reshape(original_shape) return X def restore_global_coordinate_system(X, video_resolution): original_shape = X.shape X = X.reshape(-1, 2) * video_resolution X = X.reshape(original_shape) return X def restore_original_trajectory(reconstructed_X_global, reconstructed_X_local): # X_global is already in image coordinates # X_local is in bounding_box_coordinates num_examples, input_length, local_input_dim = reconstructed_X_local.shape global_input_dim = reconstructed_X_global.shape[-1] reconstructed_X_global = reconstructed_X_global.reshape(-1, global_input_dim) reconstructed_X_local = reconstructed_X_local.reshape(-1, local_input_dim) reps = local_input_dim // 2 reconstructed_X_traj = reconstructed_X_local * np.tile(reconstructed_X_global[:, -2:], reps=reps) reconstructed_X_traj += np.tile(reconstructed_X_global[:, :2], reps=reps) reconstructed_X_traj = reconstructed_X_traj.reshape(num_examples, input_length, local_input_dim) return reconstructed_X_traj def write_reconstructed_trajectories(pretrained_model_path, reconstructed_traj, reconstruction_ids, reconstruction_frames, trajectory_type='skeleton'): if trajectory_type == 'skeleton': top_dir = 'reconstructed_skeletons' elif trajectory_type == 'bounding_box': top_dir = 'reconstructed_bounding_boxes' elif trajectory_type == 'predicted_skeleton': top_dir = 'predicted_skeletons' elif trajectory_type == 'predicted_bounding_box': top_dir = 'predicted_bounding_boxes' else: raise ValueError('Unknown trajectory type. Please choose one of skeleton, bounding_box, ' 'predicted_skeleton or predicted_bounding_box.') video_ids, skeleton_ids = extract_video_and_skeleton_ids(reconstruction_ids) unique_video_ids = np.unique(video_ids) writing_dir = os.path.join(pretrained_model_path, top_dir) if not os.path.isdir(writing_dir): os.makedirs(writing_dir) for video_id in unique_video_ids: video_writing_dir = os.path.join(writing_dir, video_id) if not os.path.isdir(video_writing_dir): os.makedirs(video_writing_dir) mask = video_ids == video_id current_skeleton_ids = skeleton_ids[mask] current_frames = reconstruction_frames[mask] current_recs = reconstructed_traj[mask, :] unique_current_skeleton_ids = np.unique(current_skeleton_ids) for skeleton_id in unique_current_skeleton_ids: skeleton_writing_file = os.path.join(video_writing_dir, skeleton_id) + '.csv' mask = current_skeleton_ids == skeleton_id current_skeleton_frames = current_frames[mask].reshape(-1, 1) current_skeleton_recs = current_recs[mask, :] trajectory = np.hstack((current_skeleton_frames, current_skeleton_recs)) np.savetxt(skeleton_writing_file, trajectory, fmt='%.4f', delimiter=',') def extract_video_and_skeleton_ids(reconstruction_ids): split_ids = np.core.defchararray.split(reconstruction_ids, sep='_') video_ids, skeleton_ids = [], [] for ids in split_ids: video_id, skeleton_id = ids video_ids.append(video_id) skeleton_ids.append(skeleton_id) return np.array(video_ids), np.array(skeleton_ids) def detect_most_anomalous_or_most_normal_frames(reconstruction_errors, anomalous=True, fraction=0.20): reconstruction_errors_sorted = np.sort(reconstruction_errors) num_frames_to_blame = round(len(reconstruction_errors_sorted) * fraction) if anomalous: threshold = np.round(reconstruction_errors_sorted[-num_frames_to_blame], decimals=8) anomalous_or_normal_frames = reconstruction_errors >= threshold else: threshold = np.round(reconstruction_errors_sorted[num_frames_to_blame - 1], decimals=8) anomalous_or_normal_frames = (0 < reconstruction_errors) & (reconstruction_errors <= threshold) return anomalous_or_normal_frames def compute_num_frames_per_video(anomaly_masks): num_frames_per_video = {} for full_id, anomaly_mask in anomaly_masks.items(): _, video_id = full_id.split('_') num_frames_per_video[video_id] = len(anomaly_mask) return num_frames_per_video def write_predicted_masks(pretrained_model_path, num_frames_per_video, anomalous_frames, normal_frames, reconstructed_bounding_boxes, reconstruction_ids, reconstruction_frames, video_resolution): video_ids, skeleton_ids = extract_video_and_skeleton_ids(reconstruction_ids) unique_video_ids = np.unique(video_ids) width, height = video_resolution width, height = int(width), int(height) anomaly_path = os.path.join(pretrained_model_path, 'predicted_pixel_level_anomaly_masks') if not os.path.isdir(anomaly_path): os.makedirs(anomaly_path) normal_path = os.path.join(pretrained_model_path, 'predicted_pixel_level_normal_masks') if not os.path.isdir(normal_path): os.makedirs(normal_path) for video_id in unique_video_ids: num_frames = num_frames_per_video[video_id] anomaly_mask = np.zeros((num_frames, height, width), dtype=np.uint8) normal_mask = np.zeros((num_frames, height, width), dtype=np.uint8) mask = video_ids == video_id current_anomalous_frames, current_normal_frames = anomalous_frames[mask], normal_frames[mask] current_bounding_boxes, current_frames = reconstructed_bounding_boxes[mask, :], reconstruction_frames[mask] for idx, frame in enumerate(current_frames): bounding_box = current_bounding_boxes[idx, :] if current_anomalous_frames[idx]: insert_anomaly_mask_from_bounding_box(anomaly_mask[frame], bounding_box) if current_normal_frames[idx]: insert_anomaly_mask_from_bounding_box(normal_mask[frame], bounding_box) np.save(os.path.join(anomaly_path, video_id), arr=anomaly_mask) np.save(os.path.join(normal_path, video_id), arr=normal_mask) def compute_worst_mistakes(y_true, y_hat, video_ids, error_type='false_positives', top=10): positive_indices = y_hat > 0 video_ids_ = np.array(video_ids) frames = generate_array_of_frames(video_ids_) y_true_ = y_true[positive_indices] y_hat_ = y_hat[positive_indices] video_ids_ = video_ids_[positive_indices] frames = frames[positive_indices] if error_type == 'false_positives': true_negatives = y_true_ == 0 y_hat_ = y_hat_[true_negatives] video_ids_ = video_ids_[true_negatives] frames_ = frames[true_negatives] sorting_indices = np.argsort(y_hat_) indices = sorting_indices[-top:] elif error_type == 'false_negatives': true_positives = y_true_ == 1 y_hat_ = y_hat_[true_positives] video_ids_ = video_ids_[true_positives] frames_ = frames[true_positives] sorting_indices = np.argsort(y_hat_) indices = sorting_indices[:top] else: raise ValueError('Unknown mistake type. Please choose either false_positives or false_negatives.') return video_ids_[indices], frames_[indices], y_hat_[indices] def generate_array_of_frames(x): """x is already sorted.""" _, counts = np.unique(x, return_counts=True) result = [] for count in counts: result.append(np.arange(count)) return np.concatenate(result) def write_worst_mistakes(pretrained_model_path, worst_false_positives, worst_false_negatives): camera_id = os.path.basename(pretrained_model_path).split('_')[0] file_path = os.path.join(pretrained_model_path, 'mistakes.txt') with open(file_path, mode='w') as file: print('\nCamera ID: %s' % camera_id, file=file) print('\nWorst False Positives:', file=file) video_ids, frames, scores = worst_false_positives for video_id, frame, score in zip(video_ids[::-1], frames[::-1], scores[::-1]): print('Video ID: %s\tFrame: %d\tRec. Error: %.4f' % (video_id, frame, score), file=file) print('\nWorst False Negatives:', file=file) video_ids, frames, scores = worst_false_negatives for video_id, frame, score in zip(video_ids, frames, scores): print('Video ID: %s\tFrame: %d\tRec. Error: %.4f' % (video_id, frame, score), file=file) return None def clip_trajectories(trajectories, video_resolution, margin=0.05): clipped_trajectories = {} for trajectory_id, trajectory in trajectories.items(): clipped_trajectory = clip_trajectory(trajectory, video_resolution, margin) clipped_trajectories[trajectory_id] = clipped_trajectory return clipped_trajectories def clip_trajectory(trajectory, video_resolution, margin=0.05): width, height = video_resolution left_margin, top_margin = margin * width, margin * height right_margin, bottom_margin = width - left_margin, height - top_margin frames, coordinates = trajectory.frames, trajectory.coordinates steps_to_include = np.ones_like(frames, dtype=np.bool) for idx, kps in enumerate(coordinates): x, y = np.hsplit(kps.reshape(-1, 2), indices_or_sections=2) x, y = x[x != 0.0], y[y != 0.0] if np.all(x < left_margin) or np.all(x > right_margin) or np.all(y < top_margin) or np.all(y > bottom_margin): steps_to_include[idx] = False else: break for idx, kps in enumerate(coordinates[::-1, :], start=1): x, y = np.hsplit(kps.reshape(-1, 2), indices_or_sections=2) x, y = x[x != 0.0], y[y != 0.0] if np.all(x < left_margin) or np.all(x > right_margin) or np.all(y < top_margin) or np.all(y > bottom_margin): steps_to_include[-idx] = False else: break frames, coordinates = frames[steps_to_include], coordinates[steps_to_include] trajectory.frames, trajectory.coordinates = frames, coordinates return trajectory def normalise_errors_by_bounding_box_area(errors, X, video_resolution): original_shape = X.shape input_dim = original_shape[-1] errors = errors.reshape(-1) X = X.reshape(-1, input_dim) bbs = np.apply_along_axis(compute_bounding_box, axis=1, arr=X, video_resolution=video_resolution) widths, heights = bbs[:, 1] - bbs[:, 0], bbs[:, 3] - bbs[:, 2] bbs_areas = np.float_power(widths * heights, 1) bbs_areas = np.where(bbs_areas == 0, 1, bbs_areas) errors_normalised = (errors / bbs_areas).reshape(original_shape[:2]) errors = errors.reshape(original_shape[:2]) X = X.reshape(original_shape) return errors_normalised ================================================ FILE: tbad/combined_model/evaluate.py ================================================ from collections import namedtuple from copy import deepcopy import os import numpy as np from sklearn.metrics import roc_auc_score, average_precision_score from tbad.autoencoder.data import load_trajectories, extract_global_features, change_coordinate_system from tbad.autoencoder.data import scale_trajectories, load_anomaly_masks, assemble_ground_truth_and_reconstructions from tbad.autoencoder.data import quantile_transform_errors from tbad.rnn_autoencoder.data import remove_short_trajectories, aggregate_rnn_ae_evaluation_data from tbad.rnn_autoencoder.data import compute_rnn_ae_reconstruction_errors, summarise_reconstruction_errors from tbad.rnn_autoencoder.data import summarise_reconstruction, retrieve_future_skeletons from tbad.rnn_autoencoder.data import discard_information_from_padded_frames from tbad.combined_model.fusion import load_pretrained_combined_model from tbad.combined_model.data import inverse_scale, restore_global_coordinate_system, restore_original_trajectory from tbad.combined_model.data import write_reconstructed_trajectories, detect_most_anomalous_or_most_normal_frames from tbad.combined_model.data import compute_num_frames_per_video, write_predicted_masks, compute_worst_mistakes from tbad.combined_model.data import write_worst_mistakes, clip_trajectories, normalise_errors_by_bounding_box_area from tbad.visualisation import compute_bounding_box V_01 = [1] * 75 + [0] * 46 + [1] * 269 + [0] * 47 + [1] * 427 + [0] * 47 + [1] * 20 + [0] * 70 + [1] * 438 # 1439 Frames V_02 = [1] * 272 + [0] * 48 + [1] * 403 + [0] * 41 + [1] * 447 # 1211 Frames V_03 = [1] * 293 + [0] * 48 + [1] * 582 # 923 Frames V_04 = [1] * 947 # 947 Frames V_05 = [1] * 1007 # 1007 Frames V_06 = [1] * 561 + [0] * 64 + [1] * 189 + [0] * 193 + [1] * 276 # 1283 Frames V_07_to_15 = [1] * 6457 V_16 = [1] * 728 + [0] * 12 # 740 Frames V_17_to_21 = [1] * 1317 AVENUE_MASK = np.array(V_01 + V_02 + V_03 + V_04 + V_05 + V_06 + V_07_to_15 + V_16 + V_17_to_21) == 1 def eval_combined_model(args): trajectories_path = args.trajectories # e.g. .../optflow/alphapose/07 camera_id = os.path.basename(trajectories_path) pretrained_model_path = args.pretrained_model # e.g. .../16_0_2_rrs_mse/07_2018_09_20_13_15_13 video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) frame_level_anomaly_masks_path = args.frame_level_anomaly_masks overlapping_trajectories = args.overlapping_trajectories # Logging write_reconstructions = args.write_reconstructions write_bounding_boxes = args.write_bounding_boxes write_predictions = args.write_predictions write_predictions_bounding_boxes = args.write_predictions_bounding_boxes write_anomaly_masks = args.write_anomaly_masks write_mistakes = args.write_mistakes model_info = os.path.basename(os.path.split(pretrained_model_path)[0]) message_passing = 'mp' in model_info is_avenue = 'Avenue' in trajectories_path pretrained_combined_model, global_scaler, local_scaler, out_scaler = \ load_pretrained_combined_model(pretrained_model_path, message_passing=message_passing) # Extract information about the models reconstruct_original_data = 'down' in model_info global_normalisation_strategy = 'zero_one' if '_G3stds_' in model_info: global_normalisation_strategy = 'three_stds' elif '_Grobust_' in model_info: global_normalisation_strategy = 'robust' local_normalisation_strategy = 'zero_one' if '_L3stds_' in model_info: local_normalisation_strategy = 'three_stds' elif '_Lrobust_' in model_info: local_normalisation_strategy = 'robust' out_normalisation_strategy = 'zero_one' if '_O3stds_' in model_info: out_normalisation_strategy = 'three_stds' elif '_Orobust_' in model_info: out_normalisation_strategy = 'robust' multiple_outputs = pretrained_combined_model.multiple_outputs input_length, rec_length = pretrained_combined_model.input_length, pretrained_combined_model.reconstruction_length input_gap, pred_length = 0, pretrained_combined_model.prediction_length reconstruct_reverse = pretrained_combined_model.reconstruct_reverse loss = pretrained_combined_model.loss # Data trajectories = load_trajectories(trajectories_path) trajectories = remove_short_trajectories(trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length) global_trajectories = extract_global_features(deepcopy(trajectories), video_resolution=video_resolution) global_trajectories = change_coordinate_system(global_trajectories, video_resolution=video_resolution, coordinate_system='global', invert=False) trajectories_ids, frames, X_global = \ aggregate_rnn_ae_evaluation_data(global_trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length, overlapping_trajectories=overlapping_trajectories) X_global, _ = scale_trajectories(X_global, scaler=global_scaler, strategy=global_normalisation_strategy) local_trajectories = deepcopy(trajectories) local_trajectories = change_coordinate_system(local_trajectories, video_resolution=video_resolution, coordinate_system='bounding_box_centre', invert=False) _, _, X_local = aggregate_rnn_ae_evaluation_data(local_trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length, overlapping_trajectories=overlapping_trajectories) X_local, _ = scale_trajectories(X_local, scaler=local_scaler, strategy=local_normalisation_strategy) original_trajectories = deepcopy(trajectories) _, _, X_original = aggregate_rnn_ae_evaluation_data(original_trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length, overlapping_trajectories=overlapping_trajectories) if reconstruct_original_data: out_trajectories = trajectories out_trajectories = change_coordinate_system(out_trajectories, video_resolution=video_resolution, coordinate_system='global', invert=False) _, _, X_out = aggregate_rnn_ae_evaluation_data(out_trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length, overlapping_trajectories=overlapping_trajectories) X_out, _ = scale_trajectories(X_out, scaler=out_scaler, strategy=out_normalisation_strategy) # Reconstruct X_input = [X_global, X_local] if pred_length == 0: if multiple_outputs: _, _, reconstructed_X = pretrained_combined_model.predict(X_input, batch_size=1024) else: reconstructed_X = pretrained_combined_model.predict(X_input, batch_size=1024) else: if multiple_outputs: _, _, reconstructed_X, _, _, predicted_y = \ pretrained_combined_model.predict(X_input, batch_size=1024) else: reconstructed_X, predicted_y = pretrained_combined_model.predict(X_input, batch_size=1024) if reconstruct_reverse: reconstructed_X = reconstructed_X[:, ::-1, :] X = X_out if reconstruct_original_data else np.concatenate((X_global, X_local), axis=-1) reconstruction_errors = compute_rnn_ae_reconstruction_errors(X[:, :rec_length, :], reconstructed_X, loss) reconstruction_ids, reconstruction_frames, reconstruction_errors = \ summarise_reconstruction_errors(reconstruction_errors, frames[:, :rec_length], trajectories_ids[:, :rec_length]) # Evaluate performance anomaly_masks = load_anomaly_masks(frame_level_anomaly_masks_path) y_true, y_hat, video_ids = assemble_ground_truth_and_reconstructions(anomaly_masks, reconstruction_ids, reconstruction_frames, reconstruction_errors, return_video_ids=True) if is_avenue: auroc, aupr = roc_auc_score(y_true[AVENUE_MASK], y_hat[AVENUE_MASK]), average_precision_score( y_true[AVENUE_MASK], y_hat[AVENUE_MASK]) else: auroc, aupr = roc_auc_score(y_true, y_hat), average_precision_score(y_true, y_hat) print('Reconstruction Based:') print('Camera %s:\tAUROC\tAUPR' % camera_id) print(' \t%.4f\t%.4f\n' % (auroc, aupr)) if pred_length > 0: predicted_frames = frames[:, :pred_length] + input_length predicted_ids = trajectories_ids[:, :pred_length] y = retrieve_future_skeletons(trajectories_ids, X, pred_length) pred_errors = compute_rnn_ae_reconstruction_errors(y, predicted_y, loss) pred_ids, pred_frames, pred_errors = discard_information_from_padded_frames(predicted_ids, predicted_frames, pred_errors, pred_length) pred_ids, pred_frames, pred_errors = summarise_reconstruction_errors(pred_errors, pred_frames, pred_ids) y_true_pred, y_hat_pred = assemble_ground_truth_and_reconstructions(anomaly_masks, pred_ids, pred_frames, pred_errors) if is_avenue: auroc, aupr = roc_auc_score(y_true_pred[AVENUE_MASK], y_hat_pred[AVENUE_MASK]), average_precision_score( y_true_pred[AVENUE_MASK], y_hat_pred[AVENUE_MASK]) else: auroc, aupr = roc_auc_score(y_true_pred, y_hat_pred), average_precision_score(y_true_pred, y_hat_pred) print('Prediction Based:') print('Camera %s:\tAUROC\tAUPR' % camera_id) print(' \t%.4f\t%.4f\n' % (auroc, aupr)) y_true_comb, y_hat_comb = y_true, y_hat + y_hat_pred if is_avenue: auroc, aupr = roc_auc_score(y_true_comb[AVENUE_MASK], y_hat_comb[AVENUE_MASK]), average_precision_score( y_true_comb[AVENUE_MASK], y_hat_comb[AVENUE_MASK]) else: auroc, aupr = roc_auc_score(y_true_comb, y_hat_comb), average_precision_score(y_true_comb, y_hat_comb) print('Reconstruction + Prediction Based:') print('Camera %s:\tAUROC\tAUPR' % camera_id) print(' \t%.4f\t%.4f\n' % (auroc, aupr)) if reconstruct_original_data: predicted_y_traj = inverse_scale(predicted_y, scaler=out_scaler) predicted_y_traj = restore_global_coordinate_system(predicted_y_traj, video_resolution=video_resolution) else: predicted_y_global = inverse_scale(predicted_y[..., :4], scaler=global_scaler) predicted_y_local = inverse_scale(predicted_y[..., 4:], scaler=local_scaler) predicted_y_global = restore_global_coordinate_system(predicted_y_global, video_resolution=video_resolution) predicted_y_traj = restore_original_trajectory(predicted_y_global, predicted_y_local) prediction_ids, prediction_frames, predicted_y_traj = \ summarise_reconstruction(predicted_y_traj, predicted_frames, predicted_ids) predicted_bounding_boxes = np.apply_along_axis(compute_bounding_box, axis=1, arr=predicted_y_traj, video_resolution=video_resolution) # Post-Processing if reconstruct_original_data: reconstructed_X_traj = inverse_scale(reconstructed_X, scaler=out_scaler) reconstructed_X_traj = restore_global_coordinate_system(reconstructed_X_traj, video_resolution=video_resolution) else: reconstructed_X_global = inverse_scale(reconstructed_X[..., :4], scaler=global_scaler) reconstructed_X_local = inverse_scale(reconstructed_X[..., 4:], scaler=local_scaler) reconstructed_X_global = restore_global_coordinate_system(reconstructed_X_global, video_resolution=video_resolution) reconstructed_X_traj = restore_original_trajectory(reconstructed_X_global, reconstructed_X_local) reconstruction_ids, reconstruction_frames, reconstructed_X_traj = \ summarise_reconstruction(reconstructed_X_traj, frames[:, :rec_length], trajectories_ids[:, :rec_length]) reconstructed_bounding_boxes = np.apply_along_axis(compute_bounding_box, axis=1, arr=reconstructed_X_traj, video_resolution=video_resolution) worst_false_positives = compute_worst_mistakes(y_true=y_true_pred, y_hat=y_hat_pred, video_ids=video_ids, error_type='false_positives', top=25) worst_false_negatives = compute_worst_mistakes(y_true=y_true_pred, y_hat=y_hat_pred, video_ids=video_ids, error_type='false_negatives', top=25) # Logging if write_reconstructions: write_reconstructed_trajectories(pretrained_model_path, reconstructed_X_traj, reconstruction_ids, reconstruction_frames, trajectory_type='skeleton') if write_bounding_boxes: write_reconstructed_trajectories(pretrained_model_path, reconstructed_bounding_boxes, reconstruction_ids, reconstruction_frames, trajectory_type='bounding_box') if write_predictions: write_reconstructed_trajectories(pretrained_model_path, predicted_y_traj, prediction_ids, prediction_frames, trajectory_type='predicted_skeleton') if write_predictions_bounding_boxes: write_reconstructed_trajectories(pretrained_model_path, predicted_bounding_boxes, prediction_ids, prediction_frames, trajectory_type='predicted_bounding_box') if write_anomaly_masks: anomalous_frames = detect_most_anomalous_or_most_normal_frames(reconstruction_errors, anomalous=True, fraction=0.20) normal_frames = detect_most_anomalous_or_most_normal_frames(reconstruction_errors, anomalous=False, fraction=0.20) num_frames_per_video = compute_num_frames_per_video(anomaly_masks) write_predicted_masks(pretrained_model_path, num_frames_per_video, anomalous_frames, normal_frames, reconstructed_bounding_boxes, reconstruction_ids, reconstruction_frames, video_resolution) if write_mistakes: write_worst_mistakes(pretrained_model_path, worst_false_positives=worst_false_positives, worst_false_negatives=worst_false_negatives) if pred_length > 0: return y_true, y_hat, y_true_pred, y_hat_pred, y_true_comb, y_hat_comb else: return y_true, y_hat, None, None, None, None def eval_combined_models(args): all_trajectories_path = args.all_trajectories pretrained_models_path = args.pretrained_models # e.g. .../ video_resolution = args.video_resolution all_frame_level_anomaly_masks_path = args.all_frame_level_anomaly_masks overlapping_trajectories = args.overlapping_trajectories is_avenue = 'Avenue' in all_trajectories_path # Logging write_reconstructions = args.write_reconstructions write_bounding_boxes = args.write_bounding_boxes write_predictions = args.write_predictions write_predictions_bounding_boxes = args.write_predictions_bounding_boxes write_anomaly_masks = args.write_anomaly_masks write_mistakes = args.write_mistakes EvalCombinedModelArgs = namedtuple('EvalCombinedModelArgs', ['pretrained_model', 'trajectories', 'frame_level_anomaly_masks', 'video_resolution', 'overlapping_trajectories', 'write_reconstructions', 'write_bounding_boxes', 'write_predictions', 'write_predictions_bounding_boxes', 'write_anomaly_masks', 'write_mistakes']) pretrained_models_dirs = sorted(os.listdir(pretrained_models_path)) y_trues, y_hats, y_trues_pred, y_hats_pred, y_trues_comb, y_hats_comb = {}, {}, {}, {}, {}, {} for pretrained_model_dir in pretrained_models_dirs: camera_id = pretrained_model_dir.split('_')[0] pretrained_model_path = os.path.join(pretrained_models_path, pretrained_model_dir) trajectories_path = os.path.join(all_trajectories_path, camera_id) frame_level_anomaly_masks_path = os.path.join(all_frame_level_anomaly_masks_path, camera_id) eval_combined_model_args = EvalCombinedModelArgs(pretrained_model_path, trajectories_path, frame_level_anomaly_masks_path, video_resolution, overlapping_trajectories, write_reconstructions, write_bounding_boxes, write_predictions, write_predictions_bounding_boxes, write_anomaly_masks, write_mistakes) y_true, y_hat, y_true_pred, y_hat_pred, y_true_comb, y_hat_comb = eval_combined_model(eval_combined_model_args) y_trues[camera_id], y_hats[camera_id] = y_true, y_hat if y_true_pred is not None: y_trues_pred[camera_id], y_hats_pred[camera_id] = y_true_pred, y_hat_pred y_trues_comb[camera_id], y_hats_comb[camera_id] = y_true_comb, y_hat_comb y_hats = quantile_transform_errors(y_hats) camera_ids = sorted(y_hats.keys()) y_trues_flat, y_hats_flat = [], [] for camera_id in camera_ids: y_trues_flat.append(y_trues[camera_id]) y_hats_flat.append(y_hats[camera_id]) y_trues_flat, y_hats_flat = np.concatenate(y_trues_flat), np.concatenate(y_hats_flat) if is_avenue: auroc, aupr = roc_auc_score(y_trues_flat[AVENUE_MASK], y_hats_flat[AVENUE_MASK]), \ average_precision_score(y_trues_flat[AVENUE_MASK], y_hats_flat[AVENUE_MASK]) else: auroc, aupr = roc_auc_score(y_trues_flat, y_hats_flat), average_precision_score(y_trues_flat, y_hats_flat) print('Reconstruction Based:') print('All Cameras\tAUROC\tAUPR') print(' \t%.4f\t%.4f\n' % (auroc, aupr)) if y_trues_pred: y_hats_pred = quantile_transform_errors(y_hats_pred) y_trues_pred_flat, y_hats_pred_flat = [], [] for camera_id in camera_ids: y_trues_pred_flat.append(y_trues_pred[camera_id]) y_hats_pred_flat.append(y_hats_pred[camera_id]) y_trues_pred_flat, y_hats_pred_flat = np.concatenate(y_trues_pred_flat), np.concatenate(y_hats_pred_flat) if is_avenue: auroc_pred = roc_auc_score(y_trues_pred_flat[AVENUE_MASK], y_hats_pred_flat[AVENUE_MASK]) aupr_pred = average_precision_score(y_trues_pred_flat[AVENUE_MASK], y_hats_pred_flat[AVENUE_MASK]) else: auroc_pred = roc_auc_score(y_trues_pred_flat, y_hats_pred_flat) aupr_pred = average_precision_score(y_trues_pred_flat, y_hats_pred_flat) print('Prediction Based:') print('All Cameras\tAUROC\tAUPR') print(' \t%.4f\t%.4f\n' % (auroc_pred, aupr_pred)) y_hats_comb = quantile_transform_errors(y_hats_comb) y_trues_comb_flat, y_hats_comb_flat = [], [] for camera_id in camera_ids: y_trues_comb_flat.append(y_trues_comb[camera_id]) y_hats_comb_flat.append(y_hats_comb[camera_id]) y_trues_comb_flat, y_hats_comb_flat = np.concatenate(y_trues_comb_flat), np.concatenate(y_hats_comb_flat) if is_avenue: auroc_comb = roc_auc_score(y_trues_comb_flat[AVENUE_MASK], y_hats_comb_flat[AVENUE_MASK]) aupr_comb = average_precision_score(y_trues_comb_flat[AVENUE_MASK], y_hats_comb_flat[AVENUE_MASK]) else: auroc_comb = roc_auc_score(y_trues_comb_flat, y_hats_comb_flat) aupr_comb = average_precision_score(y_trues_comb_flat, y_hats_comb_flat) print('Reconstruction + Prediction Based:') print('All Cameras\tAUROC\tAUPR') print(' \t%.4f\t%.4f\n' % (auroc_comb, aupr_comb)) ================================================ FILE: tbad/combined_model/fusion.py ================================================ import os import keras from keras.models import Model from keras.layers import Input, RNN, Dense import numpy as np from sklearn.externals import joblib from tbad.rnn_autoencoder.rnn import load_architecture_specification from tbad.combined_model.message_passing import MessagePassingEncoderDecoder from tbad.utils import select_cell, select_optimiser, select_loss class CombinedEncoderDecoder: def __init__(self, input_length, global_input_dim, local_input_dim, reconstruction_length, prediction_length=0, global_hidden_dims=(2,), local_hidden_dims=(16,), extra_hidden_dims=(), output_activation='sigmoid', cell_type='gru', reconstruct_reverse=True, reconstruct_original_data=False, multiple_outputs=False, multiple_outputs_before_concatenation=True, optimiser='adam', learning_rate=0.001, loss='mse', l1_reg=0.0, l2_reg=0.0): self.input_length = input_length self.global_input_dim = global_input_dim self.local_input_dim = local_input_dim self.reconstruction_length = reconstruction_length self.prediction_length = prediction_length self.global_hidden_dims = global_hidden_dims self.local_hidden_dims = local_hidden_dims self.extra_hidden_dims = extra_hidden_dims self.output_activation = output_activation self.cell_type = cell_type self.reconstruct_reverse = reconstruct_reverse self.reconstruct_original_data = reconstruct_original_data self.multiple_outputs = multiple_outputs self.multiple_outputs_before_concatenation = multiple_outputs_before_concatenation self.optimiser = optimiser self.learning_rate = learning_rate self.loss = loss self.l1_reg = l1_reg self.l2_reg = l2_reg self.model = self.build() def build(self): all_inputs, all_outputs = [], [] activation = 'relu' if self.extra_hidden_dims else self.output_activation if self.reconstruct_original_data: out_dim = self.local_input_dim else: out_dim = self.global_input_dim + self.local_input_dim # Global Model global_enc_input = Input(shape=(self.input_length, self.global_input_dim), name='global_enc_input', dtype='float32') all_inputs.append(global_enc_input) global_enc_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.global_hidden_dims] global_enc_rnn = RNN(cell=global_enc_cells, return_state=True, name='global_enc_rnn') # global_embedding = Dense(units=16, activation='relu') _, *global_enc_states = global_enc_rnn(global_enc_input) # Global Model - Reconstruction Branch global_rec_input = Input(shape=(self.reconstruction_length, self.global_input_dim), name='global_rec_input', dtype='float32') all_inputs.append(global_rec_input) global_rec_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.global_hidden_dims] global_rec_rnn = RNN(cell=global_rec_cells, return_sequences=True, name='global_rec_rnn') global_rec_output = global_rec_rnn(global_rec_input, initial_state=global_enc_states) global_rec_dense = Dense(units=self.global_input_dim, activation=activation, name='global_rec_dense') global_rec_output = global_rec_dense(global_rec_output) # Global Model - Prediction Branch if self.prediction_length > 0: global_pred_input = Input(shape=(self.prediction_length, self.global_input_dim), name='global_pred_input', dtype='float32') all_inputs.append(global_pred_input) global_pred_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.global_hidden_dims] global_pred_rnn = RNN(cell=global_pred_cells, return_sequences=True, name='global_pred_rnn') global_pred_output = global_pred_rnn(global_pred_input, initial_state=global_enc_states) global_pred_dense = Dense(units=self.global_input_dim, activation=activation, name='global_pred_dense') global_pred_output = global_pred_dense(global_pred_output) # Local Model local_enc_input = Input(shape=(self.input_length, self.local_input_dim), name='local_enc_input', dtype='float32') all_inputs.append(local_enc_input) local_enc_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.local_hidden_dims] local_enc_rnn = RNN(cell=local_enc_cells, return_state=True, name='local_enc_rnn') # local_embedding = Dense(units=136, activation='relu') _, *local_enc_states = local_enc_rnn(local_enc_input) # Local Model - Reconstruction Branch local_rec_input = Input(shape=(self.reconstruction_length, self.local_input_dim), name='local_rec_input', dtype='float32') all_inputs.append(local_rec_input) local_rec_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.local_hidden_dims] local_rec_rnn = RNN(cell=local_rec_cells, return_sequences=True, name='local_rec_rnn') local_rec_output = local_rec_rnn(local_rec_input, initial_state=local_enc_states) local_rec_dense = Dense(units=self.local_input_dim, activation=activation, name='local_rec_dense') local_rec_output = local_rec_dense(local_rec_output) # Local Model - Prediction Branch if self.prediction_length > 0: local_pred_input = Input(shape=(self.prediction_length, self.local_input_dim), name='local_pred_input', dtype='float32') all_inputs.append(local_pred_input) local_pred_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.local_hidden_dims] local_pred_rnn = RNN(cell=local_pred_cells, return_sequences=True, name='local_pred_rnn') local_pred_output = local_pred_rnn(local_pred_input, initial_state=local_enc_states) local_pred_dense = Dense(units=self.local_input_dim, activation=activation, name='local_pred_dense') local_pred_output = local_pred_dense(local_pred_output) # Merge global and local reconstruction outputs rec_output = keras.layers.concatenate(inputs=[global_rec_output, local_rec_output], axis=-1) if self.multiple_outputs: if self.multiple_outputs_before_concatenation: all_outputs.append(global_rec_output) all_outputs.append(local_rec_output) else: final_global_rec_output = Dense(units=self.global_input_dim, activation=self.output_activation)(rec_output) all_outputs.append(final_global_rec_output) final_local_rec_output = Dense(units=self.local_input_dim, activation=self.output_activation)(rec_output) all_outputs.append(final_local_rec_output) if self.extra_hidden_dims: for hidden_dim in self.extra_hidden_dims: rec_output = Dense(units=hidden_dim, activation='relu')(rec_output) rec_output = Dense(units=out_dim, activation=self.output_activation)(rec_output) elif self.reconstruct_original_data: rec_output = Dense(units=out_dim, activation=self.output_activation)(rec_output) all_outputs.append(rec_output) if self.prediction_length > 0: pred_output = keras.layers.concatenate(inputs=[global_pred_output, local_pred_output], axis=-1) if self.multiple_outputs: if self.multiple_outputs_before_concatenation: all_outputs.append(global_pred_output) all_outputs.append(local_pred_output) else: final_global_pred_output = Dense(units=self.global_input_dim, activation=self.output_activation)(pred_output) all_outputs.append(final_global_pred_output) final_local_pred_output = Dense(units=self.local_input_dim, activation=self.output_activation)(pred_output) all_outputs.append(final_local_pred_output) if self.extra_hidden_dims: for hidden_dim in self.extra_hidden_dims: pred_output = Dense(units=hidden_dim, activation='relu')(pred_output) pred_output = Dense(units=out_dim, activation=self.output_activation)(pred_output) elif self.reconstruct_original_data: pred_output = Dense(units=out_dim, activation=self.output_activation)(pred_output) all_outputs.append(pred_output) return Model(inputs=all_inputs, outputs=all_outputs) def train(self, X_train, y_train=None, epochs=10, initial_epoch=0, batch_size=64, val_data=None, log_dir=None): self.compile() callbacks_list = [ keras.callbacks.EarlyStopping( monitor='val_loss', patience=3 ) ] if log_dir is not None: callbacks_list += [ keras.callbacks.ModelCheckpoint( filepath=os.path.join(log_dir, 'weights_{epoch:03d}_{val_loss:.2f}.h5'), monitor='val_loss', save_best_only=True, save_weights_only=True ), keras.callbacks.CSVLogger( filename=os.path.join(log_dir, 'training_report.csv'), append=True ) ] self._maybe_write_architecture(log_dir) # Preparing the training data if self.reconstruct_original_data: X_global_train, X_local_train, X_out_train = X_train X_global_val, X_local_val, X_out_val = val_data[0] else: X_global_train, X_local_train = X_train X_global_val, X_local_val = val_data[0] X = self._construct_input_data(X_global_train, X_local_train) X_val = self._construct_input_data(X_global_val, X_local_val) if y_train is not None: if self.reconstruct_original_data: y_global_train, y_local_train, y_out_train = y_train y_global_val, y_local_val, y_out_val = val_data[1] else: y_global_train, y_local_train = y_train y_global_val, y_local_val = val_data[1] y_out_train = y_out_val = None else: y_global_train = y_local_train = y_out_train = y_global_val = y_local_val = y_out_val = None if self.reconstruct_original_data: y = self._construct_output_data_alt(X_out_train, y_out_train, X_global_train, y_global_train, X_local_train, y_local_train) y_val = self._construct_output_data_alt(X_out_val, y_out_val, X_global_val, y_global_val, X_local_val, y_local_val) else: y = self._construct_output_data(X_global_train, X_local_train, y_global_train, y_local_train) y_val = self._construct_output_data(X_global_val, X_local_val, y_global_val, y_local_val) validation_data = (X_val, y_val) self.model.fit(X, y, batch_size=batch_size, epochs=epochs, callbacks=callbacks_list, validation_data=validation_data, initial_epoch=initial_epoch) def predict(self, X_test, batch_size=256): X_global_test, X_local_test = X_test X = self._construct_input_data(X_global_test, X_local_test) return self.model.predict(X, batch_size=batch_size) def reconstruct(self, global_features, local_features): if self.prediction_length > 0: reconstructed_features = {trajectory_id: self.predict([global_features[trajectory_id], local_features[trajectory_id]], batch_size=256)[0] for trajectory_id in global_features.keys()} else: reconstructed_features = {trajectory_id: self.predict([global_features[trajectory_id], local_features[trajectory_id]], batch_size=256) for trajectory_id in global_features.keys()} return reconstructed_features def compile(self): self.model.compile(optimizer=select_optimiser(self.optimiser, self.learning_rate), loss=select_loss(self.loss)) def load_weights(self, weights_path): self.model.load_weights(weights_path) return None def _construct_input_data(self, X_global, X_local): X = [X_global] n_examples = X_global.shape[0] X.append(np.zeros((n_examples, self.reconstruction_length, self.global_input_dim), dtype=np.float32)) if self.prediction_length > 0: X.append(np.zeros((n_examples, self.prediction_length, self.global_input_dim), dtype=np.float32)) X.append(X_local) X.append(np.zeros((n_examples, self.reconstruction_length, self.local_input_dim), dtype=np.float32)) if self.prediction_length > 0: X.append(np.zeros((n_examples, self.prediction_length, self.local_input_dim), dtype=np.float32)) return X def _construct_output_data(self, X_global, X_local, y_global=None, y_local=None): y = [] X = np.concatenate((X_global, X_local), axis=-1) if self.multiple_outputs: if self.reconstruct_reverse: y.append(X_global[:, (self.reconstruction_length - 1)::-1, :]) y.append(X_local[:, (self.reconstruction_length - 1)::-1, :]) y.append(X[:, (self.reconstruction_length - 1)::-1, :]) else: y.append(X_global[:, :self.reconstruction_length, :]) y.append(X_local[:, :self.reconstruction_length, :]) y.append(X[:, :self.reconstruction_length, :]) if self.prediction_length > 0: y.append(y_global) y.append(y_local) y.append(np.concatenate((y_global, y_local), axis=-1)) else: if self.reconstruct_reverse: y.append(X[:, (self.reconstruction_length - 1)::-1, :]) else: y.append(X[:, :self.reconstruction_length, :]) if self.prediction_length > 0: y.append(np.concatenate((y_global, y_local), axis=-1)) return y def _construct_output_data_alt(self, X_out, y_out=None, X_global=None, y_global=None, X_local=None, y_local=None): y = [] if self.multiple_outputs: if self.reconstruct_reverse: y.append(X_global[:, (self.reconstruction_length - 1)::-1, :]) y.append(X_local[:, (self.reconstruction_length - 1)::-1, :]) y.append(X_out[:, (self.reconstruction_length - 1)::-1, :]) else: y.append(X_global[:, :self.reconstruction_length, :]) y.append(X_local[:, :self.reconstruction_length, :]) y.append(X_out[:, :self.reconstruction_length, :]) if self.prediction_length > 0: y.append(y_global) y.append(y_local) y.append(y_out) else: if self.reconstruct_reverse: y.append(X_out[:, (self.reconstruction_length - 1)::-1, :]) else: y.append(X_out[:, :self.reconstruction_length, :]) if self.prediction_length > 0: y.append(y_out) return y def _maybe_write_architecture(self, log_dir): file_path = os.path.join(log_dir, 'architecture.txt') if os.path.isfile(file_path): return None with open(file_path, mode='w') as file: print('input_length', self.input_length, file=file) print('global_input_dim', self.global_input_dim, file=file) print('local_input_dim', self.local_input_dim, file=file) print('reconstruction_length', self.reconstruction_length, file=file) print('prediction_length', self.prediction_length, file=file) print('global_hidden_dims', *self.global_hidden_dims, file=file) print('local_hidden_dims', *self.local_hidden_dims, file=file) print('extra_hidden_dims', *self.extra_hidden_dims, file=file) print('output_activation', self.output_activation, file=file) print('reconstruct_reverse', self.reconstruct_reverse, file=file) print('reconstruct_original_data', self.reconstruct_original_data, file=file) print('multiple_outputs', self.multiple_outputs, file=file) print('multiple_outputs_before_concatenation', self.multiple_outputs_before_concatenation, file=file) print('cell_type', self.cell_type, file=file) print('optimiser', self.optimiser, file=file) print('learning_rate', self.learning_rate, file=file) print('loss', self.loss, file=file) print('l1_reg', self.l1_reg, file=file) print('l2_reg', self.l2_reg, file=file) return None def load_complete_rnn_ae_pretrained_models(all_pretrained_models_path): pretrained_models = {} global_scalers, local_scalers = {}, {} for pretrained_model_name in os.listdir(all_pretrained_models_path): if pretrained_model_name.endswith('.npy') or pretrained_model_name.endswith('.npz') or \ pretrained_model_name.endswith('.txt'): continue camera_id = pretrained_model_name.split('_')[0] pretrained_model_path = os.path.join(all_pretrained_models_path, pretrained_model_name) pretrained_models[camera_id], global_scalers[camera_id], local_scalers[camera_id] = \ load_pretrained_combined_model(pretrained_model_path) return pretrained_models, global_scalers, local_scalers def load_pretrained_combined_model(pretrained_model_path, message_passing=False): model_files = os.listdir(pretrained_model_path) architecture_file = model_files[model_files.index('architecture.txt')] global_scaler_file = model_files[model_files.index('global_scaler.pkl')] local_scaler_file = model_files[model_files.index('local_scaler.pkl')] try: out_scaler_file = model_files[model_files.index('out_scaler.pkl')] except ValueError: out_scaler_file = None weight_files = [file_name for file_name in model_files if file_name.startswith('weights')] best_weights = sorted(weight_files)[-1] architecture_path = os.path.join(pretrained_model_path, architecture_file) best_weights_path = os.path.join(pretrained_model_path, best_weights) architecture_specification = load_architecture_specification(architecture_path) if message_passing: combined_model = MessagePassingEncoderDecoder(**architecture_specification) else: combined_model = CombinedEncoderDecoder(**architecture_specification) combined_model.compile() combined_model.load_weights(best_weights_path) global_scaler = joblib.load(filename=os.path.join(pretrained_model_path, global_scaler_file)) local_scaler = joblib.load(filename=os.path.join(pretrained_model_path, local_scaler_file)) if out_scaler_file is not None: out_scaler = joblib.load(filename=os.path.join(pretrained_model_path, out_scaler_file)) else: out_scaler = None return combined_model, global_scaler, local_scaler, out_scaler # TODO Finalise the implementation of the custom coordinate change layer. def coordinate_change(x): xs_star_global, ys_star_global = x[:, :, :1], x[:, :, 1:2] widths, heights = x[:, :, 2:3], x[:, :, 3:4] y = x[:, :, 4::2] * widths + xs_star_global - widths / 2 z = x[:, :, 5::2] * heights + ys_star_global - heights / 2 return x ================================================ FILE: tbad/combined_model/message_passing.py ================================================ import os import keras import keras.backend as K from keras.models import Model from keras.layers import Input, RNN, Dense, Reshape, Lambda import numpy as np from tbad.utils import select_cell, select_optimiser, select_loss class MessagePassingEncoderDecoder: def __init__(self, input_length, global_input_dim, local_input_dim, reconstruction_length, prediction_length=0, global_hidden_dims=(2,), local_hidden_dims=(16,), extra_hidden_dims=(), output_activation='sigmoid', cell_type='gru', reconstruct_reverse=True, reconstruct_original_data=False, multiple_outputs=False, multiple_outputs_before_concatenation=True, optimiser='adam', learning_rate=0.001, loss='balanced_mse', l1_reg=0.0, l2_reg=0.0): self.input_length = input_length self.global_input_dim = global_input_dim self.local_input_dim = local_input_dim self.reconstruction_length = reconstruction_length self.prediction_length = prediction_length self.global_hidden_dims = global_hidden_dims self.local_hidden_dims = local_hidden_dims self.extra_hidden_dims = extra_hidden_dims self.output_activation = output_activation self.cell_type = cell_type self.reconstruct_reverse = reconstruct_reverse self.reconstruct_original_data = reconstruct_original_data self.multiple_outputs = multiple_outputs self.multiple_outputs_before_concatenation = multiple_outputs_before_concatenation self.optimiser = optimiser self.learning_rate = learning_rate self.loss = loss self.l1_reg = l1_reg self.l2_reg = l2_reg self.model = self.build() def build(self): all_inputs, all_outputs = [], [] activation = 'relu' if self.extra_hidden_dims else self.output_activation if self.reconstruct_original_data: out_dim = self.local_input_dim else: out_dim = self.global_input_dim + self.local_input_dim # Encoding global_enc_input = Input(shape=(self.input_length, self.global_input_dim), name='global_enc_input', dtype='float32') all_inputs.append(global_enc_input) local_enc_input = Input(shape=(self.input_length, self.local_input_dim), name='local_enc_input', dtype='float32') all_inputs.append(local_enc_input) global_input_embedding = Dense(units=8, activation='relu') global_enc_message_embedding = Dense(units=8, activation='relu') local_input_embedding = Dense(units=68, activation='relu') local_enc_message_embedding = Dense(units=68, activation='relu') global_enc_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.global_hidden_dims] global_enc_rnn = RNN(cell=global_enc_cells, return_state=True) local_enc_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.local_hidden_dims] local_enc_rnn = RNN(cell=local_enc_cells, return_state=True) global_tilde = global_input_embedding(Lambda(lambda x: x[:, 0, :])(global_enc_input)) local_initial_enc_hidden_state = Input(shape=self.local_hidden_dims, dtype='float32') local_hidden_tilde = global_enc_message_embedding(local_initial_enc_hidden_state) global_concatenated = Reshape((1, -1))(keras.layers.concatenate([global_tilde, local_hidden_tilde], axis=-1)) _, global_hidden_state = global_enc_rnn(global_concatenated) local_tilde = local_input_embedding(Lambda(lambda x: x[:, 0, :])(local_enc_input)) global_initial_enc_hidden_state = Input(shape=self.global_hidden_dims, dtype='float32') global_hidden_tilde = local_enc_message_embedding(global_initial_enc_hidden_state) local_concatenated = Reshape((1, -1))(keras.layers.concatenate([local_tilde, global_hidden_tilde], axis=-1)) _, local_hidden_state = local_enc_rnn(local_concatenated) all_inputs.append(local_initial_enc_hidden_state) all_inputs.append(global_initial_enc_hidden_state) for idx in range(1, self.input_length): global_tilde = global_input_embedding(Lambda(lambda x: x[:, idx, :])(global_enc_input)) local_hidden_tilde = global_enc_message_embedding(local_hidden_state) global_concatenated = Reshape((1, -1))(keras.layers.concatenate([global_tilde, local_hidden_tilde], axis=-1)) local_tilde = local_input_embedding(Lambda(lambda x: x[:, idx, :])(local_enc_input)) global_hidden_tilde = local_enc_message_embedding(global_hidden_state) local_concatenated = Reshape((1, -1))(keras.layers.concatenate([local_tilde, global_hidden_tilde], axis=-1)) _, global_hidden_state = global_enc_rnn(global_concatenated, initial_state=global_hidden_state) _, local_hidden_state = local_enc_rnn(local_concatenated, initial_state=local_hidden_state) # Reconstruction global_rec_message_embedding = Dense(units=8, activation='relu') local_rec_message_embedding = Dense(units=68, activation='relu') global_rec_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.global_hidden_dims] global_rec_rnn = RNN(cell=global_rec_cells, return_sequences=True, return_state=True) local_rec_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.local_hidden_dims] local_rec_rnn = RNN(cell=local_rec_cells, return_sequences=True, return_state=True) global_rec_dense = Dense(units=self.global_input_dim, activation=activation) local_rec_dense = Dense(units=self.local_input_dim, activation=activation) global_rec_outputs = [] local_rec_tilde = global_rec_message_embedding(local_hidden_state) global_rec_concatenated = Reshape((1, -1))(local_rec_tilde) global_rec_output, global_rec_hidden_state = global_rec_rnn(global_rec_concatenated, initial_state=global_hidden_state) global_rec_output = global_rec_dense(global_rec_output) global_rec_outputs.append(global_rec_output) local_rec_outputs = [] global_rec_tilde = local_rec_message_embedding(global_hidden_state) local_rec_concatenated = Reshape((1, -1))(global_rec_tilde) local_rec_output, local_rec_hidden_state = local_rec_rnn(local_rec_concatenated, initial_state=local_hidden_state) local_rec_output = local_rec_dense(local_rec_output) local_rec_outputs.append(local_rec_output) for idx in range(1, self.reconstruction_length): local_rec_tilde = global_rec_message_embedding(local_rec_hidden_state) global_rec_concatenated = Reshape((1, -1))(local_rec_tilde) global_rec_tilde = local_rec_message_embedding(global_rec_hidden_state) local_rec_concatenated = Reshape((1, -1))(global_rec_tilde) global_rec_output, global_rec_hidden_state = global_rec_rnn(global_rec_concatenated, initial_state=global_rec_hidden_state) global_rec_output = global_rec_dense(global_rec_output) global_rec_outputs.append(global_rec_output) local_rec_output, local_rec_hidden_state = local_rec_rnn(local_rec_concatenated, initial_state=local_rec_hidden_state) local_rec_output = local_rec_dense(local_rec_output) local_rec_outputs.append(local_rec_output) global_rec_output = Lambda(lambda x: K.concatenate(x, axis=1))(global_rec_outputs) local_rec_output = Lambda(lambda x: K.concatenate(x, axis=1))(local_rec_outputs) rec_output = keras.layers.concatenate(inputs=[global_rec_output, local_rec_output], axis=-1) if self.multiple_outputs: if self.multiple_outputs_before_concatenation: all_outputs.append(global_rec_output) all_outputs.append(local_rec_output) else: final_global_rec_output = Dense(units=self.global_input_dim, activation=self.output_activation)(rec_output) all_outputs.append(final_global_rec_output) final_local_rec_output = Dense(units=self.local_input_dim, activation=self.output_activation)(rec_output) all_outputs.append(final_local_rec_output) if self.extra_hidden_dims: for hidden_dim in self.extra_hidden_dims: rec_output = Dense(units=hidden_dim, activation='relu')(rec_output) rec_output = Dense(units=out_dim, activation=self.output_activation)(rec_output) elif self.reconstruct_original_data: rec_output = Dense(units=out_dim, activation=self.output_activation)(rec_output) all_outputs.append(rec_output) # Prediction if self.prediction_length > 0: global_pred_message_embedding = Dense(units=8, activation='relu') local_pred_message_embedding = Dense(units=68, activation='relu') global_pred_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.global_hidden_dims] global_pred_rnn = RNN(cell=global_pred_cells, return_sequences=True, return_state=True) local_pred_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.local_hidden_dims] local_pred_rnn = RNN(cell=local_pred_cells, return_sequences=True, return_state=True) global_pred_dense = Dense(units=self.global_input_dim, activation=activation) local_pred_dense = Dense(units=self.local_input_dim, activation=activation) global_pred_outputs = [] local_pred_tilde = global_pred_message_embedding(local_hidden_state) global_pred_concatenated = Reshape((1, -1))(local_pred_tilde) global_pred_output, global_pred_hidden_state = global_pred_rnn(global_pred_concatenated, initial_state=global_hidden_state) global_pred_output = global_pred_dense(global_pred_output) global_pred_outputs.append(global_pred_output) local_pred_outputs = [] global_pred_tilde = local_pred_message_embedding(global_hidden_state) local_pred_concatenated = Reshape((1, -1))(global_pred_tilde) local_pred_output, local_pred_hidden_state = local_pred_rnn(local_pred_concatenated, initial_state=local_hidden_state) local_pred_output = local_pred_dense(local_pred_output) local_pred_outputs.append(local_pred_output) for idx in range(1, self.prediction_length): local_pred_tilde = global_pred_message_embedding(local_pred_hidden_state) global_pred_concatenated = Reshape((1, -1))(local_pred_tilde) global_pred_tilde = local_pred_message_embedding(global_pred_hidden_state) local_pred_concatenated = Reshape((1, -1))(global_pred_tilde) global_pred_output, global_pred_hidden_state = global_pred_rnn(global_pred_concatenated, initial_state=global_pred_hidden_state) global_pred_output = global_pred_dense(global_pred_output) global_pred_outputs.append(global_pred_output) local_pred_output, local_pred_hidden_state = local_pred_rnn(local_pred_concatenated, initial_state=local_pred_hidden_state) local_pred_output = local_pred_dense(local_pred_output) local_pred_outputs.append(local_pred_output) global_pred_output = Lambda(lambda x: K.concatenate(x, axis=1))(global_pred_outputs) local_pred_output = Lambda(lambda x: K.concatenate(x, axis=1))(local_pred_outputs) pred_output = keras.layers.concatenate(inputs=[global_pred_output, local_pred_output], axis=-1) if self.multiple_outputs: if self.multiple_outputs_before_concatenation: all_outputs.append(global_pred_output) all_outputs.append(local_pred_output) else: final_global_pred_output = Dense(units=self.global_input_dim, activation=self.output_activation)(pred_output) all_outputs.append(final_global_pred_output) final_local_pred_output = Dense(units=self.local_input_dim, activation=self.output_activation)(pred_output) all_outputs.append(final_local_pred_output) if self.extra_hidden_dims: for hidden_dim in self.extra_hidden_dims: pred_output = Dense(units=hidden_dim, activation='relu')(pred_output) pred_output = Dense(units=out_dim, activation=self.output_activation)(pred_output) elif self.reconstruct_original_data: pred_output = Dense(units=out_dim, activation=self.output_activation)(pred_output) all_outputs.append(pred_output) return Model(inputs=all_inputs, outputs=all_outputs) def train(self, X_train, y_train=None, epochs=10, initial_epoch=0, batch_size=64, val_data=None, log_dir=None): self.compile() callbacks_list = [ keras.callbacks.EarlyStopping( monitor='val_loss', patience=3 ) ] if log_dir is not None: callbacks_list += [ keras.callbacks.ModelCheckpoint( filepath=os.path.join(log_dir, 'weights_{epoch:03d}_{val_loss:.2f}.h5'), monitor='val_loss', save_best_only=True, save_weights_only=True ), keras.callbacks.CSVLogger( filename=os.path.join(log_dir, 'training_report.csv'), append=True ) ] self._maybe_write_architecture(log_dir) if self.reconstruct_original_data: X_global_train, X_local_train, X_out_train = X_train X_global_val, X_local_val, X_out_val = val_data[0] if y_train is not None: y_global_train, y_local_train, y_out_train = y_train y_global_val, y_local_val, y_out_val = val_data[1] else: y_global_train = y_local_train = y_out_train = y_global_val = y_local_val = y_out_val = None y = self._construct_output_data_alt(X_out_train, y_out_train, X_global_train, y_global_train, X_local_train, y_local_train) y_val = self._construct_output_data_alt(X_out_val, y_out_val, X_global_val, y_global_val, X_local_val, y_local_val) else: X_global_train, X_local_train = X_train X_global_val, X_local_val = val_data[0] if y_train is not None: y_global_train, y_local_train = y_train y_global_val, y_local_val = val_data[1] else: y_global_train = y_local_train = y_global_val = y_local_val = None y = self._construct_output_data(X_global_train, X_local_train, y_global_train, y_local_train) y_val = self._construct_output_data(X_global_val, X_local_val, y_global_val, y_local_val) X = self._construct_input_data(X_global_train, X_local_train) X_val = self._construct_input_data(X_global_val, X_local_val) validation_data = (X_val, y_val) self.model.fit(X, y, batch_size=batch_size, epochs=epochs, callbacks=callbacks_list, validation_data=validation_data, initial_epoch=initial_epoch) def predict(self, X_test, batch_size=256): X_global_test, X_local_test = X_test X = self._construct_input_data(X_global_test, X_local_test) return self.model.predict(X, batch_size=batch_size) def compile(self): self.model.compile(optimizer=select_optimiser(self.optimiser, self.learning_rate), loss=select_loss(self.loss)) def load_weights(self, weights_path): self.model.load_weights(weights_path) def _construct_input_data(self, X_global, X_local): X = [X_global, X_local] num_examples = X_global.shape[0] X.append(np.zeros((num_examples, self.local_hidden_dims[0]), dtype=np.float32)) X.append(np.zeros((num_examples, self.global_hidden_dims[0]), dtype=np.float32)) return X def _construct_output_data(self, X_global, X_local, y_global=None, y_local=None): y = [] X = np.concatenate((X_global, X_local), axis=-1) if self.multiple_outputs: if self.reconstruct_reverse: y.append(X_global[:, (self.reconstruction_length - 1)::-1, :]) y.append(X_local[:, (self.reconstruction_length - 1)::-1, :]) y.append(X[:, (self.reconstruction_length - 1)::-1, :]) else: y.append(X_global[:, :self.reconstruction_length, :]) y.append(X_local[:, :self.reconstruction_length, :]) y.append(X[:, :self.reconstruction_length, :]) if self.prediction_length > 0: y.append(y_global) y.append(y_local) y.append(np.concatenate((y_global, y_local), axis=-1)) else: if self.reconstruct_reverse: y.append(X[:, (self.reconstruction_length - 1)::-1, :]) else: y.append(X[:, :self.reconstruction_length, :]) if self.prediction_length > 0: y.append(np.concatenate((y_global, y_local), axis=-1)) return y def _construct_output_data_alt(self, X_out, y_out=None, X_global=None, y_global=None, X_local=None, y_local=None): y = [] if self.multiple_outputs: if self.reconstruct_reverse: y.append(X_global[:, (self.reconstruction_length - 1)::-1, :]) y.append(X_local[:, (self.reconstruction_length - 1)::-1, :]) y.append(X_out[:, (self.reconstruction_length - 1)::-1, :]) else: y.append(X_global[:, :self.reconstruction_length, :]) y.append(X_local[:, :self.reconstruction_length, :]) y.append(X_out[:, :self.reconstruction_length, :]) if self.prediction_length > 0: y.append(y_global) y.append(y_local) y.append(y_out) else: if self.reconstruct_reverse: y.append(X_out[:, (self.reconstruction_length - 1)::-1, :]) else: y.append(X_out[:, :self.reconstruction_length, :]) if self.prediction_length > 0: y.append(y_out) return y def _maybe_write_architecture(self, log_dir): file_path = os.path.join(log_dir, 'architecture.txt') if os.path.isfile(file_path): return None with open(file_path, mode='w') as file: print('input_length', self.input_length, file=file) print('global_input_dim', self.global_input_dim, file=file) print('local_input_dim', self.local_input_dim, file=file) print('reconstruction_length', self.reconstruction_length, file=file) print('prediction_length', self.prediction_length, file=file) print('global_hidden_dims', *self.global_hidden_dims, file=file) print('local_hidden_dims', *self.local_hidden_dims, file=file) print('extra_hidden_dims', *self.extra_hidden_dims, file=file) print('output_activation', self.output_activation, file=file) print('reconstruct_reverse', self.reconstruct_reverse, file=file) print('reconstruct_original_data', self.reconstruct_original_data, file=file) print('multiple_outputs', self.multiple_outputs, file=file) print('multiple_outputs_before_concatenation', self.multiple_outputs_before_concatenation, file=file) print('cell_type', self.cell_type, file=file) print('optimiser', self.optimiser, file=file) print('learning_rate', self.learning_rate, file=file) print('loss', self.loss, file=file) print('l1_reg', self.l1_reg, file=file) print('l2_reg', self.l2_reg, file=file) ================================================ FILE: tbad/combined_model/train.py ================================================ from copy import deepcopy import os import numpy as np from sklearn.externals import joblib from sklearn.utils import shuffle from tbad.autoencoder.data import load_trajectories, split_into_train_and_test, extract_global_features from tbad.autoencoder.data import change_coordinate_system, scale_trajectories, aggregate_autoencoder_data from tbad.autoencoder.data import input_trajectories_missing_steps from tbad.rnn_autoencoder.data import remove_short_trajectories, aggregate_rnn_autoencoder_data from tbad.combined_model.fusion import CombinedEncoderDecoder from tbad.combined_model.message_passing import MessagePassingEncoderDecoder from tbad.utils import set_up_logging, resume_training_from_last_epoch def train_combined_model(args): # General trajectories_path = args.trajectories camera_id = os.path.basename(trajectories_path) video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) # Architecture message_passing = args.message_passing reconstruct_original_data = args.reconstruct_original_data multiple_outputs = args.multiple_outputs multiple_outputs_before_concatenation = args.multiple_outputs_before_concatenation input_length = args.input_length rec_length = args.rec_length pred_length = args.pred_length global_hidden_dims = args.global_hidden_dims local_hidden_dims = args.local_hidden_dims extra_hidden_dims = args.extra_hidden_dims output_activation = args.output_activation cell_type = args.cell_type reconstruct_reverse = args.reconstruct_reverse # Training optimiser = args.optimiser learning_rate = args.learning_rate loss = args.loss l1_reg = args.l1_reg l2_reg = args.l2_reg epochs = args.epochs batch_size = args.batch_size input_missing_steps = args.input_missing_steps global_normalisation_strategy = args.global_normalisation_strategy local_normalisation_strategy = args.local_normalisation_strategy out_normalisation_strategy = args.out_normalisation_strategy # Logging root_log_dir = args.root_log_dir resume_training = args.resume_training trajectories = load_trajectories(trajectories_path) print('\nLoaded %d trajectories.' % len(trajectories)) trajectories = remove_short_trajectories(trajectories, input_length=input_length, input_gap=0, pred_length=pred_length) print('\nRemoved short trajectories. Number of trajectories left: %d.' % len(trajectories)) trajectories_train, trajectories_val = split_into_train_and_test(trajectories, train_ratio=0.8, seed=42) if input_missing_steps: trajectories_train = input_trajectories_missing_steps(trajectories_train) print('\nInputted missing steps of trajectories.') # TODO: General function to extract features # X_..._train, X_..._val, y_..._train, y_..._val, ..._scaler = general_function() # Global global_trajectories_train = extract_global_features(deepcopy(trajectories_train), video_resolution=video_resolution) global_trajectories_val = extract_global_features(deepcopy(trajectories_val), video_resolution=video_resolution) global_trajectories_train = change_coordinate_system(global_trajectories_train, video_resolution=video_resolution, coordinate_system='global', invert=False) global_trajectories_val = change_coordinate_system(global_trajectories_val, video_resolution=video_resolution, coordinate_system='global', invert=False) print('\nChanged global trajectories\'s coordinate system to global.') _, global_scaler = scale_trajectories(aggregate_autoencoder_data(global_trajectories_train), strategy=global_normalisation_strategy) X_global_train, y_global_train = aggregate_rnn_autoencoder_data(global_trajectories_train, input_length=input_length, input_gap=0, pred_length=pred_length) X_global_val, y_global_val = aggregate_rnn_autoencoder_data(global_trajectories_val, input_length=input_length, input_gap=0, pred_length=pred_length) X_global_train, _ = scale_trajectories(X_global_train, scaler=global_scaler, strategy=global_normalisation_strategy) X_global_val, _ = scale_trajectories(X_global_val, scaler=global_scaler, strategy=global_normalisation_strategy) if y_global_train is not None and y_global_val is not None: y_global_train, _ = scale_trajectories(y_global_train, scaler=global_scaler, strategy=global_normalisation_strategy) y_global_val, _ = scale_trajectories(y_global_val, scaler=global_scaler, strategy=global_normalisation_strategy) print('\nNormalised global trajectories using the %s normalisation strategy.' % global_normalisation_strategy) # Local local_trajectories_train = deepcopy(trajectories_train) if reconstruct_original_data else trajectories_train local_trajectories_val = deepcopy(trajectories_val) if reconstruct_original_data else trajectories_val local_trajectories_train = change_coordinate_system(local_trajectories_train, video_resolution=video_resolution, coordinate_system='bounding_box_centre', invert=False) local_trajectories_val = change_coordinate_system(local_trajectories_val, video_resolution=video_resolution, coordinate_system='bounding_box_centre', invert=False) print('\nChanged local trajectories\'s coordinate system to bounding_box_centre.') _, local_scaler = scale_trajectories(aggregate_autoencoder_data(local_trajectories_train), strategy=local_normalisation_strategy) X_local_train, y_local_train = aggregate_rnn_autoencoder_data(local_trajectories_train, input_length=input_length, input_gap=0, pred_length=pred_length) X_local_val, y_local_val = aggregate_rnn_autoencoder_data(local_trajectories_val, input_length=input_length, input_gap=0, pred_length=pred_length) X_local_train, _ = scale_trajectories(X_local_train, scaler=local_scaler, strategy=local_normalisation_strategy) X_local_val, _ = scale_trajectories(X_local_val, scaler=local_scaler, strategy=local_normalisation_strategy) if y_local_train is not None and y_local_val is not None: y_local_train, _ = scale_trajectories(y_local_train, scaler=local_scaler, strategy=local_normalisation_strategy) y_local_val, _ = scale_trajectories(y_local_val, scaler=local_scaler, strategy=local_normalisation_strategy) print('\nNormalised local trajectories using the %s normalisation strategy.' % local_normalisation_strategy) # (Optional) Reconstruct the original data if reconstruct_original_data: print('\nReconstruction/Prediction target is the original data.') out_trajectories_train = trajectories_train out_trajectories_val = trajectories_val out_trajectories_train = change_coordinate_system(out_trajectories_train, video_resolution=video_resolution, coordinate_system='global', invert=False) out_trajectories_val = change_coordinate_system(out_trajectories_val, video_resolution=video_resolution, coordinate_system='global', invert=False) print('\nChanged target trajectories\'s coordinate system to global.') _, out_scaler = scale_trajectories(aggregate_autoencoder_data(out_trajectories_train), strategy=out_normalisation_strategy) X_out_train, y_out_train = aggregate_rnn_autoencoder_data(out_trajectories_train, input_length=input_length, input_gap=0, pred_length=pred_length) X_out_val, y_out_val = aggregate_rnn_autoencoder_data(out_trajectories_val, input_length=input_length, input_gap=0, pred_length=pred_length) X_out_train, _ = scale_trajectories(X_out_train, scaler=out_scaler, strategy=out_normalisation_strategy) X_out_val, _ = scale_trajectories(X_out_val, scaler=out_scaler, strategy=out_normalisation_strategy) if y_out_train is not None and y_out_val is not None: y_out_train, _ = scale_trajectories(y_out_train, scaler=out_scaler, strategy=out_normalisation_strategy) y_out_val, _ = scale_trajectories(y_out_val, scaler=out_scaler, strategy=out_normalisation_strategy) print('\nNormalised target trajectories using the %s normalisation strategy.' % out_normalisation_strategy) # Shuffle training data and assemble training and validation sets if y_global_train is not None: if reconstruct_original_data: X_global_train, X_local_train, X_out_train, y_global_train, y_local_train, y_out_train = \ shuffle(X_global_train, X_local_train, X_out_train, y_global_train, y_local_train, y_out_train, random_state=42) X_train = [X_global_train, X_local_train, X_out_train] y_train = [y_global_train, y_local_train, y_out_train] val_data = ([X_global_val, X_local_val, X_out_val], [y_global_val, y_local_val, y_out_val]) else: X_global_train, X_local_train, y_global_train, y_local_train = \ shuffle(X_global_train, X_local_train, y_global_train, y_local_train, random_state=42) X_train = [X_global_train, X_local_train] y_train = [y_global_train, y_local_train] val_data = ([X_global_val, X_local_val], [y_global_val, y_local_val]) else: if reconstruct_original_data: X_global_train, X_local_train, X_out_train = \ shuffle(X_global_train, X_local_train, X_out_train, random_state=42) X_train = [X_global_train, X_local_train, X_out_train] y_train = None val_data = ([X_global_val, X_local_val, X_out_val],) else: X_global_train, X_local_train = shuffle(X_global_train, X_local_train, random_state=42) X_train = [X_global_train, X_local_train] y_train = None val_data = ([X_global_val, X_local_val],) # Model print('\nInstantiating combined anomaly model ...') global_input_dim = X_global_train.shape[-1] local_input_dim = X_local_train.shape[-1] model_args = {'input_length': input_length, 'global_input_dim': global_input_dim, 'local_input_dim': local_input_dim, 'reconstruction_length': rec_length, 'prediction_length': pred_length, 'global_hidden_dims': global_hidden_dims, 'local_hidden_dims': local_hidden_dims, 'extra_hidden_dims': extra_hidden_dims, 'output_activation': output_activation, 'cell_type': cell_type, 'reconstruct_reverse': reconstruct_reverse, 'reconstruct_original_data': reconstruct_original_data, 'multiple_outputs': multiple_outputs, 'multiple_outputs_before_concatenation': multiple_outputs_before_concatenation, 'optimiser': optimiser, 'learning_rate': learning_rate, 'loss': loss, 'l1_reg': l1_reg, 'l2_reg': l2_reg} if message_passing: combined_rnn_ae = MessagePassingEncoderDecoder(**model_args) else: combined_rnn_ae = CombinedEncoderDecoder(**model_args) log_dir = set_up_logging(camera_id=camera_id, root_log_dir=root_log_dir, resume_training=resume_training) last_epoch = resume_training_from_last_epoch(model=combined_rnn_ae, resume_training=resume_training) combined_rnn_ae.train(X_train, y_train, epochs=epochs, initial_epoch=last_epoch, batch_size=batch_size, val_data=val_data, log_dir=log_dir) print('\nCombined anomaly model successfully trained.') if log_dir is not None: global_scaler_file_name = os.path.join(log_dir, 'global_scaler.pkl') local_scaler_file_name = os.path.join(log_dir, 'local_scaler.pkl') joblib.dump(global_scaler, filename=global_scaler_file_name) joblib.dump(local_scaler, filename=local_scaler_file_name) if reconstruct_original_data: out_scaler_file_name = os.path.join(log_dir, 'out_scaler.pkl') joblib.dump(out_scaler, filename=out_scaler_file_name) print('log files were written to: %s' % log_dir) if reconstruct_original_data: return combined_rnn_ae, global_scaler, local_scaler, out_scaler return combined_rnn_ae, global_scaler, local_scaler ================================================ FILE: tbad/data.py ================================================ import os from copy import deepcopy import numpy as np from sklearn.preprocessing import MinMaxScaler from tbad.visualisation import compute_bounding_box # For future refactoring class Trajectory: def __init__(self, trajectory_id, frames, coordinates): self.trajectory_id = trajectory_id self.person_id = trajectory_id.split('_')[1] self.frames = frames self.coordinates = coordinates def __len__(self): return len(self.frames) def load_trajectories(trajectories_path): """Load trajectory data into memory. The trajectory data contains information about the trajectory of each person detected in the video(s). More specifically, each person's trajectory is a .csv file, where each row contains the frame number followed by 17 pairs of x and y coordinates. Any missing detections are represented by pairs of zeros. The directory contains a folder for each video analysed, and each folder contains a .csv file for each person tracked. In summary, the directory is structured like trajectories_path/{}/{}.csv. Argument(s): trajectories_path -- Path to directory containing the trajectories to load. Return(s): Two dictionaries. Both dictionaries contain the same set of keys, which uniquely identify each trajectory loaded. Each value of the first dictionary is a numpy array of integers, of shape (trajectory_length,), containing the frame numbers of each trajectory. The second dictionary contains the actual trajectories, numpy arrays of shape (trajectory_length, input_dim). """ trajectories_frames, trajectories_coordinates = {}, {} folder_names = os.listdir(trajectories_path) for folder_name in folder_names: csv_file_names = os.listdir(os.path.join(trajectories_path, folder_name)) for csv_file_name in csv_file_names: trajectory_file_path = os.path.join(trajectories_path, folder_name, csv_file_name) trajectory = np.loadtxt(trajectory_file_path, dtype=np.float32, delimiter=',', ndmin=2) trajectory_frames, trajectory_coordinates = trajectory[:, 0].astype(np.int32), trajectory[:, 1:] person_id = csv_file_name.split('.')[0] trajectory_id = folder_name + '_' + person_id trajectories_frames[trajectory_id] = trajectory_frames trajectories_coordinates[trajectory_id] = trajectory_coordinates return trajectories_frames, trajectories_coordinates def is_short_trajectory(trajectory_coordinates, input_length, input_gap=0, pred_length=0): """Identify whether a trajectory is short or not. To reconstruct a sequence of frames and predict a number of frames into the future, the trajectory of a person must have a minimum length of input_length + input_gap * (input_length - 1) + pred_length. Argument(s): trajectory_coordinates -- A numpy array of shape (trajectory_length, input_dim). input_length -- Number of timesteps for the encoder-decoder RNN. input_gap -- Number of timesteps to skip during encoding of adjacent timesteps. pred_length -- Number of future timesteps for the encoder-decoder RNN to predict. Return(s): True if the input trajectory is short. Otherwise, False. """ min_trajectory_length = input_length + input_gap * (input_length - 1) + pred_length return len(trajectory_coordinates) < min_trajectory_length def remove_short_trajectories(trajectories_coordinates, input_length, input_gap=0, pred_length=0): """Remove short trajectories. Argument(s): trajectories_coordinates -- A dictionary of numpy arrays, each of shape (trajectory_length, input_dim). input_length -- Number of input timesteps for the encoder-decoder RNN. input_gap -- Number of timesteps to skip during the encoding of adjacent timesteps. pred_length -- Number of future timesteps for the encoder-decoder RNN to predict. Return(s): A dictionary of numpy arrays, each of shape (trajectory_length, input_dim). The arrays have a trajectory_length greater than a computed threshold. """ filtered_trajectories_coordinates = {trajectory_id: trajectory_coordinates for trajectory_id, trajectory_coordinates in trajectories_coordinates.items() if not is_short_trajectory(trajectory_coordinates, input_length=input_length, input_gap=input_gap, pred_length=pred_length)} return filtered_trajectories_coordinates def input_trajectory_missing_steps(trajectory_coordinates): """Fill missing steps with a weighted average of the closest non-missing steps. Argument(s): trajectory_coordinates: A numpy array of shape (trajectory_length, input_dim). Return(s): A numpy array of shape (trajectory_length, input_dim) with no missing steps. """ trajectory_length, input_dim = trajectory_coordinates.shape last_step_non_missing = 0 consecutive_missing_steps = 0 while last_step_non_missing < trajectory_length - 1: step_is_missing = np.sum(trajectory_coordinates[last_step_non_missing + 1, :] == 0) == input_dim while step_is_missing: consecutive_missing_steps += 1 step_is_missing = np.sum(trajectory_coordinates[last_step_non_missing + 1 + consecutive_missing_steps, :] == 0) == input_dim if consecutive_missing_steps: start_trajectory = trajectory_coordinates[last_step_non_missing, :] end_trajectory = trajectory_coordinates[last_step_non_missing + 1 + consecutive_missing_steps, :] for n in range(1, consecutive_missing_steps + 1): a = ((consecutive_missing_steps + 1 - n) / (consecutive_missing_steps + 1)) * start_trajectory b = (n / (consecutive_missing_steps + 1)) * end_trajectory fill_step = a + b fill_step = np.where((start_trajectory == 0) | (end_trajectory == 0), 0, fill_step) trajectory_coordinates[last_step_non_missing + n, :] = fill_step last_step_non_missing += consecutive_missing_steps + 1 consecutive_missing_steps = 0 return trajectory_coordinates def input_trajectories_missing_steps(trajectories_coordinates): trajectories_coordinates = {trajectory_id: input_trajectory_missing_steps(trajectory_coordinates) for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} return trajectories_coordinates def normalise_trajectory_video_resolution(trajectory_coordinates, video_resolution): """Normalise the coordinate-values of a trajectory into the [0, 1] range. Argument(s): trajectory_coordinates -- A numpy array of shape (trajectory_length, input_dim). video_resolution -- A list containing the width and height of the trajectories' original videos. Return(s): The input trajectory normalised into the [0, 1] range. """ video_resolution = np.array(video_resolution, dtype=np.float32) normalised_trajectory_coordinates = trajectory_coordinates.reshape(-1, 2) / video_resolution return normalised_trajectory_coordinates.reshape(*trajectory_coordinates.shape) def normalise_trajectories_video_resolution(trajectories_coordinates, video_resolution): """Normalise trajectories' coordinates into the [0, 1] range. Convert all x and y coordinates of the trajectories into the [0, 1] range. All x coordinates are divided by the video's width and y coordinates are divided by the video's height. Argument(s): trajectories -- A dictionary of numpy arrays, each of shape (trajectory_length, input_dim). video_resolution -- A list containing the width and height of the trajectories' original videos. Return(s): A dictionary of numpy arrays, each of shape (trajectory_length, input_dim). All trajectories' coordinates values are in the [0, 1] range. """ normalised_coordinates = {trajectory_id: normalise_trajectory_video_resolution(trajectory_coordinates, video_resolution=video_resolution) for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} return normalised_coordinates def normalise_trajectories(trajectories_coordinates, video_resolution, strategy='video_resolution'): if strategy == 'bounding_box': normalised_coordinates = normalise_bounding_boxes(trajectories_coordinates, video_resolution=video_resolution) print('\nTrajectories normalised into the [0, 1] range relative to the bounding boxes.') elif strategy == 'video_resolution': normalised_coordinates = normalise_trajectories_video_resolution(trajectories_coordinates, video_resolution=video_resolution) print('\nTrajectories normalised into the [0, 1] range relative to the video resolution.') else: raise ValueError('Unknown normalisation strategy. Please use either bounding_box or video_resolution.') return normalised_coordinates def normalise_bounding_box(trajectory_coordinates, video_resolution): trajectory_length = trajectory_coordinates.shape[0] for step_idx in range(trajectory_length): coordinates = trajectory_coordinates[step_idx, :] if any(coordinates): left, right, top, bottom = compute_bounding_box(coordinates, video_resolution=video_resolution) coordinates_reshaped = coordinates.reshape(-1, 2) xs, ys = coordinates_reshaped[:, 0], coordinates_reshaped[:, 1] xs, ys = np.where(xs == 0.0, float(left), xs), np.where(ys == 0.0, float(top), ys) xs = (xs - left) / (right - left) ys = (ys - top) / (bottom - top) coordinates_reshaped[:, 0], coordinates_reshaped[:, 1] = xs, ys coordinates = coordinates_reshaped.reshape(-1) trajectory_coordinates[step_idx, :] = coordinates return trajectory_coordinates def normalise_bounding_boxes(trajectories_coordinates, video_resolution): normalised_coordinates = {trajectory_id: normalise_bounding_box(trajectory_coordinates, video_resolution=video_resolution) for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} return normalised_coordinates def normalise_joints(X, min_max_values=None): num_examples, input_length, input_dim = X.shape X = X.reshape(-1, input_dim) X = np.where(X == 0.0, np.nan, X) if min_max_values is not None: min_values = min_max_values[0] max_values = min_max_values[1] else: min_values = np.nanmin(X, axis=0) max_values = np.nanmax(X, axis=0) X = (X - min_values) / (max_values - min_values) X = np.where(np.isnan(X), 0.0, X) X = X.reshape(num_examples, input_length, input_dim) return X, (min_values, max_values) def denormalise_trajectory(trajectory_coordinates, video_resolution): video_resolution = np.array(video_resolution, dtype=np.float32) denormalised_trajectory_coordinates = trajectory_coordinates.reshape(-1, 2) * video_resolution return denormalised_trajectory_coordinates.reshape(*trajectory_coordinates.shape) def denormalise_trajectories(trajectories_coordinates, video_resolution): """Denormalise trajectories' coordinates into the original video range. Convert all x and y coordinates of the trajectories from the [0, 1] range into the video's original range. All x coordinates are multiplied by the video's width and y coordinates are multiplied by the video's height. Argument(s): trajectories -- A list of numpy arrays, each of shape (trajectory_length, 34). video_resolution -- A list containing the width and height of the trajectories' original videos. Return(s): A list of numpy arrays, each of shape (trajectory_length, 34). All trajectories' coordinates values are in the video's original range. """ video_resolution = np.array(video_resolution, dtype=np.float32) denormalised_trajectories_coordinates = \ {trajectory_id: denormalise_trajectory(trajectory_coordinates, video_resolution=video_resolution) for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} return denormalised_trajectories_coordinates def collect_trajectories(trajectory_coordinates, input_length, input_gap=0, pred_length=0): input_trajectories = [] total_input_seq_len = input_length + input_gap * (input_length - 1) step = input_gap + 1 if pred_length > 0: future_trajectories = [] stop = len(trajectory_coordinates) - pred_length - total_input_seq_len + 1 for start_index in range(0, stop): stop_index = start_index + total_input_seq_len input_trajectories.append(trajectory_coordinates[start_index:stop_index:step, :]) future_trajectories.append(trajectory_coordinates[stop_index:(stop_index + pred_length), :]) return np.stack(input_trajectories, axis=0), np.stack(future_trajectories, axis=0) else: stop = len(trajectory_coordinates) - total_input_seq_len + 1 for start_index in range(0, stop): stop_index = start_index + total_input_seq_len input_trajectories.append(trajectory_coordinates[start_index:stop_index:step, :]) return np.stack(input_trajectories, axis=0) # def gather_trajectories(trajectories, input_seq_len, gap_between_frames=0, pred_seq_len=None): # """Assemble all possible trajectories into tensors. # # Collect all possible trajectories into a single tensor for training of the RNN encoder-decoder. If pred_seq_len is # None only a single tensor of shape (num_unique_trajectories, input_seq_len, 34) is returned; otherwise, another # tensor containing the future frames, of shape (num_unique_trajectories, pred_seq_len, 34), is also returned. # # The number of unique trajectories is dependent on the values of input_seq_len, gap_between_frames and pred_seq_len. # # Argument(s): # trajectories -- A list of numpy arrays, each of shape(trajectory_length, 35). # input_seq_len -- Number of input timesteps for the encoder-decoder RNN. # gap_between_frames -- Number of timesteps to skip during the encoding of adjacent timesteps. # pred_seq_len -- Number of future timesteps for the encoder-decoder RNN to predict. # # Return(s): # If pred_seq_len is None, a single tensor of shape (num_unique_trajectories, input_seq_len, 34). Otherwise, # a tensor of shape (num_unique_trajectories, pred_seq_len, 34) is returned in addition to the aforementioned one. # """ # encoding_trajectories = [] # if pred_seq_len is not None: # pred_trajectories = [] # total_input_seq_len = input_seq_len + gap_between_frames * (input_seq_len - 1) # encoding_step = gap_between_frames + 1 # for trajectory in trajectories: # if pred_seq_len is not None: # stop = len(trajectory) - pred_seq_len - total_input_seq_len + 1 # for start_index in range(0, stop): # stop_index = start_index + total_input_seq_len # encoding_trajectories.append(trajectory[start_index:stop_index:encoding_step, 1:]) # pred_trajectories.append(trajectory[stop_index:(stop_index + pred_seq_len), 1:]) # else: # stop = len(trajectory) - total_input_seq_len + 1 # for start_index in range(0, stop): # stop_index = start_index + total_input_seq_len # encoding_trajectories.append(trajectory[start_index:stop_index:encoding_step, 1:]) # # if pred_seq_len is not None: # return np.stack(encoding_trajectories), np.stack(pred_trajectories) # else: # return np.stack(encoding_trajectories) def collect_test_trajectories(trajectory_coordinates, trajectory_frames, input_length, input_gap=0, pred_length=0): """Collect all possible trajectories into a single tensor. Argument(s): trajectory_coordinates -- A numpy array of shape (trajectory_length, input_dim) containing the keypoints' coordinates at each step of the trajectory. trajectory_frames -- A numpy array of shape (trajectory_length,) containing the frame ids of each trajectory step in trajectory_coordinates. input_length -- . input_gap -- . pred_length -- . Return(s): """ input_trajectories_coordinates = [] input_trajectories_frames = [] last_frame_id = trajectory_frames[-1] trajectory_original_length = len(trajectory_frames) padding_length = ((trajectory_original_length // input_length) + 1) * input_length - trajectory_original_length padded_trajectory_coordinates = pad_trajectory(trajectory_coordinates, padding_length=padding_length) padded_trajectory_frames = np.concatenate((trajectory_frames, last_frame_id + np.arange(1, padding_length + 1))) stop = len(padded_trajectory_coordinates) - input_length + 1 for start_index in range(0, stop, input_length): stop_index = start_index + input_length input_trajectories_frames.append(padded_trajectory_frames[start_index:stop_index]) input_trajectories_coordinates.append(padded_trajectory_coordinates[start_index:stop_index, :]) return np.stack(input_trajectories_frames, axis=0), np.stack(input_trajectories_coordinates, axis=0) def collect_overlapping_trajectories(trajectory_coordinates, trajectory_frames, input_length=12, input_gap=0, pred_length=0): input_trajectories_coordinates = [] input_trajectories_frames = [] total_input_seq_len = input_length stop = len(trajectory_coordinates) - total_input_seq_len + 1 for start_index in range(0, stop): stop_index = start_index + total_input_seq_len input_trajectories_frames.append(trajectory_frames[start_index:stop_index]) input_trajectories_coordinates.append(trajectory_coordinates[start_index:stop_index, :]) return np.stack(input_trajectories_frames, axis=0), np.stack(input_trajectories_coordinates, axis=0) # def gather_test_trajectories(trajectories, trajectories_ids, input_seq_len, gap_between_frames=0, pred_seq_len=None): # """Assemble necessary trajectories into tensors for testing. # # During test time, only unique trajectories are needed for prediction. In addition, it is necessary to keep track of # which videos the trajectories come from. The number of unique trajectories depend on the values of input_seq_len, # gap_between_frames and pred_seq_len. # # WARNING: For now, this function only works correctly for gap_between_frames=0 and pred_seq_len=None. # # Argument(s): # trajectories -- A list of numpy arrays, each of shape (trajectory_length, 35). # trajectories_ids -- A list of ids for each trajectory in trajectories. # input_seq_len -- Number of input timesteps for the encoder-decoder RNN. # gap_between_frames -- Number of timesteps to skip during the encoding of adjacent timesteps. # pred_seq_len -- Number of future timesteps for the encoder-decoder RNN to predict. # # Return(s): # A dictionary containing the test tensors of each video. In addition, a second dictionary containing information # about the frame id of each trajectory is returned. # """ # encoding_trajectories = {} # encoding_frame_ids = {} # for trajectory, trajectory_id in zip(trajectories, trajectories_ids): # encoding_trajectories.setdefault(trajectory_id, []) # encoding_frame_ids.setdefault(trajectory_id, []) # padded_trajectory = pad_trajectory(trajectory, input_seq_len, gap_between_frames) # stop = len(padded_trajectory) - input_seq_len + 1 # for start_index in range(0, stop, input_seq_len): # stop_index = start_index + input_seq_len # frame_ids = padded_trajectory[start_index:stop_index, 0] # coordinates = padded_trajectory[start_index:stop_index, 1:] # encoding_trajectories[trajectory_id].append(coordindenormalise_trajectoriesates) # encoding_frame_ids[trajectory_id].append(frame_ids) # encoding_trajectories[trajectory_id] = np.stack(encoding_trajectories[trajectory_id]) # encoding_frame_ids[trajectory_id] = np.stack(encoding_frame_ids[trajectory_id]) # # return encoding_trajectories, encoding_frame_ids def pad_trajectory(trajectory_coordinates, padding_length): zeros = np.zeros((padding_length, trajectory_coordinates.shape[1]), dtype=np.float32) return np.vstack((trajectory_coordinates, zeros)) # def pad_trajectory(trajectory, input_seq_len, gap_between_frames=0): # """Append null frames to the end of trajectory. # # Argument(s): # trajectory -- A numpy array of shape (trajectory_length, 35). # input_seq_len -- Number of input timesteps for the encoder-decoder RNN. # gap_between_frames -- Number of timesteps to skip during the encoding of adjacent timesteps. # # Return(s): # The input trajectory with null frames appended to the end. # """ # last_frame_id = trajectory[-1, 0] # trajectory_length = len(trajectory) # padding_size = ((trajectory_length // input_seq_len) + 1 ) * input_seq_len - trajectory_length # # new_frame_ids = last_frame_id + np.arange(1, padding_size + 1).reshape(-1, 1) # new_coords = np.zeros((padding_size, trajectory.shape[1] - 1)) # new_trajectories = np.hstack((new_frame_ids, new_coords)) # # return np.vstack((trajectory, new_trajectories)) def shuffle_data(X, y=None, seed=None): """Shuffle the input data. Argument(s): X -- numpy array of rank >= 2 where the first axis represents the examples. y -- numpy array of rank >= 2 where the first axis represents the target values of the examples in X. seed -- integer value to seed numpy's random number generator and make the shuffle reproducible. Return(s): The input data shuffled. """ if seed is not None: np.random.seed(seed) indexes = np.random.permutation(X.shape[0]) if y is not None: return X[indexes], y[indexes] else: return X[indexes] def input2table(reconstructed_trajectory): """Convert reconstructed trajectories to original format. Argument(s): reconstructed_trajectory -- a numpy array of shape (num_unique_trajectories, input_seq_len, 34), containing the trajectory reconstructed by the Encoder-Decoder RNN. Return(s): A dictionary ... """ input_dim = reconstructed_trajectory.shape[-1] return reconstructed_trajectory.reshape(-1, input_dim) def write_trajectories(write_path, trajectories): """Write reconstructed or predicted trajectories to disk. For each video identified in trajectories' keys, a sub-directory will be created to write the .csv files containing the reconstructed or predicted trajectories of different people. Argument(s): write_path -- Root directory to write reconstructed trajectories. trajectories -- A dictionary where the keys contain the video id and the person id in the format _ and the values are numpy arrays of shape (trajectory_length, input_dim + 1). The first column contains the frame number and the other columns the x and y coordinates of each keypoint. """ for trajectory_id, trajectory in trajectories.items(): video_id, person_id = trajectory_id.split('_') video_folder_path = os.path.join(write_path, video_id) if not os.path.exists(video_folder_path): os.makedirs(video_folder_path, exist_ok=True) csv_file_path = os.path.join(video_folder_path, person_id + '.csv') np.savetxt(csv_file_path, trajectory, fmt='%.4f', delimiter=',') def load_anomaly_masks(masks_path, camera_id=None): """Load anomaly masks into memory. Argument(s): masks_path -- Path to directory containing all anomaly masks, either at the frame-level or pixel-level. camera_id -- If specified, only load the anomaly masks for this camera. Return(s): A dictionary where the file names are the keys and the values are the anomaly masks. The anomaly masks are numpy arrays of shape (num_frames,) or (num_frames, video_height, video_width), depending on the type of mask. """ file_names = os.listdir(masks_path) if camera_id is not None: file_names = [file_name for file_name in file_names if file_name.startswith(camera_id)] masks = {} for file_name in file_names: full_id = file_name.split('.')[0] file_path = os.path.join(masks_path, file_name) masks[full_id] = np.load(file_path) return masks def assemble_trajectories(trajectories_frames, trajectories_coordinates, overlapping=False, input_length=12, input_gap=0, pred_length=None): collect_fn = collect_overlapping_trajectories if overlapping else collect_test_trajectories test_trajectories_frames, test_trajectories_coordinates = {}, {} for trajectory_id, trajectory_coordinates in trajectories_coordinates.items(): frames, coordinates = collect_fn(trajectory_coordinates, trajectories_frames[trajectory_id], input_length=input_length, input_gap=input_gap, pred_length=pred_length) test_trajectories_frames[trajectory_id] = frames test_trajectories_coordinates[trajectory_id] = coordinates return test_trajectories_frames, test_trajectories_coordinates def detect_anomalous_frames(reconstruction_errors, anomaly_threshold): anomalous_frames = {} for trajectory_id, reconstruction_error in reconstruction_errors.items(): anomalous_frames[trajectory_id] = reconstruction_error > anomaly_threshold return anomalous_frames def detect_most_anomalous_or_most_normal_frames(reconstruction_errors, anomalous=True, fraction=0.2): all_errors = [reconstruction_error for _, reconstruction_error in reconstruction_errors.items()] all_errors = np.concatenate(all_errors) all_errors_sorted = np.sort(all_errors) num_frames_to_blame = round(len(all_errors_sorted) * fraction) anomalous_or_normal_frames = {} if anomalous: threshold = np.round(all_errors_sorted[-num_frames_to_blame], decimals=8) for trajectory_id, reconstruction_error in reconstruction_errors.items(): anomalous_or_normal_frames[trajectory_id] = reconstruction_error >= threshold else: threshold = np.round(all_errors_sorted[num_frames_to_blame - 1], decimals=8) for trajectory_id, reconstruction_error in reconstruction_errors.items(): anomalous_or_normal_frames[trajectory_id] = (0 < reconstruction_error) & (reconstruction_error <= threshold) return anomalous_or_normal_frames def uniquify_reconstruction(trajectory_frames, reconstructed_coordinates): """Summarise the reconstruction of repeated frames into a single one. Argument(s): trajectory_frames: A numpy array of shape (trajectory_length, input_length) containing the frames from which the skeletons in reconstructed_coordinates are from. reconstructed_coordinates: A numpy array of shape (trajectory_length, input_length, input_dim) containing the reconstructed skeletons. Return(s): A list containing two numpy arrays. The first array has shape (num_unique_frames,) and contains the ids of the frames reconstructed. The second array has shape (num_unique_frames, input_dim) and contains the mean reconstructed skeleton of each unique frame. """ trajectory_length, input_length, input_dim = reconstructed_coordinates.shape reconstructed_coordinates_reshaped = reconstructed_coordinates.reshape(-1, input_dim) trajectory_frames = trajectory_frames.astype(np.int64) trajectory_frames_reshaped = trajectory_frames.reshape(-1) unique_frames = np.unique(trajectory_frames_reshaped) unique_reconstructed_coordinates = np.empty(shape=(len(unique_frames), input_dim), dtype=np.float32) for idx, frame_id in enumerate(unique_frames): selected_reconstructions = reconstructed_coordinates_reshaped[trajectory_frames_reshaped == frame_id, :] unique_reconstructed_coordinates[idx, :] = np.mean(selected_reconstructions, axis=0) return [unique_frames, unique_reconstructed_coordinates] def uniquify_reconstructions(reconstructed_trajectories): """Summarise the reconstruction of repeated frames into a single one. Argument(s): reconstructed_trajectories: A dictionary where the keys uniquely identify each camera and the values are lists containing two items. For each list, both items are dictionaries where the keys uniquely identify each trajectory (video + person) and, for the first item, the values are numpy arrays of shape (trajectory_length, input_length) containing the frame id of each possible skeleton's trajectory, and, for the second item, the values are numpy arrays of shape (trajectory_length, input_length, input_dim) containing the reconstructed trajectories. Return(s): A dictionary where the keys uniquely identifies the cameras and the values are lists of two items. For each list, both items are dictionaries where the keys uniquely identify the trajectory (video + person) and, for the first item, the values are numpy arrays of shape (num_unique_frames,) containing the frame id of the skeleton's trajectory, and, for the second item, the values are numpy arrays of shape (num_unique_frames, input_dim) containing the mean reconstruction of the skeletons for each frame. """ for camera_id, (trajectories_frames, trajectories_coordinates) in reconstructed_trajectories.items(): for trajectory_id in trajectories_frames.keys(): frames, reconstructed_coordinates = uniquify_reconstruction(trajectories_frames[trajectory_id], trajectories_coordinates[trajectory_id]) trajectories_frames[trajectory_id] = frames trajectories_coordinates[trajectory_id] = reconstructed_coordinates reconstructed_trajectories[camera_id] = [trajectories_frames, trajectories_coordinates] return reconstructed_trajectories def discard_steps_from_padded_frames(reconstructed_trajectories, original_lengths): """Discard steps from padded frames. Argument(s): reconstructed_trajectories: A dictionary where the keys uniquely identifies the cameras and the values are lists of two items. For each list, both items are dictionaries where the keys uniquely identify the trajectory (video + person) and, for the first item, the values are numpy arrays of shape (num_unique_frames,) containing the frame id of the skeleton's trajectory, and, for the second item, the values are numpy arrays of shape (num_unique_frames, input_dim) containing the mean reconstruction of the skeletons for each frame. original_lengths: A dictionary where the keys uniquely identify the cameras and the values are dictionaries where the keys identify the trajectory (video + person) and the values are integers containing the original length of the associated trajectory. Return(s): """ for camera_id in reconstructed_trajectories.keys(): trajectories_frames, trajectories_coordinates = reconstructed_trajectories[camera_id] for trajectory_id in trajectories_frames.keys(): original_length = original_lengths[camera_id][trajectory_id] trajectories_frames[trajectory_id] = trajectories_frames[trajectory_id][:original_length] trajectories_coordinates[trajectory_id] = trajectories_coordinates[trajectory_id][:original_length] reconstructed_trajectories[camera_id] = [trajectories_frames, trajectories_coordinates] return reconstructed_trajectories def denormalise_all_trajectories(reconstructed_trajectories, video_resolution): """Bring the trajectories back to the original range. Argument(s): reconstructed_trajectories: A dictionary where the keys uniquely identifies the cameras and the values are lists of two items. For each list, both items are dictionaries where the keys uniquely identify the trajectory (video + person) and, for the first item, the values are numpy arrays of shape (num_unique_frames,) containing the frame id of the skeleton's trajectory, and, for the second item, the values are numpy arrays of shape (num_unique_frames, input_dim) containing the mean reconstruction of the skeletons for each frame. video_resolution: A list containing the video width and video height. Return(s): """ video_resolution = np.array(video_resolution, dtype=np.float32) for camera_id in reconstructed_trajectories.keys(): trajectories_frames, trajectories_coordinates = reconstructed_trajectories[camera_id] for trajectory_id in trajectories_coordinates.keys(): trajectory_coordinates = trajectories_coordinates[trajectory_id] trajectory_coordinates_normalised = trajectory_coordinates.reshape(-1, 2) * video_resolution trajectory_coordinates = trajectory_coordinates_normalised.reshape(*trajectory_coordinates.shape) trajectories_coordinates[trajectory_id] = trajectory_coordinates reconstructed_trajectories[camera_id] = [trajectories_frames, trajectories_coordinates] return reconstructed_trajectories def write_all_reconstructed_trajectories(reconstructed_trajectories, write_path): """Write all reconstructions to disk. Argument(s): reconstructed_trajectories: A dictionary where the keys uniquely identifies the cameras and the values are lists of two items. For each list, both items are dictionaries where the keys uniquely identify the trajectory (video + person) and, for the first item, the values are numpy arrays of shape (num_unique_frames,) containing the frame id of the skeleton's trajectory, and, for the second item, the values are numpy arrays of shape (num_unique_frames, input_dim) containing the mean reconstruction of the skeletons for each frame. write_path: Path to directory to save reconstructed skeletons. If not existent, a sub-directory for each camera is created and, for each camera, a sub-sub-directory is created for each video. """ for camera_id in reconstructed_trajectories.keys(): camera_path = os.path.join(write_path, camera_id) if not os.path.exists(camera_path): os.makedirs(camera_path) trajectories_frames, trajectories_coordinates = reconstructed_trajectories[camera_id] for trajectory_id in trajectories_frames.keys(): video_id, person_id = trajectory_id.split('_') video_path = os.path.join(camera_path, video_id) if not os.path.exists(video_path): os.makedirs(video_path) skeleton_file = os.path.join(video_path, person_id) + '.csv' trajectory_frames = trajectories_frames[trajectory_id].reshape(-1, 1) trajectory_coordinates = trajectories_coordinates[trajectory_id] trajectory = np.hstack((trajectory_frames, trajectory_coordinates)) np.savetxt(skeleton_file, trajectory, fmt='%.4f', delimiter=',') return None def extract_input_dim(trajectories_coordinates): random_trajectory_id = list(trajectories_coordinates.keys())[0] return trajectories_coordinates[random_trajectory_id].shape[1] def reverse_trajectories(trajectories_coordinates): trajectories_coordinates = {trajectory_id: trajectory_coordinates[:, ::-1, :] for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} return trajectories_coordinates def collect_skeletons(trajectories_frames, trajectories_coordinates): trajectories_ids = set(trajectories_coordinates.keys()) frames = [trajectories_frames[trajectory_id] for trajectory_id in trajectories_ids] frames = np.concatenate(frames) skeletons = [trajectories_coordinates[trajectory_id] for trajectory_id in trajectories_ids] skeletons = np.vstack(skeletons) non_missing_skeletons = np.sum(skeletons, axis=1) > 0.0 frames = frames[non_missing_skeletons] skeletons = skeletons[non_missing_skeletons, :] return frames, skeletons def remove_missing_skeletons(trajectories_frames, trajectories_coordinates): for trajectory_id in trajectories_frames.keys(): frames = trajectories_frames[trajectory_id] skeletons = trajectories_coordinates[trajectory_id] non_missing_skeletons = np.sum(skeletons, axis=1) > 0.0 trajectories_frames[trajectory_id] = frames[non_missing_skeletons] trajectories_coordinates[trajectory_id] = skeletons[non_missing_skeletons, :] return trajectories_frames, trajectories_coordinates def extract_center_of_mass(trajectory_coordinates): trajectory_features = np.where(trajectory_coordinates == 0.0, np.nan, trajectory_coordinates) # Left shoulder [10, 11], right shoulder [12, 13], left hip [22, 23], right hip [24, 25] selected_joints_x = [10, 12, 22, 24] selected_joints_y = [11, 13, 23, 25] trajectory_features_x = trajectory_features[:, selected_joints_x] trajectory_features_y = trajectory_features[:, selected_joints_y] center_of_mass_x = np.nanmean(trajectory_features_x, axis=1, keepdims=True) center_of_mass_y = np.nanmean(trajectory_features_y, axis=1, keepdims=True) center_of_mass = np.hstack((center_of_mass_x, center_of_mass_y)) center_of_mass = np.where(np.isnan(center_of_mass), 0.0, center_of_mass) return center_of_mass def extract_centre_of_bounding_box(trajectory_coordinates, video_resolution): bounding_box = np.apply_along_axis(compute_bounding_box, axis=1, arr=trajectory_coordinates, video_resolution=video_resolution) x = (bounding_box[:, 0] + bounding_box[:, 1]).reshape(-1, 1).astype(np.float32) / 2 y = (bounding_box[:, 2] + bounding_box[:, 3]).reshape(-1, 1).astype(np.float32) / 2 return np.hstack((x, y)) def extract_width_height(trajectory_coordinates, video_resolution): bounding_box = np.apply_along_axis(compute_bounding_box, axis=1, arr=trajectory_coordinates, video_resolution=video_resolution) width = (bounding_box[:, 1] - bounding_box[:, 0]).reshape(-1, 1).astype(np.float32) height = (bounding_box[:, 3] - bounding_box[:, 2]).reshape(-1, 1).astype(np.float32) return np.hstack((width, height)) def extract_global_features_from_trajectory(trajectory_coordinates, video_resolution): center_of_bounding_box = extract_centre_of_bounding_box(trajectory_coordinates, video_resolution=video_resolution) width_height = extract_width_height(trajectory_coordinates, video_resolution=video_resolution) trajectory_features = np.hstack((center_of_bounding_box, width_height)) return trajectory_features def extract_global_features(trajectories_coordinates, video_resolution): trajectories_features = {trajectory_id: extract_global_features_from_trajectory(trajectory_coordinates, video_resolution=video_resolution) for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} return trajectories_features def concatenate_features(global_features, local_features): features = {trajectory_id: np.concatenate((global_features[trajectory_id], local_features[trajectory_id]), axis=-1) for trajectory_id in global_features.keys()} return features def local_to_global_coordinates(reconstructed_features, video_resolution): video_resolution = np.tile(video_resolution, reps=2) reconstructed_features_global = {} for camera_id, (trajectories_frames, trajectories_features) in reconstructed_features.items(): trajectories_features_global = {} for trajectory_id in trajectories_frames.keys(): trajectory_features = trajectories_features[trajectory_id] input_examples, input_length, input_dim = trajectory_features.shape global_features = trajectory_features.reshape(-1, input_dim)[:, :4] * video_resolution local_features = trajectory_features.reshape(-1, input_dim)[:, 4:] reps = local_features.shape[1] // 2 global_trajectory = local_features * np.tile(global_features[:, -2:], reps=reps) # global_trajectory += np.tile(global_features[:, :2] - global_features[:, -2:] / 2, reps=reps) global_trajectory += np.tile(global_features[:, :2], reps=reps) trajectories_features_global[trajectory_id] = global_trajectory.reshape(input_examples, input_length, input_dim - 4) reconstructed_features_global[camera_id] = [deepcopy(trajectories_frames), trajectories_features_global] return reconstructed_features_global def discard_global_features(reconstructed_features): reconstructed_features_local = {} for camera_id, (trajectories_frames, trajectories_features) in reconstructed_features.items(): trajectories_features_local = {} for trajectory_id in trajectories_frames.keys(): trajectory_features = trajectories_features[trajectory_id] trajectories_features_local[trajectory_id] = trajectory_features[:, :, 4:] reconstructed_features_local[camera_id] = trajectories_features_local return reconstructed_features_local class StdScaler: def __init__(self, stds=3): self.stds = stds self.mu = None self.sigma = None def fit(self, X): self.mu = np.nanmean(X, axis=0, keepdims=True) self.sigma = np.nanstd(X, axis=0, keepdims=True) def transform(self, X): reps = [X.shape[0], 1] mu = np.tile(self.mu, reps=reps) sigma = np.tile(self.sigma, reps=reps) X = (X - (mu - self.stds * sigma)) / (2 * self.stds * sigma) return X def inverse_transform(self, X): reps = [X.shape[0], 1] mu = np.tile(self.mu, reps=reps) sigma = np.tile(self.sigma, reps=reps) X = X * (2 * self.stds * sigma) + (mu - self.stds * sigma) return X def scale_trajectories_three_stds(trajectories_coordinates, scaler=None): """Scale features to within three standard deviations. Argument(s): trajectories_coordinates -- A dictionary of numpy arrays, each of shape (trajectory_length, input_dim). scaler - If None, a scaler is trained on the input data; otherwise, the scaler is used to scale the input data. Return(s): The input data scaled between three standard deviations range. """ if scaler is None: trajectories = [trajectory_coordinates for trajectory_coordinates in trajectories_coordinates.values()] trajectories = np.vstack(trajectories) trajectories = np.where(trajectories == 0.0, np.nan, trajectories) scaler = StdScaler(stds=3) scaler.fit(trajectories) trajectories_scaled = {} for trajectory_id, trajectory_coordinates in trajectories_coordinates.items(): trajectory_scaled = scaler.transform(np.where(trajectory_coordinates == 0.0, np.nan, trajectory_coordinates)) trajectory_scaled = np.where(np.isnan(trajectory_scaled), 0.0, trajectory_scaled) trajectories_scaled[trajectory_id] = trajectory_scaled return trajectories_scaled, scaler def scale_trajectories_zero_one(trajectories_coordinates, scaler=None): """Scale features to the 0-1 range. Argument(s): trajectories_coordinates -- A dictionary of numpy arrays, each of shape (trajectory_length, input_dim). scaler - If None, a scaler is trained on the input data; otherwise, the scaler is used to scale the input data. Return(s): The input data scaled to the 0-1 range. """ if scaler is None: trajectories = [trajectory_coordinates for trajectory_coordinates in trajectories_coordinates.values()] trajectories = np.vstack(trajectories) trajectories = np.where(trajectories == 0.0, np.nan, trajectories) trajectories_min = np.nanmin(trajectories, axis=0, keepdims=True) trajectories_min = np.where(np.isnan(trajectories_min), 0.0, trajectories_min) trajectories_min = np.tile(trajectories_min, reps=[trajectories.shape[0], 1]) eps = 0.001 trajectories = np.where(np.isnan(trajectories), trajectories_min - eps, trajectories) scaler = MinMaxScaler(feature_range=(0, 1)) scaler.fit(trajectories) trajectories_scaled = {} for trajectory_id, trajectory_coordinates in trajectories_coordinates.items(): num_examples = trajectory_coordinates.shape[0] trajectory_scaled = scaler.transform(np.where(trajectory_coordinates == 0.0, np.tile(scaler.data_min_, reps=[num_examples, 1]), trajectory_coordinates)) trajectories_scaled[trajectory_id] = trajectory_scaled return trajectories_scaled, scaler def scale_trajectories(trajectories_coordinates, scaler=None, strategy='zero_one'): if strategy == 'zero_one': trajectories_scaled, scaler = scale_trajectories_zero_one(trajectories_coordinates, scaler=scaler) elif strategy == 'three_stds': trajectories_scaled, scaler = scale_trajectories_three_stds(trajectories_coordinates, scaler=scaler) else: raise ValueError('Unknown strategy. Please select either zero_one or three_stds.') return trajectories_scaled, scaler def inverse_scale_trajectories(reconstructed_trajectories, global_scaler, local_scaler): rescaled_trajectories = {} for trajectory_id, trajectory_coordinates in reconstructed_trajectories.items(): num_trajectories, input_length, input_dim = trajectory_coordinates.shape trajectory_coordinates = trajectory_coordinates.reshape(-1, input_dim) trajectory_coordinates[:, :4] = global_scaler.inverse_transform(trajectory_coordinates[:, :4]) trajectory_coordinates[:, 4:] = local_scaler.inverse_transform(trajectory_coordinates[:, 4:]) trajectory_coordinates = trajectory_coordinates.reshape(num_trajectories, input_length, input_dim) rescaled_trajectories[trajectory_id] = trajectory_coordinates return rescaled_trajectories def inverse_single_scale_trajectories(reconstructed_trajectories, scaler): rescaled_trajectories = {} for trajectory_id, trajectory_coordinates in reconstructed_trajectories.items(): shape, input_dim = trajectory_coordinates.shape, trajectory_coordinates.shape[-1] trajectory_coordinates = trajectory_coordinates.reshape(-1, input_dim) trajectory_coordinates = scaler.inverse_transform(trajectory_coordinates) trajectory_coordinates = trajectory_coordinates.reshape(shape) rescaled_trajectories[trajectory_id] = trajectory_coordinates return rescaled_trajectories def _train_test_split_through_time(trajectory_id, trajectory_coordinates, input_length, pred_length, train_ratio=0.8): test_ratio = 1 - train_ratio trajectory_length = trajectory_coordinates.shape[0] test_slice_length = int(trajectory_length * test_ratio) if test_slice_length < input_length + pred_length: return {}, {trajectory_id: trajectory_coordinates} start_idx = np.random.randint(0, trajectory_length) end_idx = start_idx + test_slice_length if start_idx < input_length + pred_length: train = {trajectory_id: trajectory_coordinates[test_slice_length:, :]} test = {trajectory_id: trajectory_coordinates[:test_slice_length, :]} elif end_idx <= trajectory_length - 1 - input_length - pred_length: train = {trajectory_id + '_1': trajectory_coordinates[:start_idx, :], trajectory_id + '_2': trajectory_coordinates[end_idx:, :]} test = {trajectory_id: trajectory_coordinates[start_idx:end_idx, :]} else: train = {trajectory_id: trajectory_coordinates[:-test_slice_length, :]} test = {trajectory_id: trajectory_coordinates[-test_slice_length:, :]} return train, test def train_test_split_through_time(trajectories_coordinates, input_length, pred_length, train_ratio=0.8, seed=42): """Bla Bla. Argument(s): trajectories_coordinates -- A dictionary of numpy arrays, each of shape (trajectory_length, input_dim). input_length -- pred_length -- train_ratio -- Return(s): """ np.random.seed(seed) trajectories_coordinates_train = {} trajectories_coordinates_test = {} for trajectory_id, trajectory_coordinates in trajectories_coordinates.items(): train, test = _train_test_split_through_time(trajectory_id, trajectory_coordinates, input_length, pred_length, train_ratio) trajectories_coordinates_train.update(train) trajectories_coordinates_test.update(test) return trajectories_coordinates_train, trajectories_coordinates_test def train_test_split_trajectories(trajectories_frames, trajectories_coordinates, train_ratio=0.8, seed=42): np.random.seed(seed) trajectories_frames_train, trajectories_coordinates_train = {}, {} trajectories_frames_test, trajectories_coordinates_test = {}, {} for trajectory_id, trajectory_coordinates in trajectories_coordinates.items(): trajectory_length = trajectory_coordinates.shape[0] if trajectory_length == 1: trajectories_frames_test[trajectory_id] = trajectories_frames[trajectory_id] trajectories_coordinates_test[trajectory_id] = trajectory_coordinates[:1, :] continue train_size = int(train_ratio * trajectory_length) indices = np.random.permutation(trajectory_length) train_indices = indices[:train_size] test_indices = indices[train_size:] trajectories_frames_train[trajectory_id] = trajectories_frames[trajectory_id][train_indices] trajectories_coordinates_train[trajectory_id] = trajectory_coordinates[train_indices, :] trajectories_frames_test[trajectory_id] = trajectories_frames[trajectory_id][test_indices] trajectories_coordinates_test[trajectory_id] = trajectory_coordinates[test_indices, :] return trajectories_frames_train, trajectories_frames_test, \ trajectories_coordinates_train, trajectories_coordinates_test def pull_global_features(all_reconstructed_features): for camera_id, (trajectories_frames, trajectories_features) in all_reconstructed_features.items(): for trajectory_id, trajectory_features in trajectories_features.items(): trajectories_features[trajectory_id] = trajectory_features[..., :4] all_reconstructed_features[camera_id] = [trajectories_frames, trajectories_features] return all_reconstructed_features def compute_bounding_boxes_from_global_features(all_reconstructed_features): all_bounding_boxes = {} for camera_id, (trajectories_frames, trajectories_features) in all_reconstructed_features.items(): bounding_boxes = {} for trajectory_id, trajectory_features in trajectories_features.items(): x, y, w, h = np.hsplit(trajectory_features, indices_or_sections=4) left, right, top, bottom = x - w / 2, x + w / 2, y - h / 2, y + h / 2 bounding_boxes[trajectory_id] = np.round(np.hstack((left, right, top, bottom)), decimals=2).astype(np.int32) all_bounding_boxes[camera_id] = [trajectories_frames, bounding_boxes] return all_bounding_boxes def compute_bounding_boxes_from_image_features(all_reconstructed_trajectories, video_resolution): all_bounding_boxes = {} for camera_id, (trajectories_frames, trajectories_features) in all_reconstructed_trajectories.items(): bounding_boxes = {} for trajectory_id, trajectory_features in trajectories_features.items(): bounding_box = np.apply_along_axis(compute_bounding_box, axis=1, arr=trajectory_features, video_resolution=video_resolution) bounding_boxes[trajectory_id] = bounding_box all_bounding_boxes[camera_id] = [trajectories_frames, bounding_boxes] return all_bounding_boxes def change_coordinate_system(trajectories_coordinates, video_resolution, coordinate_system='global', invert=False): if invert: if coordinate_system == 'global': trajectories_coordinates = from_global_to_image(trajectories_coordinates, video_resolution=video_resolution) else: raise ValueError('Unknown coordinate system. Only global is available for inversion.') else: if coordinate_system == 'global': trajectories_coordinates = from_image_to_global(trajectories_coordinates, video_resolution=video_resolution) elif coordinate_system == 'bounding_box_top_left': trajectories_coordinates = from_image_to_bounding_box(trajectories_coordinates, video_resolution=video_resolution, location='top_left') elif coordinate_system == 'bounding_box_centre': trajectories_coordinates = from_image_to_bounding_box(trajectories_coordinates, video_resolution=video_resolution, location='centre') else: raise ValueError('Unknown coordinate system. Please select one of: global, bounding_box_top_left, or ' 'bounding_box_centre.') return trajectories_coordinates def from_image_to_global(trajectories_coordinates, video_resolution): for trajectory_id, trajectory_coordinates in trajectories_coordinates.items(): trajectory_shape = trajectory_coordinates.shape trajectory_coordinates = trajectory_coordinates.reshape(-1, 2) / video_resolution trajectories_coordinates[trajectory_id] = trajectory_coordinates.reshape(trajectory_shape) return trajectories_coordinates def from_global_to_image(trajectories_coordinates, video_resolution): for trajectory_id, trajectory_coordinates in trajectories_coordinates.items(): trajectory_shape = trajectory_coordinates.shape trajectory_coordinates = trajectory_coordinates.reshape(-1, 2) * video_resolution trajectories_coordinates[trajectory_id] = trajectory_coordinates.reshape(trajectory_shape) return trajectories_coordinates def from_global_to_image_all_cameras(all_reconstructed_trajectories, video_resolution): for camera_id, (trajectories_frames, trajectories_features) in all_reconstructed_trajectories.items(): all_reconstructed_trajectories[camera_id] = [trajectories_frames, from_global_to_image(trajectories_features, video_resolution)] return all_reconstructed_trajectories def from_image_to_bounding_box(trajectories_coordinates, video_resolution, location='top_left'): if location == 'top_left': fn = from_image_to_top_left_bounding_box elif location == 'centre': fn = from_image_to_centre_bounding_box else: raise ValueError('Unknown location for the bounding box. Please select either top_left or centre.') trajectories_coordinates = {trajectory_id: fn(trajectory_coordinates, video_resolution=video_resolution) for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} return trajectories_coordinates def from_image_to_top_left_bounding_box(trajectory_coordinates, video_resolution): for idx, coordinates in enumerate(trajectory_coordinates): if any(coordinates): left, right, top, bottom = compute_bounding_box(coordinates, video_resolution=video_resolution) xs, ys = np.hsplit(coordinates.reshape(-1, 2), indices_or_sections=2) xs, ys = np.where(xs == 0.0, float(left), xs), np.where(ys == 0.0, float(top), ys) xs, ys = (xs - left) / (right - left), (ys - top) / (bottom - top) coordinates = np.hstack((xs, ys)).ravel() trajectory_coordinates[idx] = coordinates return trajectory_coordinates def from_image_to_centre_bounding_box(trajectory_coordinates, video_resolution): for idx, coordinates in enumerate(trajectory_coordinates): if any(coordinates): left, right, top, bottom = compute_bounding_box(coordinates, video_resolution=video_resolution) centre_x, centre_y = (left + right) / 2, (top + bottom) / 2 xs, ys = np.hsplit(coordinates.reshape(-1, 2), indices_or_sections=2) xs, ys = np.where(xs == 0.0, centre_x, xs) - centre_x, np.where(ys == 0.0, centre_y, ys) - centre_y left, right, top, bottom = left - centre_x, right - centre_x, top - centre_y, bottom - centre_y width, height = right - left, bottom - top xs, ys = np.where(xs != 0.0, xs / width, xs), np.where(ys != 0.0, ys / height, ys) coordinates = np.hstack((xs, ys)).ravel() trajectory_coordinates[idx] = coordinates return trajectory_coordinates def compute_worst_mistakes(y_true, y_hat, video_ids, type='false_positives', top=10): # sorting_indices = np.argsort(y_hat) frames = generate_array_of_frames(video_ids) video_ids = np.array(video_ids) if type == 'false_positives': true_negatives = y_true == 0 y_hat_ = y_hat[true_negatives] video_ids_ = video_ids[true_negatives] frames_ = frames[true_negatives] sorting_indices = np.argsort(y_hat_) indices = sorting_indices[-top:] elif type == 'false_negatives': true_positives = y_true == 1 y_hat_ = y_hat[true_positives] video_ids_ = video_ids[true_positives] frames_ = frames[true_positives] sorting_indices = np.argsort(y_hat_) indices = sorting_indices[:top] else: raise ValueError('Unknown mistake type. Please choose either false_positives or false_negatives.') return video_ids_[indices], frames_[indices], y_hat_[indices] def generate_array_of_frames(x): """x is already sorted.""" _, counts = np.unique(x, return_counts=True) result = [] for count in counts: result.append(np.arange(count)) return np.concatenate(result) def write_all_worst_mistakes(all_pretrained_models_path, worst_false_positives, worst_false_negatives): file_path = os.path.join(all_pretrained_models_path, 'mistakes.txt') camera_ids = sorted(worst_false_positives.keys()) with open(file_path, mode='w') as file: for camera_id in camera_ids: print('\nCamera ID: %s' % camera_id, file=file) print('\nWorst False Positives:', file=file) video_ids, frames, scores = worst_false_positives[camera_id] for video_id, frame, score in zip(video_ids[::-1], frames[::-1], scores[::-1]): print('Video ID: %s\tFrame: %d\tRec. Error: %.4f' % (video_id, frame, score), file=file) print('\nWorst False Negatives:', file=file) video_ids, frames, scores = worst_false_negatives[camera_id] for video_id, frame, score in zip(video_ids, frames, scores): print('Video ID: %s\tFrame: %d\tRec. Error: %.4f' % (video_id, frame, score), file=file) return None ================================================ FILE: tbad/eval.py ================================================ from copy import deepcopy import os import numpy as np from sklearn.metrics import roc_auc_score, average_precision_score from tbad.data import load_trajectories, remove_short_trajectories, input_trajectories_missing_steps from tbad.data import assemble_trajectories, reverse_trajectories, load_anomaly_masks from tbad.data import uniquify_reconstructions, discard_steps_from_padded_frames from tbad.data import write_all_reconstructed_trajectories, remove_missing_skeletons, extract_global_features from tbad.data import concatenate_features, local_to_global_coordinates, scale_trajectories, inverse_scale_trajectories from tbad.data import pull_global_features, compute_bounding_boxes_from_global_features, change_coordinate_system from tbad.data import from_global_to_image_all_cameras, inverse_single_scale_trajectories from tbad.data import compute_worst_mistakes, write_all_worst_mistakes from tbad.rnn_autoencoder.rnn import load_pretrained_rnn_ae, reconstruct_trajectories from tbad.autoencoder.autoencoder import load_ae_pretrained_models, compute_ae_reconstruction_errors from tbad.autoencoder.autoencoder import reconstruct_skeletons from tbad.combined_model.fusion import load_complete_rnn_ae_pretrained_models from tbad.utils import select_scaler_model from utils.metrics import compute_reconstruction_errors, summarise_reconstruction_errors from utils.metrics import discard_errors_from_padded_frames, ground_truth_and_reconstructions def eval_ae_models(args): # General video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) all_trajectories_path = args.trajectories all_pretrained_models_path = args.pretrained_models # e.g. .../adam_bb-tl_mse frame_level_anomaly_masks_path = args.frame_level_anomaly_masks # Extract information about the models data_type = 'training' if 'training' in all_trajectories_path else 'testing' model_info = os.path.basename(all_pretrained_models_path) if 'bb-tl' in model_info: coordinate_system = 'bounding_box_top_left' elif 'bb-c' in model_info: coordinate_system = 'bounding_box_centre' else: coordinate_system = 'global' normalisation_strategy = 'three_stds' if '3stds' in model_info else 'zero_one' global_model = 'gm' in model_info pretrained_models, scalers = load_ae_pretrained_models(all_pretrained_models_path) camera_ids = set(pretrained_models.keys()) skeletons = {} for camera_id in camera_ids: trajectories_path = os.path.join(all_trajectories_path, camera_id) trajectories_frames, trajectories_coordinates = load_trajectories(trajectories_path) if global_model: trajectories_coordinates = extract_global_features(trajectories_coordinates, video_resolution=video_resolution) coordinate_system = 'global' trajectories_coordinates = change_coordinate_system(trajectories_coordinates, video_resolution=video_resolution, coordinate_system=coordinate_system, invert=False) trajectories_coordinates, _ = scale_trajectories(trajectories_coordinates, scaler=scalers[camera_id], strategy=normalisation_strategy) trajectories_frames, trajectories_coordinates = remove_missing_skeletons(trajectories_frames, trajectories_coordinates) skeletons[camera_id] = [trajectories_frames, trajectories_coordinates] all_anomaly_masks, all_reconstruction_errors = [], [] aurocs, auprs = {}, {} for camera_id in sorted(camera_ids): anomaly_model = pretrained_models[camera_id] trajectories_frames, trajectories_coordinates = skeletons[camera_id] trajectories_coordinates_reconstructed = reconstruct_skeletons(anomaly_model, trajectories_coordinates) reconstruction_errors = compute_ae_reconstruction_errors(trajectories_coordinates, trajectories_coordinates_reconstructed, loss=anomaly_model.loss) anomaly_masks = load_anomaly_masks(frame_level_anomaly_masks_path, camera_id=camera_id) y_true, y_hat = ground_truth_and_reconstructions(anomaly_masks, reconstruction_errors, trajectories_frames) if data_type == 'training': # This hack is necessary because the training set has no anomalies y_true[0] = 1 aurocs[camera_id], auprs[camera_id] = roc_auc_score(y_true, y_hat), average_precision_score(y_true, y_hat) all_anomaly_masks.append(y_true) all_reconstruction_errors.append(y_hat) # Dump the reconstruction errors for computation of the AUROC/AUPR across all cameras reconstruction_errors_save_path = os.path.join(all_pretrained_models_path, data_type + '_reconstruction_errors') np.savez(reconstruction_errors_save_path, *all_reconstruction_errors) all_anomaly_masks = np.concatenate(all_anomaly_masks) anomaly_masks_save_path = os.path.join(all_pretrained_models_path, 'anomaly_masks.npy') if not os.path.exists(anomaly_masks_save_path) and data_type == 'testing': np.save(file=anomaly_masks_save_path[:-4], arr=all_anomaly_masks) for camera_id in sorted(aurocs.keys()): print('\nAUROC for camera %s: %.4f' % (camera_id, aurocs[camera_id])) print('AUPR for camera %s: %.4f' % (camera_id, auprs[camera_id])) return None def eval_rnn_ae_models(args): # General video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) all_trajectories_path = args.trajectories all_pretrained_models_path = args.pretrained_models # e.g. .../16_0_2_rrs_bb-c_3stds_mse frame_level_anomaly_masks_path = args.frame_level_anomaly_masks # Extract information about the models data_type = 'training' if 'training' in all_trajectories_path else 'testing' model_info = os.path.basename(all_pretrained_models_path) global_model = 'gm' in model_info reconstruct_reverse = 'rrs' in model_info input_missing = 'ims' in model_info # input_missing = False if 'bb-tl' in model_info: coordinate_system = 'bounding_box_top_left' elif 'bb-c' in model_info: coordinate_system = 'bounding_box_centre' else: coordinate_system = 'global' normalisation_strategy = 'three_stds' if '3stds' in model_info else 'zero_one' model_info = model_info.split('_') input_length, input_gap, pred_length = int(model_info[0]), int(model_info[1]), int(model_info[2]) # A dictionary where the keys are the ids of the cameras and the values are the pre-trained models camera_ids = set() pretrained_models = {} scalers = {} for pretrained_model_name in os.listdir(all_pretrained_models_path): if pretrained_model_name.endswith('.npy') or pretrained_model_name.endswith('.npz'): continue camera_id = pretrained_model_name.split('_')[0] camera_ids.add(camera_id) pretrained_model_path = os.path.join(all_pretrained_models_path, pretrained_model_name) pretrained_models[camera_id], scalers[camera_id] = load_pretrained_rnn_ae(pretrained_model_path) # A dictionary where the keys are the ids of the cameras and the values are lists containing the trajectory's # frames and trajectory's coordinates trajectories = {} for camera_id in camera_ids: trajectories_path = os.path.join(all_trajectories_path, camera_id) trajectories_frames, trajectories_coordinates = load_trajectories(trajectories_path) # Remove short trajectories trajectories_coordinates = remove_short_trajectories(trajectories_coordinates, input_length=input_length, input_gap=input_gap, pred_length=pred_length) for trajectory_id in set(trajectories_frames.keys()): if trajectory_id not in trajectories_coordinates.keys(): del trajectories_frames[trajectory_id] # Input missing steps (optional) if input_missing: trajectories_coordinates = input_trajectories_missing_steps(trajectories_coordinates) if global_model: trajectories_coordinates = extract_global_features(trajectories_coordinates, video_resolution=video_resolution) coordinate_system = 'global' trajectories_coordinates = change_coordinate_system(trajectories_coordinates, video_resolution=video_resolution, coordinate_system=coordinate_system, invert=False) trajectories_coordinates, _ = scale_trajectories(trajectories_coordinates, scaler=scalers[camera_id], strategy=normalisation_strategy) trajectories[camera_id] = [trajectories_frames, trajectories_coordinates] all_anomaly_masks = [] all_reconstruction_errors = [] all_reconstructed_trajectories = {} all_original_lengths = {} aurocs, auprs = {}, {} for camera_id in sorted(camera_ids): anomaly_model = pretrained_models[camera_id] scaler = scalers[camera_id] trajectories_frames, trajectories_coordinates = trajectories[camera_id] original_lengths = {trajectory_id: len(trajectory_coordinates) for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} all_original_lengths[camera_id] = original_lengths test_frames, test_coordinates = assemble_trajectories(trajectories_frames, trajectories_coordinates, overlapping=args.overlapping_trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length) reconstructed_coordinates = reconstruct_trajectories(anomaly_model, test_coordinates) if reconstruct_reverse: reconstructed_coordinates = reverse_trajectories(reconstructed_coordinates) reconstruction_errors = compute_reconstruction_errors(test_coordinates, reconstructed_coordinates, loss=anomaly_model.loss) reconstruction_errors = summarise_reconstruction_errors(reconstruction_errors, test_frames) reconstruction_errors = discard_errors_from_padded_frames(reconstruction_errors, original_lengths) reconstructed_coordinates = inverse_single_scale_trajectories(reconstructed_coordinates, scaler=scaler) all_reconstructed_trajectories[camera_id] = [test_frames, reconstructed_coordinates] anomaly_masks = load_anomaly_masks(frame_level_anomaly_masks_path, camera_id=camera_id) y_true, y_hat, _ = ground_truth_and_reconstructions(anomaly_masks, reconstruction_errors, trajectories_frames) if data_type == 'training': # This hack is necessary because the training set has no anomalies y_true[0] = 1 aurocs[camera_id], auprs[camera_id] = roc_auc_score(y_true, y_hat), average_precision_score(y_true, y_hat) all_anomaly_masks.append(y_true) all_reconstruction_errors.append(y_hat) # Dump the reconstruction errors for computation of the AUROC across all cameras reconstruction_errors_save_path = os.path.join(all_pretrained_models_path, data_type + '_reconstruction_errors') np.savez(reconstruction_errors_save_path, *all_reconstruction_errors) all_anomaly_masks = np.concatenate(all_anomaly_masks) anomaly_masks_save_path = os.path.join(all_pretrained_models_path, 'anomaly_masks.npy') if not os.path.exists(anomaly_masks_save_path) and data_type == 'testing': np.save(file=anomaly_masks_save_path[:-4], arr=all_anomaly_masks) for camera_id in sorted(aurocs.keys()): print('\nAUROC for camera %s: %.4f' % (camera_id, aurocs[camera_id])) print('AUPR for camera %s: %.4f' % (camera_id, auprs[camera_id])) if args.write_reconstructions is not None and not global_model: all_reconstructed_trajectories = uniquify_reconstructions(all_reconstructed_trajectories) all_reconstructed_trajectories = discard_steps_from_padded_frames(all_reconstructed_trajectories, all_original_lengths) all_reconstructed_trajectories = from_global_to_image_all_cameras(all_reconstructed_trajectories, video_resolution=video_resolution) write_all_reconstructed_trajectories(all_reconstructed_trajectories, write_path=args.write_reconstructions) print('All reconstructed trajectories were written to %s.' % args.write_reconstructions) return None def eval_complete_rnn_ae_models(args): # Extract command line arguments video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) all_trajectories_path = args.trajectories all_pretrained_models_path = args.pretrained_models # e.g. .../16_0_2_rrs_mse frame_level_anomaly_masks_path = args.frame_level_anomaly_masks overlapping_trajectories = args.overlapping_trajectories # Extract information about the models data_type = 'training' if 'training' in all_trajectories_path else 'testing' model_info = os.path.basename(all_pretrained_models_path) reconstruct_reverse = 'rrs' in model_info global_normalisation_strategy = 'three_stds' if 'G3stds' in model_info else 'zero_one' local_normalisation_strategy = 'three_stds' if 'L3stds' in model_info else 'zero_one' # input_missing = 'ims' in model_info # input_missing = False model_info = model_info.split('_') input_length, input_gap, pred_length = int(model_info[0]), int(model_info[1]), int(model_info[2]) # A dictionary where the keys are the ids of the cameras and the values are the pre-trained models pretrained_models, global_scalers, local_scalers = \ load_complete_rnn_ae_pretrained_models(all_pretrained_models_path) camera_ids = set(pretrained_models.keys()) trajectories = {} for camera_id in camera_ids: trajectories_path = os.path.join(all_trajectories_path, camera_id) trajectories_frames, trajectories_coordinates = load_trajectories(trajectories_path) trajectories_coordinates = remove_short_trajectories(trajectories_coordinates, input_length=input_length, input_gap=input_gap, pred_length=pred_length) for trajectory_id in set(trajectories_frames.keys()): if trajectory_id not in trajectories_coordinates.keys(): del trajectories_frames[trajectory_id] global_features = extract_global_features(trajectories_coordinates, video_resolution=video_resolution) global_features = change_coordinate_system(global_features, video_resolution=video_resolution, coordinate_system='global', invert=False) global_features, _ = scale_trajectories(global_features, scaler=global_scalers[camera_id], strategy=global_normalisation_strategy) local_features = deepcopy(trajectories_coordinates) local_features = change_coordinate_system(local_features, video_resolution=video_resolution, coordinate_system='bounding_box_centre', invert=False) local_features, _ = scale_trajectories(local_features, scaler=local_scalers[camera_id], strategy=local_normalisation_strategy) # out_features = trajectories_coordinates # out_features = change_coordinate_system(out_features, video_resolution=video_resolution, # coordinate_system='global', invert=False) # # trajectories[camera_id] = [trajectories_frames, global_features, local_features, out_features] trajectories[camera_id] = [trajectories_frames, global_features, local_features] all_anomaly_masks = [] all_reconstruction_errors = [] all_reconstructed_trajectories = {} all_original_lengths = {} aurocs, auprs = {}, {} worst_false_positives, worst_false_negatives = {}, {} for camera_id in sorted(camera_ids): anomaly_model = pretrained_models[camera_id] global_scaler = global_scalers[camera_id] local_scaler = local_scalers[camera_id] # trajectories_frames, global_features, local_features, out_features = trajectories[camera_id] trajectories_frames, global_features, local_features = trajectories[camera_id] original_lengths = {trajectory_id: len(trajectory_coordinates) for trajectory_id, trajectory_coordinates in local_features.items()} all_original_lengths[camera_id] = original_lengths test_frames, global_features_test = assemble_trajectories(trajectories_frames, global_features, overlapping=overlapping_trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length) _, local_features_test = assemble_trajectories(trajectories_frames, local_features, overlapping=overlapping_trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length) # _, out_features_test = assemble_trajectories(trajectories_frames, out_features, # overlapping=overlapping_trajectories, # input_length=input_length, # input_gap=input_gap, # pred_length=pred_length) features_test = concatenate_features(global_features_test, local_features_test) reconstructed_features = anomaly_model.reconstruct(global_features_test, local_features_test) if reconstruct_reverse: reconstructed_features = reverse_trajectories(reconstructed_features) # reconstruction_errors = compute_reconstruction_errors(out_features_test, reconstructed_features, # loss=anomaly_model.loss) reconstruction_errors = compute_reconstruction_errors(features_test, reconstructed_features, loss=anomaly_model.loss) reconstruction_errors = summarise_reconstruction_errors(reconstruction_errors, test_frames) reconstruction_errors = discard_errors_from_padded_frames(reconstruction_errors, original_lengths) reconstructed_features = inverse_scale_trajectories(reconstructed_features, global_scaler=global_scaler, local_scaler=local_scaler) # reconstructed_features = from_global_to_image(reconstructed_features, video_resolution=video_resolution) all_reconstructed_trajectories[camera_id] = [test_frames, reconstructed_features] anomaly_masks = load_anomaly_masks(frame_level_anomaly_masks_path, camera_id=camera_id) y_true, y_hat, video_ids = ground_truth_and_reconstructions(anomaly_masks, reconstruction_errors, trajectories_frames) worst_false_positives[camera_id] = compute_worst_mistakes(y_true, y_hat, video_ids, type='false_positives', top=10) worst_false_negatives[camera_id] = compute_worst_mistakes(y_true, y_hat, video_ids, type='false_negatives', top=10) if data_type == 'training': # This hack is necessary because the training set has no anomalies y_true[0] = 1 aurocs[camera_id], auprs[camera_id] = roc_auc_score(y_true, y_hat), average_precision_score(y_true, y_hat) all_anomaly_masks.append(y_true) all_reconstruction_errors.append(y_hat) # Dump the reconstruction errors for computation of the AUROC across all cameras reconstruction_errors_save_path = os.path.join(all_pretrained_models_path, data_type + '_reconstruction_errors') np.savez(reconstruction_errors_save_path, *all_reconstruction_errors) all_anomaly_masks = np.concatenate(all_anomaly_masks) anomaly_masks_save_path = os.path.join(all_pretrained_models_path, 'anomaly_masks.npy') if data_type == 'testing': np.save(file=anomaly_masks_save_path[:-4], arr=all_anomaly_masks) for camera_id in sorted(aurocs.keys()): print('\nAUROC for camera %s: %.4f' % (camera_id, aurocs[camera_id])) print('AUPR for camera %s: %.4f' % (camera_id, auprs[camera_id])) # Dump the worst mistakes in a .txt file if data_type == 'testing': write_all_worst_mistakes(all_pretrained_models_path, worst_false_positives, worst_false_negatives) print('All mistakes were written to %s.' % os.path.join(all_pretrained_models_path, 'mistakes.txt')) if args.write_reconstructions is not None: all_image_trajectories = local_to_global_coordinates(all_reconstructed_trajectories, video_resolution=video_resolution) # all_image_trajectories = deepcopy(all_reconstructed_trajectories) all_image_trajectories = uniquify_reconstructions(all_image_trajectories) all_image_trajectories = discard_steps_from_padded_frames(all_image_trajectories, all_original_lengths) write_all_reconstructed_trajectories(all_image_trajectories, write_path=args.write_reconstructions) print('All reconstructed trajectories were written to %s.' % args.write_reconstructions) if args.write_bounding_boxes is not None: all_reconstructed_trajectories = uniquify_reconstructions(all_reconstructed_trajectories) all_reconstructed_trajectories = discard_steps_from_padded_frames(all_reconstructed_trajectories, all_original_lengths) all_reconstructed_trajectories = pull_global_features(all_reconstructed_trajectories) all_reconstructed_trajectories = from_global_to_image_all_cameras(all_reconstructed_trajectories, video_resolution=video_resolution) all_bounding_boxes = compute_bounding_boxes_from_global_features(all_reconstructed_trajectories) # all_bounding_boxes = compute_bounding_boxes_from_image_features(all_reconstructed_trajectories, # video_resolution=video_resolution) write_all_reconstructed_trajectories(all_bounding_boxes, write_path=args.write_bounding_boxes) print('All reconstructed bounding boxes were written to %s.' % args.write_bounding_boxes) return None def compute_all_cameras_performance_metrics(args): all_reconstruction_errors_path = args.reconstruction_errors_path train_with_nonzero_scores_only = args.train_with_nonzero_scores_only ignore_training = args.ignore_training ignore_scaler = args.ignore_scaler scaler_model = args.scaler_model all_anomaly_masks_file = os.path.join(all_reconstruction_errors_path, 'anomaly_masks.npy') all_anomaly_masks = np.load(all_anomaly_masks_file) training_reconstruction_errors_file = os.path.join(all_reconstruction_errors_path, 'training_reconstruction_errors.npz') training_reconstruction_errors = np.load(training_reconstruction_errors_file) testing_reconstruction_errors_file = os.path.join(all_reconstruction_errors_path, 'testing_reconstruction_errors.npz') testing_reconstruction_errors = np.load(testing_reconstruction_errors_file) all_testing_scores = [] for camera_id in range(len(training_reconstruction_errors.files)): training_scores = training_reconstruction_errors['arr_%d' % camera_id] testing_scores = testing_reconstruction_errors['arr_%d' % camera_id] if not ignore_scaler: score_scaler_model = select_scaler_model(scaler_model) if train_with_nonzero_scores_only: is_non_zero_training_score = training_scores > 0.0 non_zero_training_scores = training_scores[is_non_zero_training_score].reshape(-1, 1) is_non_zero_testing_score = testing_scores > 0.0 non_zero_testing_scores = testing_scores[is_non_zero_testing_score].reshape(-1, 1) if ignore_training: score_scaler_model.fit(non_zero_testing_scores) else: score_scaler_model.fit(non_zero_training_scores) testing_scores[is_non_zero_testing_score] = score_scaler_model.transform(non_zero_testing_scores).ravel() else: if ignore_training: score_scaler_model.fit(testing_scores.reshape(-1, 1)) else: score_scaler_model.fit(training_scores.reshape(-1, 1)) testing_scores = score_scaler_model.transform(testing_scores.reshape(-1, 1)).ravel() all_testing_scores.append(testing_scores) all_testing_scores = np.concatenate(all_testing_scores) all_cameras_auroc = roc_auc_score(all_anomaly_masks, all_testing_scores) all_cameras_aupr = average_precision_score(all_anomaly_masks, all_testing_scores) print('\nAUROC for all cameras: %.4f' % all_cameras_auroc) print('AUPR for all cameras: %.4f' % all_cameras_aupr) return None def combine_global_and_local_losses(args): global_model_losses_path = args.global_model_losses local_model_losses_path = args.local_model_losses anomaly_mask_path = args.anomaly_mask global_model_losses = np.load(global_model_losses_path) local_model_losses = np.load(local_model_losses_path) anomaly_mask = np.load(anomaly_mask_path) start_idx = 0 for camera_id in range(len(global_model_losses.files)): global_errors = global_model_losses['arr_%d' % camera_id] local_errors = local_model_losses['arr_%d' % camera_id] end_idx = len(global_errors) + start_idx anomalies = anomaly_mask[start_idx:end_idx] start_idx = end_idx print('\n\nlocal error + 0 * global') combined_errors = local_errors print('AUROC for camera %d: %.4f' % (camera_id, roc_auc_score(anomalies, combined_errors))) print('AUPR for camera %d: %.4f' % (camera_id, average_precision_score(anomalies, combined_errors))) print('\nlocal error + 1 * global') combined_errors = local_errors + global_errors print('AUROC for camera %d: %.4f' % (camera_id, roc_auc_score(anomalies, combined_errors))) print('AUPR for camera %d: %.4f' % (camera_id, average_precision_score(anomalies, combined_errors))) print('\nlocal error + 10 * global') combined_errors = local_errors + 10 * global_errors print('AUROC for camera %d: %.4f' % (camera_id, roc_auc_score(anomalies, combined_errors))) print('AUPR for camera %d: %.4f' % (camera_id, average_precision_score(anomalies, combined_errors))) print('\nlocal error + 100 * global') combined_errors = local_errors + 100 * global_errors print('AUROC for camera %d: %.4f' % (camera_id, roc_auc_score(anomalies, combined_errors))) print('AUPR for camera %d: %.4f' % (camera_id, average_precision_score(anomalies, combined_errors))) print('\nlocal error + 1000 * global') combined_errors = local_errors + 1000 * global_errors print('AUROC for camera %d: %.4f' % (camera_id, roc_auc_score(anomalies, combined_errors))) print('AUPR for camera %d: %.4f' % (camera_id, average_precision_score(anomalies, combined_errors))) print('\nlocal error + 10000 * global') combined_errors = local_errors + 10000 * global_errors print('AUROC for camera %d: %.4f' % (camera_id, roc_auc_score(anomalies, combined_errors))) print('AUPR for camera %d: %.4f' % (camera_id, average_precision_score(anomalies, combined_errors))) return None ================================================ FILE: tbad/gpu.py ================================================ import os import tensorflow as tf import keras os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1' def configure_gpu_resources(gpu_ids, gpu_memory_fraction): """Configure GPU resources for tensorflow. Configures which GPUs to use by tensorflow and the percentage of memory to grab from each GPU. Argument(s): gpu_ids -- A comma-separated string containing the GPU ids. For instance, '2,3' indicates that GPUs 2 and 3 are available for use. GPU counting starts from 0. gpu_memory_fraction -- A float value between 0 and 1 specifying the amount of memory to grab from each GPU. """ os.environ['CUDA_VISIBLE_DEVICES'] = gpu_ids config = tf.ConfigProto() config.gpu_options.per_process_gpu_memory_fraction = gpu_memory_fraction sess = tf.Session(config=config) keras.backend.set_session(sess) ================================================ FILE: tbad/losses.py ================================================ import numpy as np import tensorflow as tf import keras.backend as K def mean_squared_error(original_trajectory, reconstructed_trajectory): mask = original_trajectory != 0.0 a = np.square(original_trajectory - reconstructed_trajectory) * mask b = np.sum(mask, axis=1, keepdims=True) b = np.where(b > 0, b, 1) return np.sum((a * mask) / b, axis=1) def balanced_mean_squared_error(original_trajectory, reconstructed_trajectory): weights = np.array([8.5] * 4 + [1.0] * 34, dtype=np.float32) mask = original_trajectory != 0.0 a = np.square(original_trajectory - reconstructed_trajectory) * mask b = np.sum(mask, axis=1, keepdims=True) b = np.where(b > 0, b, 1) return np.sum((a * mask * weights) / b, axis=1) def mean_absolute_error(original_trajectory, reconstructed_trajectory): eps = 1e-8 mask = original_trajectory != 0.0 a = np.sqrt(eps + np.square(original_trajectory - reconstructed_trajectory)) * mask b = np.sum(mask, axis=1, keepdims=True) b = np.where(b > 0, b, 1) return np.sum((a * mask) / b, axis=1) def balanced_mean_absolute_error(original_trajectory, reconstructed_trajectory): weights = np.array([8.5] * 4 + [1.0] * 34, dtype=np.float32) eps = 1e-8 mask = original_trajectory != 0.0 a = np.sqrt(eps + np.square(original_trajectory - reconstructed_trajectory)) * mask b = np.sum(mask, axis=1, keepdims=True) b = np.where(b > 0, b, 1) return np.sum((a * mask * weights) / b, axis=1) def binary_crossentropy(original_trajectory, reconstructed_trajectory): mask = original_trajectory != 0.0 a = -original_trajectory * np.log(reconstructed_trajectory) - \ (1 - original_trajectory) * np.log(1 - reconstructed_trajectory) b = np.sum(mask, axis=1, keepdims=True) b = np.where(b > 0, b, 1) return np.sum((a * mask) / b, axis=1) def modified_mean_squared_error(y_true, y_pred): mask = tf.not_equal(y_true, 0.0) mask = tf.cast(mask, dtype=tf.float32) return K.mean(K.square(y_pred - y_true) * mask, axis=-1) def modified_mean_squared_error_2(y_true, y_pred): mask = tf.not_equal(y_true, 0.0) mask = tf.cast(mask, dtype=tf.float32) a = (y_pred - y_true) ** 2 b = K.sum(mask, axis=-1, keepdims=True) c = tf.ones_like(b) b = K.tf.where(b > 0.0, b, c) return K.sum((a * mask) / b, axis=-1) # Balanced MSE def modified_mean_squared_error_3(y_true, y_pred): weights = tf.constant([8.5] * 4 + [1.0] * 34) mask = tf.not_equal(y_true, 0.0) mask = tf.cast(mask, dtype=tf.float32) a = (y_pred - y_true) ** 2 b = K.sum(mask, axis=-1, keepdims=True) c = tf.ones_like(b) b = K.tf.where(b > 0.0, b, c) return K.sum((a * mask * weights) / b, axis=-1) def modified_mean_absolute_error(y_true, y_pred): eps = 1e-8 mask = tf.not_equal(y_true, 0.0) mask = tf.cast(mask, dtype=tf.float32) a = K.sqrt(eps + (y_pred - y_true) ** 2) b = K.sum(mask, axis=-1, keepdims=True) c = tf.ones_like(b) b = K.tf.where(b > 0.0, b, c) return K.sum((a * mask) / b, axis=-1) def modified_balanced_mean_absolute_error(y_true, y_pred): weights = tf.constant([8.5] * 4 + [1.0] * 34) eps = 1e-8 mask = tf.not_equal(y_true, 0.0) mask = tf.cast(mask, dtype=tf.float32) a = K.sqrt(eps + (y_pred - y_true) ** 2) b = K.sum(mask, axis=2, keepdims=True) c = tf.ones_like(b) b = K.tf.where(b > 0.0, b, c) return K.sum((a * mask * weights) / b, axis=-1) def modified_binary_crossentropy(y_true, y_pred): mask = tf.not_equal(y_true, 0.0) mask = tf.cast(mask, dtype=tf.float32) return K.mean(K.binary_crossentropy(y_true * mask, y_pred * mask), axis=-1) def modified_binary_crossentropy_2(y_true, y_pred): mask = tf.not_equal(y_true, 0.0) mask = tf.cast(mask, dtype=tf.float32) a = -y_true * K.log(y_pred) - (1 - y_true) * K.log(1 - y_pred) b = K.sum(mask, axis=2, keepdims=True) c = tf.ones_like(b) b = K.tf.where(b > 0.0, b, c) return K.sum((a * mask) / b, axis=-1) ================================================ FILE: tbad/rnn_autoencoder/__init__.py ================================================ ================================================ FILE: tbad/rnn_autoencoder/data.py ================================================ # Temporary data manipulating routines for test import numpy as np from tbad.losses import binary_crossentropy, mean_absolute_error, mean_squared_error, balanced_mean_squared_error from tbad.losses import balanced_mean_absolute_error def remove_short_trajectories(trajectories, input_length, input_gap, pred_length=0): filtered_trajectories = {} for trajectory_id, trajectory in trajectories.items(): if not trajectory.is_short(input_length=input_length, input_gap=input_gap, pred_length=pred_length): filtered_trajectories[trajectory_id] = trajectory return filtered_trajectories def aggregate_rnn_autoencoder_data(trajectories, input_length, input_gap=0, pred_length=0): Xs, Xs_pred = [], [] for trajectory in trajectories.values(): X, X_pred = _aggregate_rnn_autoencoder_data(trajectory.coordinates, input_length, input_gap, pred_length) Xs.append(X) if X_pred is not None: Xs_pred.append(X_pred) Xs = np.vstack(Xs) if not Xs_pred: Xs_pred = None else: Xs_pred = np.vstack(Xs_pred) return Xs, Xs_pred def _aggregate_rnn_autoencoder_data(coordinates, input_length, input_gap=0, pred_length=0): input_trajectories, future_trajectories = [], None total_input_seq_len = input_length + input_gap * (input_length - 1) step = input_gap + 1 if pred_length > 0: future_trajectories = [] stop = len(coordinates) - pred_length - total_input_seq_len + 1 for start_index in range(0, stop): stop_index = start_index + total_input_seq_len input_trajectories.append(coordinates[start_index:stop_index:step, :]) future_trajectories.append(coordinates[stop_index:(stop_index + pred_length), :]) input_trajectories = np.stack(input_trajectories, axis=0) future_trajectories = np.stack(future_trajectories, axis=0) else: stop = len(coordinates) - total_input_seq_len + 1 for start_index in range(0, stop): stop_index = start_index + total_input_seq_len input_trajectories.append(coordinates[start_index:stop_index:step, :]) input_trajectories = np.stack(input_trajectories, axis=0) return input_trajectories, future_trajectories def aggregate_rnn_ae_evaluation_data(trajectories, input_length, input_gap, pred_length, overlapping_trajectories): trajectories_ids, frames, X = [], [], [] for trajectory in trajectories.values(): traj_ids, traj_frames, traj_X = _aggregate_rnn_ae_evaluation_data(trajectory, input_length) trajectories_ids.append(traj_ids) frames.append(traj_frames) X.append(traj_X) trajectories_ids, frames, X = np.vstack(trajectories_ids), np.vstack(frames), np.vstack(X) return trajectories_ids, frames, X def _aggregate_rnn_ae_evaluation_data(trajectory, input_length): traj_frames, traj_X = [], [] coordinates = trajectory.coordinates frames = trajectory.frames total_input_seq_len = input_length stop = len(coordinates) - total_input_seq_len + 1 for start_index in range(stop): stop_index = start_index + total_input_seq_len traj_X.append(coordinates[start_index:stop_index, :]) traj_frames.append(frames[start_index:stop_index]) traj_frames, traj_X = np.stack(traj_frames, axis=0), np.stack(traj_X, axis=0) trajectory_id = trajectory.trajectory_id traj_ids = np.full(traj_frames.shape, fill_value=trajectory_id) return traj_ids, traj_frames, traj_X def compute_rnn_ae_reconstruction_errors(X, reconstructed_X, loss): num_examples, input_length, input_dim = X.shape X = X.reshape(-1, input_dim) reconstructed_X = reconstructed_X.reshape(-1, input_dim) loss_fn = {'log_loss': binary_crossentropy, 'mae': mean_absolute_error, 'mse': mean_squared_error, 'balanced_mse': balanced_mean_squared_error, 'balanced_mae': balanced_mean_absolute_error}[loss] reconstruction_errors = loss_fn(X, reconstructed_X) return reconstruction_errors.reshape(num_examples, input_length) def summarise_reconstruction_errors(reconstruction_errors, frames, trajectory_ids): unique_ids = np.unique(trajectory_ids) all_trajectory_ids, all_summarised_frames, all_summarised_errors = [], [], [] for trajectory_id in unique_ids: mask = trajectory_ids == trajectory_id current_frames = frames[mask] current_errors = reconstruction_errors[mask] summarised_frames, summarised_errors = summarise_reconstruction_errors_per_frame(current_errors, current_frames) all_summarised_frames.append(summarised_frames) all_summarised_errors.append(summarised_errors) all_trajectory_ids.append([trajectory_id] * len(summarised_frames)) all_trajectory_ids = np.concatenate(all_trajectory_ids) all_summarised_frames = np.concatenate(all_summarised_frames) all_summarised_errors = np.concatenate(all_summarised_errors) return all_trajectory_ids, all_summarised_frames, all_summarised_errors def summarise_reconstruction_errors_per_frame(errors, frames): unique_frames = np.unique(frames) unique_errors = np.empty(unique_frames.shape, dtype=np.float32) for idx, frame in enumerate(unique_frames): mask = frames == frame unique_errors[idx] = np.mean(errors[mask]) return unique_frames, unique_errors def summarise_reconstruction(reconstructed_X, frames, trajectory_ids): unique_ids = np.unique(trajectory_ids) num_examples, input_length, input_dim = reconstructed_X.shape reconstructed_X = reconstructed_X.reshape(-1, input_dim) frames = frames.reshape(-1) trajectory_ids = trajectory_ids.reshape(-1) all_trajectory_ids, all_summarised_frames, all_summarised_recs = [], [], [] for trajectory_id in unique_ids: mask = trajectory_ids == trajectory_id current_frames = frames[mask] current_reconstructions = reconstructed_X[mask, :] summarised_frames, summarised_recs = summarise_reconstruction_per_frame(current_reconstructions, current_frames) all_summarised_frames.append(summarised_frames) all_summarised_recs.append(summarised_recs) all_trajectory_ids.append([trajectory_id] * len(summarised_frames)) all_trajectory_ids = np.concatenate(all_trajectory_ids) all_summarised_frames = np.concatenate(all_summarised_frames) all_summarised_recs = np.vstack(all_summarised_recs) reconstructed_X = reconstructed_X.reshape(num_examples, input_length, input_dim) frames = frames.reshape(num_examples, input_length) trajectory_ids = trajectory_ids.reshape(num_examples, input_length) return all_trajectory_ids, all_summarised_frames, all_summarised_recs def summarise_reconstruction_per_frame(recs, frames): unique_frames = np.unique(frames) unique_recs = np.empty((len(unique_frames), recs.shape[-1]), dtype=np.float32) for idx, frame in enumerate(unique_frames): mask = frames == frame unique_recs[idx, :] = np.mean(recs[mask, :], axis=0, keepdims=True) return unique_frames, unique_recs def retrieve_future_skeletons(trajectories_ids, X, pred_length): input_dim = X.shape[-1] traj_id_per_example = trajectories_ids[:, 0] indices = np.unique(traj_id_per_example, return_index=True)[1] unique_ids = [traj_id_per_example[idx] for idx in sorted(indices)] y = [] for unique_id in unique_ids: current_ids = unique_id == traj_id_per_example current_X = X[current_ids, :, :] future_X = current_X[pred_length:, -pred_length:, :] padding = np.zeros(shape=(pred_length, pred_length, input_dim), dtype=np.float32) future_X = np.concatenate((future_X, padding), axis=0) y.append(future_X) y = np.vstack(y) return y def discard_information_from_padded_frames(pred_ids, pred_frames, pred_errors, pred_length): id_per_example = pred_ids[:, 0] indices = np.unique(id_per_example, return_index=True)[1] unique_ids = [id_per_example[idx] for idx in sorted(indices)] all_ids, all_frames, all_errors = [], [], [] for unique_id in unique_ids: current_ids = unique_id == id_per_example actual_ids = pred_ids[current_ids][:-pred_length] actual_frames = pred_frames[current_ids][:-pred_length] actual_errors = pred_errors[current_ids][:-pred_length] all_ids.append(actual_ids) all_frames.append(actual_frames) all_errors.append(actual_errors) all_ids = np.vstack(all_ids) all_frames = np.vstack(all_frames) all_errors = np.vstack(all_errors) return all_ids, all_frames, all_errors ================================================ FILE: tbad/rnn_autoencoder/evaluate.py ================================================ from collections import namedtuple from copy import deepcopy import os import numpy as np from sklearn.metrics import roc_auc_score, average_precision_score from tbad.autoencoder.data import load_trajectories, extract_global_features, change_coordinate_system from tbad.autoencoder.data import scale_trajectories, load_anomaly_masks, assemble_ground_truth_and_reconstructions from tbad.autoencoder.data import quantile_transform_errors from tbad.rnn_autoencoder.data import remove_short_trajectories, aggregate_rnn_ae_evaluation_data from tbad.rnn_autoencoder.data import compute_rnn_ae_reconstruction_errors, summarise_reconstruction_errors from tbad.rnn_autoencoder.data import retrieve_future_skeletons, discard_information_from_padded_frames from tbad.rnn_autoencoder.rnn import load_pretrained_rnn_ae def eval_rnn_ae(args): # General trajectories_path = args.trajectories # e.g. .../optflow/alphapose/08 camera_id = os.path.basename(trajectories_path) pretrained_model_path = args.pretrained_model # e.g. .../16_0_2_rrs_bb-c_3stds_mse/08_2018_10_02_11_39_20 video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) frame_level_anomaly_masks_path = args.frame_level_anomaly_masks overlapping_trajectories = args.overlapping_trajectories # Load Pre-Trained Model pretrained_rnn_ae, scaler = load_pretrained_rnn_ae(pretrained_model_path) # Extract information about the model model_info = os.path.basename(os.path.split(pretrained_model_path)[0]) global_model = '_gm_' in model_info extract_delta = '_ed_' in model_info use_first_step_as_reference = '_ufsar_' in model_info concatenate_model = '_cm_' in model_info coordinate_system = 'global' if '_bb-tl_' in model_info: coordinate_system = 'bounding_box_top_left' elif '_bb-c_' in model_info: coordinate_system = 'bounding_box_centre' normalisation_strategy = 'zero_one' if '_3stds_' in model_info: normalisation_strategy = 'three_stds' elif '_robust_' in model_info: normalisation_strategy = 'robust' input_length, input_gap = pretrained_rnn_ae.input_length, pretrained_rnn_ae.input_gap rec_length, pred_length = pretrained_rnn_ae.reconstruction_length, pretrained_rnn_ae.prediction_length reconstruct_reverse = pretrained_rnn_ae.reconstruct_reverse loss = pretrained_rnn_ae.loss # Data pre-processing trajectories = load_trajectories(trajectories_path) trajectories = remove_short_trajectories(trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length) if concatenate_model: trajectories_global = extract_global_features(deepcopy(trajectories), video_resolution=video_resolution, extract_delta=extract_delta, use_first_step_as_reference=use_first_step_as_reference) trajectories_global = change_coordinate_system(trajectories_global, video_resolution=video_resolution, coordinate_system='global', invert=False) trajectories_ids, frames, X_global = \ aggregate_rnn_ae_evaluation_data(trajectories_global, input_length=input_length, input_gap=input_gap, pred_length=pred_length, overlapping_trajectories=overlapping_trajectories) trajectories_local = trajectories trajectories_local = change_coordinate_system(trajectories_local, video_resolution=video_resolution, coordinate_system='bounding_box_centre', invert=False) _, _, X_local = aggregate_rnn_ae_evaluation_data(trajectories_local, input_length=input_length, input_gap=input_gap, pred_length=pred_length, overlapping_trajectories=overlapping_trajectories) X = np.concatenate((X_global, X_local), axis=-1) X, _ = scale_trajectories(X, scaler=scaler, strategy=normalisation_strategy) else: if global_model: trajectories = extract_global_features(trajectories, video_resolution=video_resolution, extract_delta=extract_delta, use_first_step_as_reference=use_first_step_as_reference) coordinate_system = 'global' trajectories = change_coordinate_system(trajectories, video_resolution=video_resolution, coordinate_system=coordinate_system, invert=False) trajectories_ids, frames, X = aggregate_rnn_ae_evaluation_data(trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length, overlapping_trajectories=overlapping_trajectories) X, _ = scale_trajectories(X, scaler=scaler, strategy=normalisation_strategy) # Reconstruct if pred_length == 0: reconstructed_X = pretrained_rnn_ae.predict(X) else: reconstructed_X, predicted_y = pretrained_rnn_ae.predict(X) if reconstruct_reverse: reconstructed_X = reconstructed_X[:, ::-1, :] reconstruction_errors = compute_rnn_ae_reconstruction_errors(X[:, :rec_length, :], reconstructed_X, loss) reconstruction_ids, reconstruction_frames, reconstruction_errors = \ summarise_reconstruction_errors(reconstruction_errors, frames[:, :rec_length], trajectories_ids[:, :rec_length]) # Evaluate performance anomaly_masks = load_anomaly_masks(frame_level_anomaly_masks_path) y_true, y_hat = assemble_ground_truth_and_reconstructions(anomaly_masks, reconstruction_ids, reconstruction_frames, reconstruction_errors) auroc, aupr = roc_auc_score(y_true, y_hat), average_precision_score(y_true, y_hat) print('Reconstruction Based:') print('Camera %s:\tAUROC\tAUPR' % camera_id) print(' \t%.4f\t%.4f\n' % (auroc, aupr)) # Future Prediction if pred_length > 0: predicted_frames = frames[:, :pred_length] + input_length predicted_ids = trajectories_ids[:, :pred_length] y = retrieve_future_skeletons(trajectories_ids, X, pred_length) pred_errors = compute_rnn_ae_reconstruction_errors(y, predicted_y, loss) predicted_ids, predicted_frames, pred_errors = discard_information_from_padded_frames(predicted_ids, predicted_frames, pred_errors, pred_length) pred_ids, pred_frames, pred_errors = \ summarise_reconstruction_errors(pred_errors, predicted_frames, predicted_ids) y_true_pred, y_hat_pred = assemble_ground_truth_and_reconstructions(anomaly_masks, pred_ids, pred_frames, pred_errors) auroc, aupr = roc_auc_score(y_true_pred, y_hat_pred), average_precision_score(y_true_pred, y_hat_pred) print('Prediction Based:') print('Camera %s:\tAUROC\tAUPR' % camera_id) print(' \t%.4f\t%.4f\n' % (auroc, aupr)) y_true_comb, y_hat_comb = y_true, y_hat + y_hat_pred auroc, aupr = roc_auc_score(y_true_comb, y_hat_comb), average_precision_score(y_true_comb, y_hat_comb) print('Reconstruction + Prediction Based:') print('Camera %s:\tAUROC\tAUPR' % camera_id) print(' \t%.4f\t%.4f\n' % (auroc, aupr)) # Logging if pred_length > 0: return y_true, y_hat, y_true_pred, y_hat_pred, y_true_comb, y_hat_comb else: return y_true, y_hat, None, None, None, None def eval_rnn_aes(args): all_trajectories_path = args.all_trajectories pretrained_models_path = args.pretrained_models # e.g. .../ video_resolution = args.video_resolution all_frame_level_anomaly_masks_path = args.all_frame_level_anomaly_masks overlapping_trajectories = args.overlapping_trajectories EvalRNNAeArgs = namedtuple('EvalRNNAeArgs', ['pretrained_model', 'trajectories', 'frame_level_anomaly_masks', 'video_resolution', 'overlapping_trajectories']) pretrained_models_dirs = sorted(os.listdir(pretrained_models_path)) y_trues, y_hats, y_trues_pred, y_hats_pred, y_trues_comb, y_hats_comb = {}, {}, {}, {}, {}, {} for pretrained_model_dir in pretrained_models_dirs: camera_id = pretrained_model_dir.split('_')[0] pretrained_model_path = os.path.join(pretrained_models_path, pretrained_model_dir) trajectories_path = os.path.join(all_trajectories_path, camera_id) frame_level_anomaly_masks_path = os.path.join(all_frame_level_anomaly_masks_path, camera_id) eval_rnn_ae_args = EvalRNNAeArgs(pretrained_model_path, trajectories_path, frame_level_anomaly_masks_path, video_resolution, overlapping_trajectories) y_true, y_hat, y_true_pred, y_hat_pred, y_true_comb, y_hat_comb = eval_rnn_ae(eval_rnn_ae_args) y_trues[camera_id], y_hats[camera_id] = y_true, y_hat if y_true_pred is not None: y_trues_pred[camera_id], y_hats_pred[camera_id] = y_true_pred, y_hat_pred y_trues_comb[camera_id], y_hats_comb[camera_id] = y_true_comb, y_hat_comb y_hats = quantile_transform_errors(y_hats) camera_ids = sorted(y_hats.keys()) y_trues_flat, y_hats_flat = [], [] for camera_id in camera_ids: y_trues_flat.append(y_trues[camera_id]) y_hats_flat.append(y_hats[camera_id]) y_trues_flat, y_hats_flat = np.concatenate(y_trues_flat), np.concatenate(y_hats_flat) auroc, aupr = roc_auc_score(y_trues_flat, y_hats_flat), average_precision_score(y_trues_flat, y_hats_flat) print('Reconstruction Based:') print('All Cameras\tAUROC\tAUPR') print(' \t%.4f\t%.4f\n' % (auroc, aupr)) if y_trues_pred: y_hats_pred = quantile_transform_errors(y_hats_pred) y_trues_pred_flat, y_hats_pred_flat = [], [] for camera_id in camera_ids: y_trues_pred_flat.append(y_trues_pred[camera_id]) y_hats_pred_flat.append(y_hats_pred[camera_id]) y_trues_pred_flat, y_hats_pred_flat = np.concatenate(y_trues_pred_flat), np.concatenate(y_hats_pred_flat) auroc_pred = roc_auc_score(y_trues_pred_flat, y_hats_pred_flat) aupr_pred = average_precision_score(y_trues_pred_flat, y_hats_pred_flat) print('Prediction Based:') print('All Cameras\tAUROC\tAUPR') print(' \t%.4f\t%.4f\n' % (auroc_pred, aupr_pred)) y_hats_comb = quantile_transform_errors(y_hats_comb) y_trues_comb_flat, y_hats_comb_flat = [], [] for camera_id in camera_ids: y_trues_comb_flat.append(y_trues_comb[camera_id]) y_hats_comb_flat.append(y_hats_comb[camera_id]) y_trues_comb_flat, y_hats_comb_flat = np.concatenate(y_trues_comb_flat), np.concatenate(y_hats_comb_flat) auroc_comb = roc_auc_score(y_trues_comb_flat, y_hats_comb_flat) aupr_comb = average_precision_score(y_trues_comb_flat, y_hats_comb_flat) print('Reconstruction + Prediction Based:') print('All Cameras\tAUROC\tAUPR') print(' \t%.4f\t%.4f\n' % (auroc_comb, aupr_comb)) ================================================ FILE: tbad/rnn_autoencoder/rnn.py ================================================ import os import keras from keras.models import Model from keras.layers import Input, RNN, Dense, Lambda import numpy as np from sklearn.externals import joblib from tbad.utils import select_optimiser, select_loss, select_cell class RNNEncoderDecoder: def __init__(self, input_length, input_dim, reconstruction_length, input_gap=0, prediction_length=0, hidden_dims=(16,), output_activation='sigmoid', cell_type='lstm', reconstruction_branch=True, reconstruct_reverse=True, conditional_reconstruction=False, conditional_prediction=False, optimiser='rmsprop', learning_rate=0.001, loss='mse', l1_reg=0.0, l2_reg=0.0): self.input_length = input_length self.input_dim = input_dim self.input_gap = input_gap self.reconstruction_length = reconstruction_length self.prediction_length = prediction_length self.hidden_dims = hidden_dims self.output_activation = output_activation self.cell_type = cell_type self.reconstruction_branch = reconstruction_branch self.reconstruct_reverse = reconstruct_reverse self.conditional_reconstruction = conditional_reconstruction self.conditional_prediction = conditional_prediction self.optimiser = optimiser self.learning_rate = learning_rate self.loss = loss self.l1_reg = l1_reg self.l2_reg = l2_reg self.model = self.build() def build(self): all_inputs, all_outputs = [], [] enc_input = Input(shape=(self.input_length, self.input_dim), name='enc_input', dtype='float32') all_inputs.append(enc_input) enc_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.hidden_dims] enc_rnn = RNN(enc_cells, return_state=True, name='enc_rnn') _, *enc_states = enc_rnn(enc_input) if not (self.reconstruction_branch or self.prediction_length > 0): raise ValueError('At least one of reconstruction_branch or prediction_branch must be True.') if self.reconstruction_branch: rec_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.hidden_dims] rec_rnn = RNN(rec_cells, return_sequences=True, return_state=True, name='rec_rnn') rec_dense = Dense(self.input_dim, activation=self.output_activation, name='rec_dense') if self.conditional_reconstruction: rec_input = Input(shape=(1, self.input_dim), name='rec_input', dtype='float32') rec_outputs = [] inputs = rec_input states = enc_states for _ in range(self.reconstruction_length): rec_output, *states = rec_rnn(inputs, initial_state=states) rec_output = rec_dense(rec_output) rec_outputs.append(rec_output) inputs = rec_output rec_output = Lambda(lambda x: keras.backend.concatenate(x, axis=1))(rec_outputs) else: rec_input = Input(shape=(self.reconstruction_length, self.input_dim), name='rec_input', dtype='float32') rec_output, *_ = rec_rnn(rec_input, initial_state=enc_states) rec_output = rec_dense(rec_output) all_inputs.append(rec_input) all_outputs.append(rec_output) if self.prediction_length > 0: pred_cells = [select_cell(self.cell_type, hidden_dim, l1=self.l1_reg, l2=self.l2_reg) for hidden_dim in self.hidden_dims] pred_rnn = RNN(pred_cells, return_sequences=True, return_state=True, name='pred_rnn') pred_dense = Dense(self.input_dim, activation=self.output_activation, name='pred_dense') if self.conditional_prediction: pred_input = Input(shape=(1, self.input_dim), name='pred_input', dtype='float32') pred_outputs = [] inputs = pred_input states = enc_states for _ in range(self.prediction_length): pred_output, *states = pred_rnn(inputs, initial_state=states) pred_output = pred_dense(pred_output) pred_outputs.append(pred_output) inputs = pred_output pred_output = Lambda(lambda x: keras.backend.concatenate(x, axis=1))(pred_outputs) else: pred_input = Input(shape=(self.prediction_length, self.input_dim), name='pred_input', dtype='float32') pred_output, *_ = pred_rnn(pred_input, initial_state=enc_states) pred_output = pred_dense(pred_output) all_inputs.append(pred_input) all_outputs.append(pred_output) return Model(inputs=all_inputs, outputs=all_outputs) def compile(self): self.model.compile(optimizer=select_optimiser(self.optimiser, self.learning_rate), loss=select_loss(self.loss)) def load_weights(self, weights_path): self.model.load_weights(weights_path) def _create_reconstruction_input_zeros(self, n_examples): if self.conditional_reconstruction: return np.zeros((n_examples, 1, self.input_dim)) else: return np.zeros((n_examples, self.reconstruction_length, self.input_dim)) def _create_prediction_input_zeros(self, n_examples): if self.conditional_prediction: return np.zeros((n_examples, 1, self.input_dim)) else: return np.zeros((n_examples, self.prediction_length, self.input_dim)) def _construct_input_data(self, X): X_input = [X] if self.reconstruction_branch: X_input.append(self._create_reconstruction_input_zeros(X.shape[0])) if self.prediction_length > 0: X_input.append(self._create_prediction_input_zeros(X.shape[0])) return X_input def _construct_output_data(self, X, y=None): y_output = [] if self.reconstruction_branch: if self.reconstruct_reverse: y_output.append(X[:, (self.reconstruction_length - 1)::-1, :]) else: y_output.append(X[:, :self.reconstruction_length, :]) if self.prediction_length > 0: y_output.append(y) return y_output def train(self, X_train, y_train=None, epochs=10, initial_epoch=0, batch_size=64, val_data=None, log_dir=None): self.compile() callbacks_list = [ keras.callbacks.EarlyStopping( monitor='val_loss', patience=3 ) ] if log_dir is not None: callbacks_list += [ keras.callbacks.ModelCheckpoint( filepath=os.path.join(log_dir, 'weights_{epoch:03d}_{val_loss:.2f}.h5'), monitor='val_loss', save_best_only=True, save_weights_only=True ), keras.callbacks.CSVLogger( filename=os.path.join(log_dir, 'training_report.csv'), append=True ) ] self._maybe_write_architecture(log_dir) X = self._construct_input_data(X_train) y = self._construct_output_data(X_train, y_train) X_val = self._construct_input_data(val_data[0]) y_val = self._construct_output_data(*val_data) self.model.fit(X, y, batch_size=batch_size, epochs=epochs, callbacks=callbacks_list, validation_data=(X_val, y_val), initial_epoch=initial_epoch) def predict(self, X_test, batch_size=256): X = self._construct_input_data(X_test) return self.model.predict(X, batch_size=batch_size) def eval(self, X_test, batch_size=256): X = self._construct_input_data(X_test) y = self._construct_output_data(X_test) return self.model.evaluate(X, y, batch_size=batch_size) def _maybe_write_architecture(self, log_dir): file_path = os.path.join(log_dir, 'architecture.txt') if os.path.isfile(file_path): return None with open(file_path, mode='w') as file: print('input_length', self.input_length, file=file) print('input_dim', self.input_dim, file=file) print('reconstruction_length', self.reconstruction_length, file=file) print('input_gap', self.input_gap, file=file) print('prediction_length', self.prediction_length, file=file) print('reconstruct_reverse', self.reconstruct_reverse, file=file) print('cell_type', self.cell_type, file=file) print('hidden_dims', *self.hidden_dims, file=file) print('output_activation', self.output_activation, file=file) print('reconstruction_branch', self.reconstruction_branch, file=file) print('conditional_reconstruction', self.conditional_reconstruction, file=file) print('conditional_prediction', self.conditional_prediction, file=file) print('optimiser', self.optimiser, file=file) print('learning_rate', self.learning_rate, file=file) print('loss', self.loss, file=file) print('l1_reg', self.l1_reg, file=file) print('l2_reg', self.l2_reg, file=file) def load_architecture_specification(model_architecture): model_spec = {} with open(model_architecture, mode='r') as file: for line in file: key, *value = line.split() if key in ('input_length', 'input_dim', 'input_gap', 'prediction_length', 'global_input_dim', 'local_input_dim', 'reconstruction_length'): value = int(value[0]) elif key in ('learning_rate', 'l1_reg', 'l2_reg'): value = float(value[0]) elif key in ('hidden_dims', 'input_dims', 'global_hidden_dims', 'local_hidden_dims', 'extra_hidden_dims'): value = tuple(map(int, value)) elif key in ('reconstruction_branch', 'reconstruct_reverse', 'reconstruct_original_data', 'conditional_reconstruction', 'conditional_prediction', 'multiple_outputs', 'multiple_outputs_before_concatenation'): value = value[0] if value == 'True': value = True else: value = False else: value = value[0] model_spec[key] = value return model_spec def model_from_architecture_specification(architecture_specification): return RNNEncoderDecoder(**architecture_specification) def reconstruct_trajectories(anomaly_model, trajectories_coordinates): if anomaly_model.prediction_length > 0: reconstructed_trajectories = {trajectory_id: anomaly_model.predict(trajectory_coordinates, batch_size=256)[0] for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} else: reconstructed_trajectories = {trajectory_id: anomaly_model.predict(trajectory_coordinates, batch_size=256) for trajectory_id, trajectory_coordinates in trajectories_coordinates.items()} return reconstructed_trajectories def load_pretrained_rnn_ae(pretrained_model_path): model_files = os.listdir(pretrained_model_path) architecture_file = model_files[model_files.index('architecture.txt')] scaler_file = model_files[model_files.index('scaler.pkl')] weight_files = [file_name for file_name in model_files if file_name.startswith('weights')] best_weight = sorted(weight_files)[-1] architecture_specification = load_architecture_specification(os.path.join(pretrained_model_path, architecture_file)) anomaly_model = model_from_architecture_specification(architecture_specification) anomaly_model.compile() anomaly_model.load_weights(os.path.join(pretrained_model_path, best_weight)) scaler = joblib.load(filename=os.path.join(pretrained_model_path, scaler_file)) return anomaly_model, scaler ================================================ FILE: tbad/rnn_autoencoder/train.py ================================================ from copy import deepcopy import os import numpy as np from sklearn.externals import joblib from sklearn.utils import shuffle from tbad.autoencoder.data import load_trajectories, extract_global_features, change_coordinate_system from tbad.autoencoder.data import split_into_train_and_test, scale_trajectories, aggregate_autoencoder_data from tbad.autoencoder.data import input_trajectories_missing_steps from tbad.rnn_autoencoder.data import remove_short_trajectories, aggregate_rnn_autoencoder_data from tbad.rnn_autoencoder.rnn import RNNEncoderDecoder from tbad.utils import set_up_logging, resume_training_from_last_epoch def train_rnn_ae(args): # General trajectories_path = args.trajectories # e.g. .../11 camera_id = os.path.basename(trajectories_path) video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) # Architecture model_type = args.model_type extract_delta = args.extract_delta use_first_step_as_reference = args.use_first_step_as_reference input_length = args.input_length input_gap = args.input_gap rec_length = args.rec_length pred_length = args.pred_length hidden_dims = args.hidden_dims output_activation = args.output_activation cell_type = args.cell_type disable_reconstruction_branch = args.disable_reconstruction_branch reconstruct_reverse = args.reconstruct_reverse conditional_reconstruction = args.conditional_reconstruction conditional_prediction = args.conditional_prediction # Training optimiser = args.optimiser learning_rate = args.learning_rate loss = args.loss l1_reg = args.l1_reg l2_reg = args.l2_reg epochs = args.epochs batch_size = args.batch_size input_missing_steps = args.input_missing_steps coordinate_system = args.coordinate_system normalisation_strategy = args.normalisation_strategy # Logging root_log_dir = args.root_log_dir resume_training = args.resume_training trajectories = load_trajectories(trajectories_path) print('\nLoaded %d trajectories.' % len(trajectories)) trajectories = remove_short_trajectories(trajectories, input_length=input_length, input_gap=input_gap, pred_length=pred_length) print('\nRemoved short trajectories. Number of trajectories left: %d.' % len(trajectories)) X_train, y_train, X_val, y_val, scaler = \ produce_data_from_model_type(model_type, trajectories, video_resolution=video_resolution, input_length=input_length, input_gap=input_gap, pred_length=pred_length, normalisation_strategy=normalisation_strategy, coordinate_system=coordinate_system, input_missing_steps=input_missing_steps, extract_delta=extract_delta, use_first_step_as_reference=use_first_step_as_reference) if model_type == 'concatenate': loss = 'balanced_' + loss print('\nInstantiating anomaly model ...') input_dim = X_train.shape[-1] rnn_ae = RNNEncoderDecoder(input_length=input_length, input_dim=input_dim, reconstruction_length=rec_length, prediction_length=pred_length, hidden_dims=hidden_dims, output_activation=output_activation, cell_type=cell_type, reconstruction_branch=disable_reconstruction_branch, reconstruct_reverse=reconstruct_reverse, conditional_reconstruction=conditional_reconstruction, conditional_prediction=conditional_prediction, optimiser=optimiser, learning_rate=learning_rate, loss=loss, l1_reg=l1_reg, l2_reg=l2_reg) log_dir = set_up_logging(camera_id=camera_id, root_log_dir=root_log_dir, resume_training=resume_training) last_epoch = resume_training_from_last_epoch(model=rnn_ae, resume_training=resume_training) rnn_ae.train(X_train, y_train, epochs=epochs, initial_epoch=last_epoch, batch_size=batch_size, val_data=(X_val, y_val), log_dir=log_dir) print('\nRNN Autoencoder anomaly model successfully trained.') if log_dir is not None: file_name = os.path.join(log_dir, 'scaler.pkl') joblib.dump(scaler, filename=file_name) print('log files were written to: %s' % log_dir) return rnn_ae, scaler def produce_data_from_model_type(model_type, trajectories, video_resolution, input_length, input_gap, pred_length, normalisation_strategy, coordinate_system, input_missing_steps=False, extract_delta=False, use_first_step_as_reference=False): trajectories_train, trajectories_val = split_into_train_and_test(trajectories, train_ratio=0.8, seed=42) if input_missing_steps: trajectories_train = input_trajectories_missing_steps(trajectories_train) print('\nInputted missing steps of trajectories.') if model_type == 'concatenate': trajectories_global_train = extract_global_features(deepcopy(trajectories_train), video_resolution=video_resolution, extract_delta=extract_delta, use_first_step_as_reference=use_first_step_as_reference) trajectories_global_train = change_coordinate_system(trajectories_global_train, video_resolution=video_resolution, coordinate_system='global', invert=False) trajectories_global_val = extract_global_features(deepcopy(trajectories_val), video_resolution=video_resolution, extract_delta=extract_delta, use_first_step_as_reference=use_first_step_as_reference) trajectories_global_val = change_coordinate_system(trajectories_global_val, video_resolution=video_resolution, coordinate_system='global', invert=False) trajectories_local_train, trajectories_local_val = trajectories_train, trajectories_val trajectories_local_train = change_coordinate_system(trajectories_local_train, video_resolution=video_resolution, coordinate_system='bounding_box_centre', invert=False) trajectories_local_val = change_coordinate_system(trajectories_local_val, video_resolution=video_resolution, coordinate_system='bounding_box_centre', invert=False) X_ref = np.concatenate((aggregate_autoencoder_data(trajectories_global_train), aggregate_autoencoder_data(trajectories_local_train)), axis=-1) _, scaler = scale_trajectories(X_ref, strategy=normalisation_strategy) X_global_train, y_global_train = aggregate_rnn_autoencoder_data(trajectories_global_train, input_length=input_length, input_gap=input_gap, pred_length=pred_length) X_global_val, y_global_val = aggregate_rnn_autoencoder_data(trajectories_global_val, input_length=input_length, input_gap=input_gap, pred_length=pred_length) X_local_train, y_local_train = aggregate_rnn_autoencoder_data(trajectories_local_train, input_length=input_length, input_gap=input_gap, pred_length=pred_length) X_local_val, y_local_val = aggregate_rnn_autoencoder_data(trajectories_local_val, input_length=input_length, input_gap=input_gap, pred_length=pred_length) X_train = np.concatenate((X_global_train, X_local_train), axis=-1) X_val = np.concatenate((X_global_val, X_local_val), axis=-1) X_train, _ = scale_trajectories(X_train, scaler=scaler, strategy=normalisation_strategy) X_val, _ = scale_trajectories(X_val, scaler=scaler, strategy=normalisation_strategy) if y_global_train is not None: y_train = np.concatenate((y_global_train, y_local_train), axis=-1) y_val = np.concatenate((y_global_val, y_local_val), axis=-1) y_train, _ = scale_trajectories(y_train, scaler=scaler, strategy=normalisation_strategy) y_val, _ = scale_trajectories(y_val, scaler=scaler, strategy=normalisation_strategy) else: y_train = y_val = None if y_train is not None: X_train, y_train = shuffle(X_train, y_train, random_state=42) else: X_train = shuffle(X_train, random_state=42) else: if model_type == 'global': trajectories_train = extract_global_features(trajectories_train, video_resolution=video_resolution, extract_delta=extract_delta, use_first_step_as_reference=use_first_step_as_reference) trajectories_val = extract_global_features(trajectories_val, video_resolution=video_resolution, extract_delta=extract_delta, use_first_step_as_reference=use_first_step_as_reference) coordinate_system = 'global' print('\nExtracted global features from input trajectories. In addition, the coordinate system has been ' 'set to global.') trajectories_train = change_coordinate_system(trajectories_train, video_resolution=video_resolution, coordinate_system=coordinate_system, invert=False) trajectories_val = change_coordinate_system(trajectories_val, video_resolution=video_resolution, coordinate_system=coordinate_system, invert=False) print('\nChanged coordinate system to %s.' % coordinate_system) _, scaler = scale_trajectories(aggregate_autoencoder_data(trajectories_train), strategy=normalisation_strategy) X_train, y_train = aggregate_rnn_autoencoder_data(trajectories_train, input_length=input_length, input_gap=input_gap, pred_length=pred_length) if y_train is not None: X_train, y_train = shuffle(X_train, y_train, random_state=42) else: X_train, y_train = shuffle(X_train, random_state=42), None X_val, y_val = aggregate_rnn_autoencoder_data(trajectories_val, input_length=input_length, input_gap=input_gap, pred_length=pred_length) X_train, _ = scale_trajectories(X_train, scaler=scaler, strategy=normalisation_strategy) X_val, _ = scale_trajectories(X_val, scaler=scaler, strategy=normalisation_strategy) if y_train is not None and y_val is not None: y_train, _ = scale_trajectories(y_train, scaler=scaler, strategy=normalisation_strategy) y_val, _ = scale_trajectories(y_val, scaler=scaler, strategy=normalisation_strategy) print('\nNormalised input features using the %s normalisation strategy.' % normalisation_strategy) return X_train, y_train, X_val, y_val, scaler ================================================ FILE: tbad/train.py ================================================ from copy import deepcopy import os import warnings import numpy as np from sklearn.externals import joblib from sklearn.utils import shuffle from tbad.data import load_trajectories, remove_short_trajectories, input_trajectories_missing_steps from tbad.data import extract_input_dim, collect_trajectories, collect_skeletons from tbad.data import extract_global_features, train_test_split_through_time, scale_trajectories from tbad.data import train_test_split_trajectories, change_coordinate_system from tbad.rnn_autoencoder.rnn import RNNEncoderDecoder from tbad.autoencoder.autoencoder import Autoencoder from tbad.combined_model.fusion import CombinedEncoderDecoder from tbad.utils import set_up_logging, resume_training_from_last_epoch warnings.simplefilter(action='ignore', category=FutureWarning) def train_ae(args): # General trajectories_path = args.trajectories # e.g. .../03 camera_id = os.path.basename(trajectories_path) video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) # Architecture global_model = args.global_model hidden_dims = args.hidden_dims coordinate_system = args.coordinate_system normalisation_strategy = args.normalisation_strategy # Training optimiser = args.optimiser learning_rate = args.learning_rate loss = args.loss epochs = args.epochs batch_size = args.batch_size # Logging root_log_dir = args.root_log_dir resume_training = args.resume_training trajectories_frames, trajectories_coordinates = load_trajectories(trajectories_path) print('\nLoaded %d trajectories.' % len(trajectories_coordinates)) if global_model: trajectories_coordinates = extract_global_features(trajectories_coordinates, video_resolution=video_resolution) coordinate_system = 'global' print('\nExtracted global features from input skeletons. In addition, the coordinate system has been set ' 'to global.') trajectories_coordinates = change_coordinate_system(trajectories_coordinates, video_resolution=video_resolution, coordinate_system=coordinate_system, invert=False) print('\nChanged coordinate system to %s.' % coordinate_system) trajectories_frames_train, trajectories_frames_val, trajectories_coordinates_train, trajectories_coordinates_val = \ train_test_split_trajectories(trajectories_frames, trajectories_coordinates, train_ratio=0.8, seed=42) trajectories_coordinates_train, scaler = scale_trajectories(trajectories_coordinates_train, strategy=normalisation_strategy) trajectories_coordinates_val, _ = scale_trajectories(trajectories_coordinates_val, scaler=scaler, strategy=normalisation_strategy) print('\nNormalised input features using the %s normalisation strategy.' % normalisation_strategy) input_dim = extract_input_dim(trajectories_coordinates_train) ae_model = Autoencoder(input_dim=input_dim, hidden_dims=hidden_dims, optimiser=optimiser, learning_rate=learning_rate, loss=loss) log_dir = set_up_logging(camera_id=camera_id, root_log_dir=root_log_dir, resume_training=resume_training) last_epoch = resume_training_from_last_epoch(model=ae_model, resume_training=resume_training) _, X_train = collect_skeletons(trajectories_frames_train, trajectories_coordinates_train) _, X_val = collect_skeletons(trajectories_frames_val, trajectories_coordinates_val) X_train = shuffle(X_train, random_state=42) ae_model.train(X_train, X_train, epochs=epochs, initial_epoch=last_epoch, batch_size=batch_size, val_data=(X_val, X_val), log_dir=log_dir) print('\nAutoencoder model successfully trained.') if log_dir is not None: joblib.dump(scaler, filename=os.path.join(log_dir, 'scaler.pkl')) print('log files were written to: %s' % log_dir) return None def train_rnn_ae(args): # General trajectories_path = args.trajectories # e.g. .../11 camera_id = os.path.basename(args.trajectories_path) video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) # Architecture global_model = args.global_model input_length = args.input_length input_gap = args.input_gap pred_length = args.pred_length hidden_dims = args.hidden_dims cell_type = args.cell_type disable_reconstruction_branch = args.disable_reconstruction_branch reconstruct_reverse = args.reconstruct_reverse conditional_reconstruction = args.conditional_reconstruction conditional_prediction = args.conditional_prediction # Training optimiser = args.optimiser learning_rate = args.learning_rate loss = args.loss epochs = args.epochs batch_size = args.batch_size input_missing_steps = args.input_missing_steps coordinate_system = args.coordinate_system normalisation_strategy = args.normalisation_strategy # Logging root_log_dir = args.root_log_dir resume_training = args.resume_training # trajectories_coordinates is a dictionary where the keys uniquely identify each person in each video and the values # are float32 tensors. Each tensor represents the detected trajectory of a single person and has shape # (trajectory_length, input_dim). trajectory_length is the total number of frames for which the person was tracked # and each detection is composed of k key points (17 for now), each represented by a pair of (x, y) coordinates. _, trajectories_coordinates = load_trajectories(trajectories_path) print('\nLoaded %d trajectories.' % len(trajectories_coordinates)) # Filter-out short trajectories trajectories_coordinates = remove_short_trajectories(trajectories_coordinates, input_length=input_length, input_gap=input_gap, pred_length=pred_length) print('\nRemoved short trajectories. Number of trajectories left: %d.' % len(trajectories_coordinates)) # Global model (optional) if global_model: trajectories_coordinates = extract_global_features(trajectories_coordinates, video_resolution=video_resolution) coordinate_system = 'global' print('\nExtracted global features from input trajectories. In addition, the coordinate system has been set ' 'to global.') # Change coordinate system trajectories_coordinates = change_coordinate_system(trajectories_coordinates, video_resolution=video_resolution, coordinate_system=coordinate_system, invert=False) print('\nChanged coordinate system to %s.' % coordinate_system) # Split into training and validation sets trajectories_coordinates_train, trajectories_coordinates_val = \ train_test_split_through_time(trajectories_coordinates, input_length=input_length, pred_length=pred_length, train_ratio=0.8) # Input missing steps (optional) if input_missing_steps: trajectories_coordinates_train = input_trajectories_missing_steps(trajectories_coordinates_train) # Normalise the data trajectories_coordinates_train, scaler = scale_trajectories(trajectories_coordinates_train, strategy=normalisation_strategy) trajectories_coordinates_val, _ = scale_trajectories(trajectories_coordinates_val, scaler=scaler, strategy=normalisation_strategy) print('\nInput features normalised using the %s normalisation strategy.' % normalisation_strategy) print('\nInstantiating anomaly model ...') input_dim = extract_input_dim(trajectories_coordinates) anomaly_model = RNNEncoderDecoder(input_length=input_length, input_dim=input_dim, prediction_length=pred_length, hidden_dims=hidden_dims, cell_type=cell_type, reconstruction_branch=disable_reconstruction_branch, reconstruct_reverse=reconstruct_reverse, conditional_reconstruction=conditional_reconstruction, conditional_prediction=conditional_prediction, optimiser=optimiser, learning_rate=learning_rate, loss=loss) # Set up training logging (optional) log_dir = set_up_logging(camera_id=camera_id, root_log_dir=root_log_dir, resume_training=resume_training) # Resume training (optional) last_epoch = resume_training_from_last_epoch(model=anomaly_model, resume_training=resume_training) # Train the anomaly model if pred_length > 0: X_train, y_train = list(zip(*[collect_trajectories(trajectory_coordinates, input_length, input_gap, pred_length) for trajectory_coordinates in trajectories_coordinates_train.values()])) X_train, y_train = np.vstack(X_train), np.vstack(y_train) print('\nTrain trajectories\' shape: (%d, %d, %d).' % (X_train.shape[0], X_train.shape[1], X_train.shape[2])) print('Train future trajectories\' shape: (%d, %d, %d).' % (y_train.shape[0], y_train.shape[1], y_train.shape[2])) X_val, y_val = list(zip(*[collect_trajectories(trajectory_coordinates, input_length, input_gap, pred_length) for trajectory_coordinates in trajectories_coordinates_val.values()])) X_val, y_val = np.vstack(X_val), np.vstack(y_val) print('\nVal trajectories\' shape: (%d, %d, %d).' % (X_val.shape[0], X_val.shape[1], X_val.shape[2])) print('Val future trajectories\' shape: (%d, %d, %d).' % (y_val.shape[0], y_val.shape[1], y_val.shape[2])) X_train, y_train = shuffle(X_train, y_train, random_state=42) anomaly_model.train(X_train, y_train, epochs=epochs, initial_epoch=last_epoch, batch_size=batch_size, val_data=(X_val, y_val), log_dir=log_dir) else: X_train = [collect_trajectories(trajectory_coordinates, input_length, input_gap, pred_length) for trajectory_coordinates in trajectories_coordinates_train.values()] X_train = np.vstack(X_train) print('\nTrain trajectories\' shape: (%d, %d, %d).' % (X_train.shape[0], X_train.shape[1], X_train.shape[2])) X_val = [collect_trajectories(trajectory_coordinates, input_length, input_gap, pred_length) for trajectory_coordinates in trajectories_coordinates_val.values()] X_val = np.vstack(X_val) print('\nVal trajectories\' shape: (%d, %d, %d).' % (X_val.shape[0], X_val.shape[1], X_val.shape[2])) X_train = shuffle(X_train, random_state=42) anomaly_model.train(X_train, epochs=epochs, initial_epoch=last_epoch, batch_size=batch_size, val_data=(X_val,), log_dir=log_dir) print('\nRNN Autoencoder model successfully trained.') if log_dir is not None: joblib.dump(scaler, filename=os.path.join(log_dir, 'scaler.pkl')) print('log files were written to: %s' % log_dir) return None def train_complete_rnn_ae(args): # General trajectories_path = args.trajectories camera_id = os.path.basename(trajectories_path) video_resolution = [float(measurement) for measurement in args.video_resolution.split('x')] video_resolution = np.array(video_resolution, dtype=np.float32) # Architecture input_length = args.input_length pred_length = args.pred_length global_hidden_dims = args.global_hidden_dims local_hidden_dims = args.local_hidden_dims extra_hidden_dims = args.extra_hidden_dims cell_type = args.cell_type reconstruct_reverse = args.reconstruct_reverse # Training optimiser = args.optimiser learning_rate = args.learning_rate loss = args.loss epochs = args.epochs batch_size = args.batch_size global_normalisation_strategy = args.global_normalisation_strategy local_normalisation_strategy = args.local_normalisation_strategy # Logging root_log_dir = args.root_log_dir resume_training = args.resume_training _, trajectories_coordinates = load_trajectories(trajectories_path) print('\nLoaded %d trajectories.' % len(trajectories_coordinates)) trajectories_coordinates = remove_short_trajectories(trajectories_coordinates, input_length=input_length, input_gap=0, pred_length=pred_length) print('\nRemoved short trajectories. Number of trajectories left: %d.' % len(trajectories_coordinates)) trajectories_coordinates_train, trajectories_coordinates_val = \ train_test_split_through_time(trajectories_coordinates, input_length=input_length, pred_length=pred_length, train_ratio=0.8) # Global pre-processing global_features_train = extract_global_features(trajectories_coordinates_train, video_resolution=video_resolution) global_features_val = extract_global_features(trajectories_coordinates_val, video_resolution=video_resolution) global_features_train = change_coordinate_system(global_features_train, video_resolution=video_resolution, coordinate_system='global', invert=False) global_features_val = change_coordinate_system(global_features_val, video_resolution=video_resolution, coordinate_system='global', invert=False) global_features_train, global_scaler = scale_trajectories(global_features_train, strategy=global_normalisation_strategy) global_features_val, _ = scale_trajectories(global_features_val, scaler=global_scaler, strategy=global_normalisation_strategy) # Local pre-processing local_features_train = deepcopy(trajectories_coordinates_train) local_features_val = deepcopy(trajectories_coordinates_val) local_features_train = change_coordinate_system(local_features_train, video_resolution=video_resolution, coordinate_system='bounding_box_centre', invert=False) local_features_val = change_coordinate_system(local_features_val, video_resolution=video_resolution, coordinate_system='bounding_box_centre', invert=False) local_features_train, local_scaler = scale_trajectories(local_features_train, strategy=local_normalisation_strategy) local_features_val, _ = scale_trajectories(local_features_val, scaler=local_scaler, strategy=local_normalisation_strategy) # # Output # out_train = trajectories_coordinates_train # out_val = trajectories_coordinates_val # # out_train = change_coordinate_system(out_train, # video_resolution=video_resolution, # coordinate_system='global', invert=False) # out_val = change_coordinate_system(out_val, # video_resolution=video_resolution, # coordinate_system='global', invert=False) # Anomaly Model global_input_dim = extract_input_dim(global_features_train) local_input_dim = extract_input_dim(local_features_train) anomaly_model = CombinedEncoderDecoder(input_length=input_length, global_input_dim=global_input_dim, local_input_dim=local_input_dim, prediction_length=pred_length, global_hidden_dims=global_hidden_dims, local_hidden_dims=local_hidden_dims, extra_hidden_dims=extra_hidden_dims, cell_type=cell_type, reconstruct_reverse=reconstruct_reverse, optimiser=optimiser, learning_rate=learning_rate, loss=loss) # Set up training logging (optional) log_dir = set_up_logging(camera_id=camera_id, root_log_dir=root_log_dir, resume_training=resume_training) # Resume training (optional) last_epoch = resume_training_from_last_epoch(model=anomaly_model, resume_training=resume_training) if pred_length > 0: # Global X_global_train, y_global_train = list(zip(*[collect_trajectories(global_trajectory, input_length, 0, pred_length) for global_trajectory in global_features_train.values()])) X_global_train, y_global_train = np.vstack(X_global_train), np.vstack(y_global_train) X_global_val, y_global_val = list(zip(*[collect_trajectories(global_trajectory, input_length, 0, pred_length) for global_trajectory in global_features_val.values()])) X_global_val, y_global_val = np.vstack(X_global_val), np.vstack(y_global_val) # Local X_local_train, y_local_train = list(zip(*[collect_trajectories(local_trajectory, input_length, 0, pred_length) for local_trajectory in local_features_train.values()])) X_local_train, y_local_train = np.vstack(X_local_train), np.vstack(y_local_train) X_local_val, y_local_val = list(zip(*[collect_trajectories(local_trajectory, input_length, 0, pred_length) for local_trajectory in local_features_val.values()])) X_local_val, y_local_val = np.vstack(X_local_val), np.vstack(y_local_val) # # Output # X_out_train, y_out_train = list(zip(*[collect_trajectories(out_trajectory, # input_length, 0, pred_length) # for out_trajectory in out_train.values()])) # X_out_train, y_out_train = np.vstack(X_out_train), np.vstack(y_out_train) # # X_out_val, y_out_val = list(zip(*[collect_trajectories(out_trajectory, # input_length, 0, pred_length) # for out_trajectory in out_val.values()])) # X_out_val, y_out_val = np.vstack(X_out_val), np.vstack(y_out_val) # # X_global_train, X_local_train, X_out_train, y_global_train, y_local_train, y_out_train = \ # shuffle(X_global_train, X_local_train, X_out_train, y_global_train, y_local_train, y_out_train, # random_state=42) X_global_train, X_local_train, y_global_train, y_local_train = \ shuffle(X_global_train, X_local_train, y_global_train, y_local_train, random_state=42) # X_train = [X_global_train, X_local_train, X_out_train] # y_train = [y_global_train, y_local_train, y_out_train] # val_data = ([X_global_val, X_local_val, X_out_val], [y_global_val, y_local_val, y_out_val]) X_train = [X_global_train, X_local_train] y_train = [y_global_train, y_local_train] val_data = ([X_global_val, X_local_val], [y_global_val, y_local_val]) anomaly_model.train(X_train, y_train, epochs=epochs, initial_epoch=last_epoch, batch_size=batch_size, val_data=val_data, log_dir=log_dir) else: # Global X_global_train = [collect_trajectories(global_trajectory, input_length, 0, pred_length) for global_trajectory in global_features_train.values()] X_global_train = np.vstack(X_global_train) X_global_val = [collect_trajectories(global_trajectory, input_length, 0, pred_length) for global_trajectory in global_features_val.values()] X_global_val = np.vstack(X_global_val) # Local X_local_train = [collect_trajectories(local_trajectory, input_length, 0, pred_length) for local_trajectory in local_features_train.values()] X_local_train = np.vstack(X_local_train) X_local_val = [collect_trajectories(local_trajectory, input_length, 0, pred_length) for local_trajectory in local_features_val.values()] X_local_val = np.vstack(X_local_val) # # Output # X_out_train = [collect_trajectories(out_trajectory, input_length, 0, pred_length) # for out_trajectory in out_train.values()] # X_out_train = np.vstack(X_out_train) # # X_out_val = [collect_trajectories(out_trajectory, input_length, 0, pred_length) # for out_trajectory in out_val.values()] # X_out_val = np.vstack(X_out_val) # X_global_train, X_local_train, X_out_train = shuffle(X_global_train, X_local_train, X_out_train, # random_state=42) X_global_train, X_local_train = shuffle(X_global_train, X_local_train, random_state=42) # X_train = [X_global_train, X_local_train, X_out_train] # val_data = ([X_global_val, X_local_val, X_out_val],) X_train = [X_global_train, X_local_train] val_data = ([X_global_val, X_local_val],) anomaly_model.train(X_train, epochs=epochs, initial_epoch=last_epoch, batch_size=batch_size, val_data=val_data, log_dir=log_dir) print('Combined global and local anomaly model successfully trained.') if log_dir is not None: joblib.dump(global_scaler, filename=os.path.join(log_dir, 'global_scaler.pkl')) joblib.dump(local_scaler, filename=os.path.join(log_dir, 'local_scaler.pkl')) print('log files were written to: %s' % log_dir) return None ================================================ FILE: tbad/utils.py ================================================ import os from datetime import datetime from keras.layers import SimpleRNNCell, GRUCell, LSTMCell from keras.optimizers import Adam, RMSprop from keras.regularizers import l1_l2 from tbad.losses import modified_binary_crossentropy_2, modified_mean_absolute_error, modified_mean_squared_error_2 from tbad.losses import modified_mean_squared_error_3, modified_balanced_mean_absolute_error from utils.score_scaling import ScoreNormalization from sklearn.preprocessing import StandardScaler, RobustScaler, QuantileTransformer, MaxAbsScaler, MinMaxScaler def select_optimiser(optimiser, learning_rate): """Select an optimiser to train the RNN.""" if optimiser == 'rmsprop': return RMSprop(lr=learning_rate) elif optimiser == 'adam': return Adam(lr=learning_rate) else: raise ValueError('Unknown optimiser. Please select either rmsprop or adam.') def select_loss(loss_name): """Select a loss function for the model.""" if loss_name == 'log_loss': return modified_binary_crossentropy_2 elif loss_name == 'mae': return modified_mean_absolute_error elif loss_name == 'mse': return modified_mean_squared_error_2 elif loss_name == 'balanced_mse': return modified_mean_squared_error_3 elif loss_name == 'balanced_mae': return modified_balanced_mean_absolute_error else: raise ValueError('Unknown loss function. Please select one of: log_loss, mae or mse.') def select_cell(cell_type, hidden_dim, l1=0.0, l2=0.0): """Select an RNN cell and initialises it with hidden_dim units.""" if cell_type == 'vanilla': return SimpleRNNCell(units=hidden_dim, kernel_regularizer=l1_l2(l1=l1, l2=l2), recurrent_regularizer=l1_l2(l1=l1, l2=l2)) elif cell_type == 'gru': return GRUCell(units=hidden_dim, kernel_regularizer=l1_l2(l1=l1, l2=l2), recurrent_regularizer=l1_l2(l1=l1, l2=l2)) elif cell_type == 'lstm': return LSTMCell(units=hidden_dim, kernel_regularizer=l1_l2(l1=l1, l2=l2), recurrent_regularizer=l1_l2(l1=l1, l2=l2)) else: raise ValueError('Unknown cell type. Please select one of: vanilla, gru, or lstm.') def set_up_logging(camera_id, root_log_dir=None, resume_training=None): log_dir = None if resume_training is not None: log_dir = os.path.dirname(resume_training) elif root_log_dir is not None: time_now = datetime.utcnow().strftime('%Y_%m_%d_%H_%M_%S') log_dir = os.path.join(root_log_dir, camera_id + '_' + time_now) os.makedirs(log_dir) return log_dir def resume_training_from_last_epoch(model, resume_training=None): last_epoch = 0 if resume_training is not None: model.load_weights(resume_training) last_epoch = int(os.path.basename(resume_training).split('_')[1]) return last_epoch def select_scaler_model(scaler_name): if scaler_name == 'standard': return StandardScaler() elif scaler_name == 'robust': return RobustScaler(quantile_range=(0.00, 50.0)) elif scaler_name == 'quantile': return QuantileTransformer(n_quantiles=1000, output_distribution='uniform', random_state=42) elif scaler_name == 'max_abs': return MaxAbsScaler() elif scaler_name == 'min_max': return MinMaxScaler() elif scaler_name == 'kde': return ScoreNormalization(method='KDE') elif scaler_name == 'gamma': return ScoreNormalization(method='gamma') elif scaler_name == 'chi2': return ScoreNormalization(method='chi2') else: raise ValueError('Unknown scaler. Please select one of: standard, robust, quantile, max_abs, min_max, ' 'kde, gamma, chi2.') return None ================================================ FILE: tbad/visualisation.py ================================================ import os import cv2 as cv import numpy as np from sklearn.preprocessing import MinMaxScaler COLOURS = {0: (0, 0, 0), # Black 1: (255, 0, 0), # Red 2: (0, 255, 0), # Lime 3: (0, 0, 255), # Blue 4: (255, 255, 0), # Yellow 5: (0, 255, 255), # Cyan / Aqua 6: (255, 0, 255), # Magenta / Fuchsia 7: (128, 128, 128), # Gray 8: (128, 0, 0), # Maroon 9: (128, 128, 0), # Olive 10: (0, 128, 0), # Green 11: (128, 0, 128), # Purple 12: (0, 128, 128), # Teal 13: (0, 0, 128), # Navy 14: (0, 0, 0), # White 15: (192, 192, 192), # Silver 16: (220, 20, 60), # Crimson 17: (255, 140, 0), # Dark Orange 18: (184, 134, 11), # Dark Golden Rod 19: (189, 183, 107), # Dark Khaki 20: (0, 100, 0)} # Dark Green def compute_bounding_box(keypoints, video_resolution, return_discrete_values=True): """Compute the bounding box of a set of keypoints. Argument(s): keypoints -- A numpy array, of shape (num_keypoints * 2,), containing the x and y values of each keypoint detected. video_resolution -- A numpy array, of shape (2,) and dtype float32, containing the width and the height of the video. Return(s): The bounding box of the keypoints represented by a 4-uple of integers. The order of the corners is: left, right, top, bottom. """ width, height = video_resolution keypoints_reshaped = keypoints.reshape(-1, 2) x, y = keypoints_reshaped[:, 0], keypoints_reshaped[:, 1] x, y = x[x != 0.0], y[y != 0.0] try: left, right, top, bottom = np.min(x), np.max(x), np.min(y), np.max(y) except ValueError: # print('All joints missing for input skeleton. Returning zeros for the bounding box.') return 0, 0, 0, 0 extra_width, extra_height = 0.1 * (right - left + 1), 0.1 * (bottom - top + 1) left, right = np.clip(left - extra_width, 0, width - 1), np.clip(right + extra_width, 0, width - 1) top, bottom = np.clip(top - extra_height, 0, height - 1), np.clip(bottom + extra_height, 0, height - 1) # left, right = left - extra_width, right + extra_width # top, bottom = top - extra_height, bottom + extra_height if return_discrete_values: return int(round(left)), int(round(right)), int(round(top)), int(round(bottom)) else: return left, right, top, bottom def compute_chest_centred_bounding_box(keypoints, video_resolution): """Compute the bounding box of a set of keypoints. Argument(s): keypoints -- A numpy array, of shape (num_keypoints * 2,), containing the x and y values of each keypoint detected. video_resolution -- A list containing the width and the height of the video. Return(s): The bounding box of the keypoints represented by a 4-uple of integers. The order of the corners is: left, right, top, bottom. """ selected_joints_x = [10, 12, 22, 24] selected_joints_y = [11, 13, 23, 25] width, height = [float(measurement) for measurement in video_resolution] keypoints = np.where(keypoints == 0.0, np.nan, keypoints) center_x = np.nanmean(keypoints[selected_joints_x]) center_y = np.nanmean(keypoints[selected_joints_y]) x, y = np.hsplit(keypoints.reshape(-1, 2), indices_or_sections=2) left, right, top, bottom = np.nanmin(x), np.nanmax(x), np.nanmin(y), np.nanmax(y) extra_width, extra_height = 0.1 * (right - left + 1), 0.1 * (bottom - top + 1) left, right = np.clip(left - extra_width, 0, width - 1), np.clip(right + extra_width, 0, width - 1) top, bottom = np.clip(top - extra_height, 0, height - 1), np.clip(bottom + extra_height, 0, height - 1) left, right, top, bottom = [int(round(corner)) for corner in (left, right, top, bottom)] bb_width, bb_height = right - left, bottom - top bb_left, bb_right = center_x - bb_width / 2, center_x + bb_width / 2 bb_top, bb_bottom = center_y - bb_height / 2, center_y + bb_height / 2 bb_left, bb_right, bb_top, bb_bottom = [int(round(corner)) for corner in (bb_left, bb_right, bb_top, bb_bottom)] return bb_left, bb_right, bb_top, bb_bottom def insert_anomaly_mask_from_bounding_box(mask, bounding_box): """Insert bounding box into anomaly mask. Argument(s): mask -- Pixel-mask identifying location of anomalies. It is a numpy array of dtype uint8 and shape (video_height, video_width). bounding_box -- A 4-uple of integers identifying the bounding box. The order of the corners is left, right, top, bottom. Return(s): The modified mask containing the inserted bounding box. """ left, right, top, bottom = bounding_box anomaly = np.ones((bottom - top + 1, right - left + 1), dtype=np.uint8) mask[top:(bottom + 1), left:(right + 1)] = anomaly return mask def render_article_main_figure(write_path, frames_path, gt_trajectories_path, bbs_path, trajectories_path, video_resolution): frames_names = sorted(os.listdir(frames_path)) # 000.jpg, 001.jpg, ... bbs_files = sorted(os.listdir(bbs_path))[1:2] # 001.csv, 002.csv, ... trajectories_files = sorted(os.listdir(trajectories_path))[1:2] # 001.csv, 002.csv, ... for person_id, bb_file_name in enumerate(bbs_files): gt_trajectory_file = os.path.join(gt_trajectories_path, bb_file_name) gt_trajectory = np.loadtxt(gt_trajectory_file, delimiter=',', ndmin=2) gt_trajectory_frames = gt_trajectory[:, 0].astype(np.int32) gt_trajectory_coordinates = gt_trajectory[:, 1:] gt_skeletons = dict(zip(gt_trajectory_frames, gt_trajectory_coordinates)) bb_file = os.path.join(bbs_path, bb_file_name) bb = np.loadtxt(bb_file, delimiter=',', ndmin=2) bb_frames = bb[:, 0].astype(np.int32) bb_coordinates = bb[:, 1:].astype(np.int32) skeletons_bb = dict(zip(bb_frames, bb_coordinates)) trajectory_file = os.path.join(trajectories_path, bb_file_name) trajectory = np.loadtxt(trajectory_file, delimiter=',', ndmin=2) trajectory_coordinates = trajectory[:, 1:] skeletons = dict(zip(bb_frames, trajectory_coordinates)) frame_id_start = 272 frame_id_end = frame_id_start + 20 frame = cv.imread(os.path.join(frames_path, frames_names[frame_id_start])) output_file = os.path.join(write_path, frames_names[frame_id_start]) gt_colour = (0, 0, 0) colour = (0, 0, 255) for frame_id in range(frame_id_start, frame_id_end, 6): gt_skeleton = gt_skeletons[frame_id] draw_skeleton(frame, gt_skeleton.reshape(-1, 2), gt_colour) # bb_left, bb_right, bb_top, bb_bottom = tuple(skeletons_bb[frame_id]) # bb_center = int(round((bb_left + bb_right) / 2)), int(round((bb_top + bb_bottom) / 2)) # cv.circle(frame, center=bb_center, radius=4, color=colour, thickness=-1) skeleton = skeletons[frame_id] draw_skeleton(frame, skeleton.reshape(-1, 2), colour) cv.imwrite(output_file, frame) def render_article_main_figure_2(write_path, frames_path, gt_trajectories_path): frames_names = sorted(os.listdir(frames_path)) # 000.jpg, 001.jpg, ... gt_trajectories_files = sorted(os.listdir(gt_trajectories_path)) # 001.csv, 002.csv, ... frame_id = 186 frame = cv.imread(os.path.join(frames_path, frames_names[frame_id])) output_file = os.path.join(write_path, frames_names[frame_id]) # colours = [(0, 255, 0), (0, 255, 0), (0, 0, 255)] + [(0, 255, 0)] * 7 colours = [(0, 255, 0)] * 10 for person_id, gt_trajectory_file_name in enumerate(gt_trajectories_files): gt_trajectory_file = os.path.join(gt_trajectories_path, gt_trajectory_file_name) gt_trajectory = np.loadtxt(gt_trajectory_file, delimiter=',', ndmin=2) gt_trajectory_frames = gt_trajectory[:, 0].astype(np.int32) gt_trajectory_coordinates = gt_trajectory[:, 1:] gt_skeletons = dict(zip(gt_trajectory_frames, gt_trajectory_coordinates)) gt_skeleton = gt_skeletons.get(frame_id) if gt_skeleton is not None: draw_skeleton(frame, gt_skeleton.reshape(-1, 2), colours[person_id]) cv.imwrite(output_file, frame) def draw_skeleton(frame, keypoints, colour, dotted=False): connections = [(0, 1), (0, 2), (1, 3), (2, 4), (5, 7), (7, 9), (6, 8), (8, 10), (11, 13), (13, 15), (12, 14), (14, 16), (3, 5), (4, 6), (5, 6), (5, 11), (6, 12), (11, 12)] for x, y in keypoints: if 0 in (x, y): continue center = int(round(x)), int(round(y)) cv.circle(frame, center=center, radius=4, color=colour, thickness=-1) for keypoint_id1, keypoint_id2 in connections: x1, y1 = keypoints[keypoint_id1] x2, y2 = keypoints[keypoint_id2] if 0 in (x1, y1, x2, y2): continue pt1 = int(round(x1)), int(round(y1)) pt2 = int(round(x2)), int(round(y2)) if dotted: draw_line(frame, pt1=pt1, pt2=pt2, color=colour, thickness=2, gap=5) else: cv.line(frame, pt1=pt1, pt2=pt2, color=colour, thickness=2) return None def draw_line(img, pt1, pt2, color, thickness=1, style='dotted', gap=10): dist = ((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2) ** .5 pts = [] for i in np.arange(0, dist, gap): r = i / dist x = int((pt1[0] * (1 - r) + pt2[0] * r) + .5) y = int((pt1[1] * (1 - r) + pt2[1] * r) + .5) p = (x, y) pts.append(p) if style == 'dotted': for p in pts: cv.circle(img, p, thickness, color, -1) else: s = pts[0] e = pts[0] i = 0 for p in pts: s = e e = p if i % 2 == 1: cv.line(img, s, e, color, thickness) i += 1 def draw_poly(img, pts, color, thickness=1, style='dotted'): s = pts[0] e = pts[0] pts.append(pts.pop(0)) for p in pts: s = e e = p draw_line(img, s, e, color, thickness, style) def draw_rect(img, pt1, pt2, color, thickness=1, style='dotted'): pts = [pt1, (pt2[0], pt1[1]), pt2, (pt1[0], pt2[1])] draw_poly(img, pts, color, thickness, style) def render_trajectories_skeletons(args): frames_path = args.frames gt_trajectories_path = args.ground_truth_trajectories draw_gt_skeleton = args.draw_ground_truth_trajectories_skeleton draw_gt_bounding_box = args.draw_ground_truth_trajectories_bounding_box trajectories_path = args.trajectories draw_trajectories_skeleton = args.draw_trajectories_skeleton draw_trajectories_bounding_box = args.draw_trajectories_bounding_box specific_person_id = args.person_id draw_local_skeleton = args.draw_local_skeleton gt_trajectories_colour = args.ground_truth_trajectories_colour trajectories_colour = args.trajectories_colour write_dir = args.write_dir if gt_trajectories_path is None and trajectories_path is None: raise ValueError('At least one of --ground_truth_trajectories or --trajectories must be specified.') if not any([draw_gt_skeleton, draw_gt_bounding_box, draw_trajectories_skeleton, draw_trajectories_bounding_box]): raise ValueError('At least one of --draw_ground_truth_trajectories_skeleton, ' '--draw_ground_truth_trajectories_bounding_box, --draw_trajectories_skeleton or ' '--draw_trajectories_bounding_box must be specified.') if draw_local_skeleton and specific_person_id is None: raise ValueError('If --draw_local_skeleton is specified, a --person_id must be chosen as well.') elif draw_local_skeleton: draw_gt_skeleton = draw_trajectories_skeleton = True draw_gt_bounding_box = draw_trajectories_bounding_box = False maybe_create_dir(write_dir) _render_trajectories_skeletons(write_dir, frames_path, gt_trajectories_path, trajectories_path, draw_gt_skeleton, draw_trajectories_skeleton, draw_gt_bounding_box, draw_trajectories_bounding_box, specific_person_id, draw_local_skeleton, gt_trajectories_colour, trajectories_colour) print('Visualisation successfully rendered to %s' % write_dir) return None def _render_trajectories_skeletons(write_dir, frames_path, gt_trajectories_path, trajectories_path, draw_gt_skeleton, draw_trajectories_skeleton, draw_gt_bounding_box, draw_trajectories_bounding_box, specific_person_id=None, draw_local_skeleton=False, gt_trajectories_colour=None, trajectories_colour=None): frames_names = sorted(os.listdir(frames_path)) # 000.jpg, 001.jpg, ... max_frame_id = len(frames_names) rendered_frames = {} if trajectories_path is not None: trajectories_files_names = sorted(os.listdir(trajectories_path)) # 001.csv, 002.csv, ... for trajectory_file_name in trajectories_files_names: person_id = int(trajectory_file_name.split('.')[0]) if specific_person_id is not None and specific_person_id != person_id: continue if trajectories_colour is None: colour = COLOURS[person_id % len(COLOURS)] else: colour = (0, 0, 0) if trajectories_colour == 'black' else (0, 0, 255) trajectory = np.loadtxt(os.path.join(trajectories_path, trajectory_file_name), delimiter=',', ndmin=2) trajectory_frames = trajectory[:, 0].astype(np.int32) trajectory_coordinates = trajectory[:, 1:] for frame_id, skeleton_coordinates in zip(trajectory_frames, trajectory_coordinates): if frame_id >= max_frame_id: break frame = rendered_frames.get(frame_id) if frame is None: frame = cv.imread(os.path.join(frames_path, frames_names[frame_id])) if draw_local_skeleton: frame = np.full_like(frame, fill_value=255) if draw_trajectories_skeleton: if draw_local_skeleton: height, width = frame.shape[:2] left, right, top, bottom = compute_simple_bounding_box(skeleton_coordinates) bb_center = np.array([(left + right) / 2, (top + bottom) / 2], dtype=np.float32) target_center = np.array([3 * width / 4, height / 2], dtype=np.float32) displacement_vector = target_center - bb_center draw_skeleton(frame, keypoints=skeleton_coordinates.reshape(-1, 2) + displacement_vector, colour=colour, dotted=True) else: draw_skeleton(frame, keypoints=skeleton_coordinates.reshape(-1, 2), colour=colour, dotted=True) if draw_trajectories_bounding_box: left, right, top, bottom = compute_simple_bounding_box(skeleton_coordinates) bb_center = int(round((left + right) / 2)), int(round((top + bottom) / 2)) cv.circle(frame, center=bb_center, radius=4, color=colour, thickness=-1) draw_rect(frame, pt1=(left, top), pt2=(right, bottom), color=colour, thickness=3, style='dotted') rendered_frames[frame_id] = frame if gt_trajectories_path is not None: gt_trajectories_files_names = sorted(os.listdir(gt_trajectories_path)) for gt_trajectory_file_name in gt_trajectories_files_names: person_id = int(gt_trajectory_file_name.split('.')[0]) if specific_person_id is not None and specific_person_id != person_id: continue if gt_trajectories_colour is None: colour = COLOURS[person_id % len(COLOURS)] else: colour = (0, 0, 0) if gt_trajectories_colour == 'black' else (0, 0, 255) gt_trajectory = np.loadtxt(os.path.join(gt_trajectories_path, gt_trajectory_file_name), delimiter=',', ndmin=2) gt_trajectory_frames = gt_trajectory[:, 0].astype(np.int32) gt_trajectory_coordinates = gt_trajectory[:, 1:] for frame_id, skeleton_coordinates in zip(gt_trajectory_frames, gt_trajectory_coordinates): frame = rendered_frames.get(frame_id) if frame is None: frame = cv.imread(os.path.join(frames_path, frames_names[frame_id])) if draw_local_skeleton: frame = np.full_like(frame, fill_value=255) skeleton_is_not_null = np.any(skeleton_coordinates) if draw_gt_skeleton and skeleton_is_not_null: if draw_local_skeleton: height, width = frame.shape[:2] left, right, top, bottom = compute_simple_bounding_box(skeleton_coordinates) bb_center = np.array([(left + right) / 2, (top + bottom) / 2], dtype=np.float32) target_center = np.array([width / 4, height / 2], dtype=np.float32) displacement_vector = target_center - bb_center keypoints = np.where(skeleton_coordinates == 0.0, np.nan, skeleton_coordinates).reshape(-1, 2) keypoints += displacement_vector keypoints = np.where(np.isnan(keypoints), 0.0, keypoints) draw_skeleton(frame, keypoints=keypoints, colour=colour) else: draw_skeleton(frame, keypoints=skeleton_coordinates.reshape(-1, 2), colour=colour) if draw_gt_bounding_box and skeleton_is_not_null: left, right, top, bottom = compute_simple_bounding_box(skeleton_coordinates) bb_center = int(round((left + right) / 2)), int(round((top + bottom) / 2)) cv.circle(frame, center=bb_center, radius=4, color=colour, thickness=-1) cv.rectangle(frame, pt1=(left, top), pt2=(right, bottom), color=colour, thickness=3) rendered_frames[frame_id] = frame for frame_id, frame_name in enumerate(frames_names): frame = rendered_frames.get(frame_id) if frame is None: frame = cv.imread(os.path.join(frames_path, frame_name)) if draw_local_skeleton: frame = np.full_like(frame, fill_value=255) cv.imwrite(os.path.join(write_dir, frame_name), img=frame) def maybe_create_dir(dir_path): if not os.path.exists(dir_path): os.makedirs(dir_path) return True return False def compute_simple_bounding_box(skeleton): x = skeleton[::2] x = np.where(x == 0.0, np.nan, x) left, right = int(round(np.nanmin(x))), int(round(np.nanmax(x))) y = skeleton[1::2] y = np.where(y == 0.0, np.nan, y) top, bottom = int(round(np.nanmin(y))), int(round(np.nanmax(y))) return left, right, top, bottom def render_video_diff_heatmaps(args): ground_truth_frames_dir = args.ground_truth_frames generated_frames_dir = args.generated_frames skip_first_n_frames = args.skip_first_n_frames write_dir = args.write_dir maybe_create_dir(write_dir) ground_truth_frames_names = sorted(os.listdir(ground_truth_frames_dir))[skip_first_n_frames:] generated_frames_names = sorted(os.listdir(generated_frames_dir)) for ground_truth_frame_name, generated_frame_name in zip(ground_truth_frames_names, generated_frames_names): ground_truth_frame = cv.imread(os.path.join(ground_truth_frames_dir, ground_truth_frame_name)) ground_truth_frame = cv.cvtColor(ground_truth_frame, code=cv.COLOR_BGR2GRAY) generated_frame = cv.imread(os.path.join(generated_frames_dir, generated_frame_name)) generated_frame = cv.cvtColor(generated_frame, code=cv.COLOR_BGR2GRAY) diff_frame = np.abs(generated_frame - ground_truth_frame) jet_frame = cv.applyColorMap(diff_frame, colormap=cv.COLORMAP_JET) cv.imwrite(os.path.join(write_dir, generated_frame_name), img=jet_frame) print('Heatmaps successfully rendered and written to %s' % write_dir) def render_video_diff_heatmaps_hasan(args): ground_truth_arr_file = args.ground_truth_array generated_arr_file = args.generated_array write_dir = args.write_dir maybe_create_dir(write_dir) ground_truth_arr = np.load(ground_truth_arr_file).astype(np.float32) ground_truth_arr = (ground_truth_arr + 1) * 127.5 generated_arr = np.load(generated_arr_file).astype(np.float32) generated_arr = (generated_arr + 1) * 127.5 diff_arr = np.abs(generated_arr - ground_truth_arr) diff_arr = diff_arr.astype(np.uint8) for frame_id, diff_frame in enumerate(diff_arr): jet_frame = cv.applyColorMap(diff_frame, colormap=cv.COLORMAP_JET) cv.imwrite(os.path.join(write_dir, '%.3d.jpg' % frame_id), img=jet_frame) print('Heatmaps successfully rendered and written to %s' % write_dir) def render_video_heatmaps_mpedrnn(args): frames_path = args.frames ground_truth_trajectories_dir = args.ground_truth_trajectories generated_trajectories_dir = args.generated_trajectories camera_id = args.camera_id video_id = args.video_id write_dir = args.write_dir camera_dirs = sorted(os.listdir(generated_trajectories_dir)) mses = [] for camera_dir in camera_dirs: video_dirs = sorted(os.listdir(os.path.join(generated_trajectories_dir, camera_dir))) for video_dir in video_dirs: generated_trajectories_files = os.listdir(os.path.join(generated_trajectories_dir, camera_dir, video_dir)) for generated_trajectory_file in generated_trajectories_files: generated_trajectory_file_path = os.path.join(generated_trajectories_dir, camera_dir, video_dir, generated_trajectory_file) generated_trajectory = np.loadtxt(generated_trajectory_file_path, delimiter=',', ndmin=2) generated_trajectory_frames = generated_trajectory[:, 0].astype(np.int32) generated_trajectory_coords = generated_trajectory[:, 1:] generated_trajectory_coords = np.where(generated_trajectory_coords == 0.0, np.nan, generated_trajectory_coords) generated_skeletons = dict(zip(generated_trajectory_frames, generated_trajectory_coords)) ground_truth_trajectory_file_path = os.path.join(ground_truth_trajectories_dir, camera_dir, video_dir, generated_trajectory_file) ground_truth_trajectory = np.loadtxt(ground_truth_trajectory_file_path, delimiter=',', ndmin=2) ground_truth_trajectory_frames = ground_truth_trajectory[:, 0].astype(np.int32) ground_truth_trajectory_coords = ground_truth_trajectory[:, 1:] ground_truth_trajectory_coords = np.where(ground_truth_trajectory_coords == 0.0, np.nan, ground_truth_trajectory_coords) ground_truth_skeletons = dict(zip(ground_truth_trajectory_frames, ground_truth_trajectory_coords)) for generated_frame, generated_skeleton in generated_skeletons.items(): ground_truth_skeleton = ground_truth_skeletons.get(generated_frame) if ground_truth_skeleton is None: continue num_non_null_coords = np.sum(np.logical_not(np.isnan(ground_truth_skeleton))) if num_non_null_coords == 0: continue mse = np.nansum((generated_skeleton - ground_truth_skeleton) ** 2) / num_non_null_coords mses.append(mse) mses = np.array(mses) mse_cutoff = np.quantile(mses, 0.95) mses[mses >= mse_cutoff] = mse_cutoff scaler = MinMaxScaler(feature_range=(50, 255)) scaler.fit(mses.reshape(-1, 1)) maybe_create_dir(write_dir) frames_names = os.listdir(frames_path) num_frames = len(frames_names) height, width = cv.imread(os.path.join(frames_path, frames_names[0])).shape[:2] canvas = np.full(shape=(num_frames, height, width), fill_value=0, dtype=np.uint8) generated_trajectories_files = os.listdir(os.path.join(generated_trajectories_dir, camera_id, video_id)) for generated_trajectory_file in generated_trajectories_files: generated_trajectory_file_path = os.path.join(generated_trajectories_dir, camera_id, video_id, generated_trajectory_file) generated_trajectory = np.loadtxt(generated_trajectory_file_path, delimiter=',', ndmin=2) generated_trajectory_frames = generated_trajectory[:, 0].astype(np.int32) generated_trajectory_coords = generated_trajectory[:, 1:] generated_trajectory_coords = np.where(generated_trajectory_coords == 0.0, np.nan, generated_trajectory_coords) generated_skeletons = dict(zip(generated_trajectory_frames, generated_trajectory_coords)) ground_truth_trajectory_file_path = os.path.join(ground_truth_trajectories_dir, camera_id, video_id, generated_trajectory_file) ground_truth_trajectory = np.loadtxt(ground_truth_trajectory_file_path, delimiter=',', ndmin=2) ground_truth_trajectory_frames = ground_truth_trajectory[:, 0].astype(np.int32) ground_truth_trajectory_coords = ground_truth_trajectory[:, 1:] ground_truth_trajectory_coords = np.where(ground_truth_trajectory_coords == 0.0, np.nan, ground_truth_trajectory_coords) ground_truth_skeletons = dict(zip(ground_truth_trajectory_frames, ground_truth_trajectory_coords)) for frame_id in ground_truth_skeletons.keys() & generated_skeletons.keys(): ground_truth_skeleton = ground_truth_skeletons[frame_id] generated_skeleton = generated_skeletons[frame_id] num_non_null_coords = np.sum(np.logical_not(np.isnan(ground_truth_skeleton))) if num_non_null_coords == 0: continue mse = np.nansum((generated_skeleton - ground_truth_skeleton) ** 2) / num_non_null_coords mse = scaler.transform(mse.reshape(-1, 1)).reshape(-1) ground_truth_skeleton_ = np.where(np.isnan(ground_truth_skeleton), 0.0, ground_truth_skeleton) draw_skeleton(canvas[frame_id], ground_truth_skeleton_.reshape(-1, 2), colour=mse) for frame_id, frame in enumerate(canvas): jet_frame = cv.applyColorMap(frame, colormap=cv.COLORMAP_JET) cv.imwrite(os.path.join(write_dir, '%.3d.jpg' % frame_id), img=jet_frame) print('Heatmaps successfully rendered and written to %s' % write_dir) ================================================ FILE: train.py ================================================ import argparse from tbad.gpu import configure_gpu_resources from tbad.autoencoder.train import train_ae from tbad.rnn_autoencoder.train import train_rnn_ae from tbad.combined_model.train import train_combined_model def create_arg_parser(): parser = argparse.ArgumentParser(description='Training Functions for Trajectory-Based Anomaly Detection.') gp_gpu = parser.add_argument_group('GPU') gp_gpu.add_argument('--gpu_ids', default='0', type=str, help='Which GPUs to use.') gp_gpu.add_argument('--gpu_memory_fraction', default=0.20, type=float, help='Fraction of the memory to grab from each GPU.') subparsers = parser.add_subparsers(title='sub-commands', description='Valid sub-commands.') # Create sub-parser for training of an Autoencoder parser_ae = subparsers.add_parser('autoencoder', help='Train an Autoencoder.') parser_ae.add_argument('trajectories', type=str, help='Path to directory containing training trajectories. For each video in the ' 'training set, there must be a folder inside this directory containing the ' 'trajectories.') parser_ae.add_argument('--video_resolution', default='856x480', type=str, help='Resolution of the trajectories\' original video(s). It should be specified ' 'as WxH, where W is the width and H the height of the video.') parser_ae.add_argument('--resume_training', type=str, help='Pre-trained model weights.') gp_ae_arch = parser_ae.add_argument_group('Model Architecture') gp_ae_arch.add_argument('--global_model', action='store_true', help='If this flag is specified, instead of training the Autoencoder ' 'on the joints of the skeletons, the model is trained on the center of ' 'mass (x*, y*) and on the width and height of the bounding box of the ' 'skeletons.') gp_ae_arch.add_argument('--hidden_dims', nargs='+', default=[16], type=int, help='Number of hidden units per hidden layer.') gp_ae_arch.add_argument('--output_activation', default='sigmoid', type=str, choices=['linear', 'sigmoid'], help='Activation function of the output layer.') gp_ae_hp = parser_ae.add_argument_group('Model Training Hyperparameters') gp_ae_hp.add_argument('--optimiser', default='adam', type=str, choices=['adam', 'rmsprop'], help='Optimiser for model training.') gp_ae_hp.add_argument('--learning_rate', default=0.001, type=float, help='Learning rate of the optimiser.') gp_ae_hp.add_argument('--loss', default='mse', type=str, choices=['log_loss', 'mae', 'mse'], help='Loss function to be minimised by the optimiser.') gp_ae_hp.add_argument('--epochs', default=5, type=int, help='Maximum number of epochs for training.') gp_ae_hp.add_argument('--batch_size', default=256, type=int, help='Mini-batch size for model training.') gp_ae_hp.add_argument('--coordinate_system', default='global', type=str, choices=['global', 'bounding_box_top_left', 'bounding_box_centre'], help='Which coordinate system to use.') gp_ae_hp.add_argument('--normalisation_strategy', default='zero_one', type=str, choices=['zero_one', 'three_stds', 'robust'], help='Strategy for normalisation of the skeletons.') gp_ae_logging = parser_ae.add_argument_group('Model Logging') gp_ae_logging.add_argument('--root_log_dir', type=str, help='TODO.') parser_ae.set_defaults(func=train_ae) # Create sub-parser for training of an RNN Autoencoder parser_rnn_ae = subparsers.add_parser('rnn_autoencoder', help='Train an RNN Autoencoder.') parser_rnn_ae.add_argument('trajectories', type=str, help='Path to training trajectories.') parser_rnn_ae.add_argument('--video_resolution', default='856x480', type=str, help='Resolution of the trajectories\' original video(s).') parser_rnn_ae.add_argument('--resume_training', type=str, help='Pre-trained model weights.') gp_rnn_ae_arch = parser_rnn_ae.add_argument_group('Model Architecture') gp_rnn_ae_arch.add_argument('--model_type', default='plain', type=str, choices=['plain', 'global', 'concatenate'], help='Select the model type. If plain, no modifications are done to the input data. ' 'If global, the RNN is trained on the center of mass (x*, y*) and on the width ' 'and height of the bounding box of the skeletons. If concatenate, the RNN is ' 'trained on the concatenation of the global model features with the joints of the ' 'skeletons centered at their bounding box (local model).') gp_rnn_ae_arch.add_argument('--extract_delta', action='store_true', help='Only meaningful if model_type is global. If specified, include the difference ' 'between consecutive time-steps in addition to the absolute x and y coordinates.') gp_rnn_ae_arch.add_argument('--use_first_step_as_reference', action='store_true', help='Only meaningful if model type is global. If specified, use the difference ' 'between all time-steps and the first time-step instead of the absolute x and ' 'y coordinates.') gp_rnn_ae_arch.add_argument('--input_length', default=8, type=int, help='Number of input time-steps to encode.') gp_rnn_ae_arch.add_argument('--input_gap', default=0, type=int, help='Number of input time-steps to skip during encoding.') gp_rnn_ae_arch.add_argument('--rec_length', default=8, type=int, help='Number of time-steps to decode from the input sequence.') gp_rnn_ae_arch.add_argument('--pred_length', default=0, type=int, help='Number of time-steps to predict into future. Ignored if 0.') gp_rnn_ae_arch.add_argument('--reconstruct_reverse', action='store_true', help='Whether to reconstruct the reverse of the input sequence or not.') gp_rnn_ae_arch.add_argument('--cell_type', default='gru', type=str, choices=['vanilla', 'gru', 'lstm'], help='Type of cell used by the RNN.') gp_rnn_ae_arch.add_argument('--hidden_dims', nargs='+', default=[16], type=int, help='Number of hidden units per hidden layer.') gp_rnn_ae_arch.add_argument('--output_activation', default='sigmoid', type=str, choices=['linear', 'sigmoid'], help='Activation function of the output layer.') gp_rnn_ae_arch.add_argument('--disable_reconstruction_branch', action='store_false', help='') gp_rnn_ae_arch.add_argument('--conditional_reconstruction', action='store_true', help='') gp_rnn_ae_arch.add_argument('--conditional_prediction', action='store_true', help='') gp_rnn_ae_hp = parser_rnn_ae.add_argument_group('Model Training Hyperparameters') gp_rnn_ae_hp.add_argument('--optimiser', default='adam', type=str, choices=['adam', 'rmsprop'], help='Optimiser to train model.') gp_rnn_ae_hp.add_argument('--learning_rate', default=0.001, type=float, help='Learning rate of the optimiser.') gp_rnn_ae_hp.add_argument('--loss', default='mse', type=str, choices=['log_loss', 'mae', 'mse'], help='Loss function to be minimised by the optimiser.') gp_rnn_ae_hp.add_argument('--l1_reg', default=0.0, type=float, help='Amount of L1 regularisation added to the model weights.') gp_rnn_ae_hp.add_argument('--l2_reg', default=0.0, type=float, help='Amount of L2 regularisation added to the model weights.') gp_rnn_ae_hp.add_argument('--epochs', default=5, type=int, help='Maximum number of epochs for training.') gp_rnn_ae_hp.add_argument('--batch_size', default=256, type=int, help='Mini-batch size for model training.') gp_rnn_ae_hp.add_argument('--input_missing_steps', action='store_true', help='Fill missing steps of trajectories with a weighted combination of ' 'the closest non-missing steps.') gp_rnn_ae_hp.add_argument('--coordinate_system', default='global', type=str, choices=['global', 'bounding_box_top_left', 'bounding_box_centre'], help='Which coordinate system to use.') gp_rnn_ae_hp.add_argument('--normalisation_strategy', default='zero_one', type=str, choices=['zero_one', 'three_stds', 'robust'], help='Strategy for normalisation of the trajectories.') gp_rnn_ae_logging = parser_rnn_ae.add_argument_group('Model Logging') gp_rnn_ae_logging.add_argument('--root_log_dir', type=str, help='Root directory to write: trained weights, training report and ' 'model architecture. A time-stamped sub-directory is created to save ' 'all files. Ignored if resume_training is specified.') parser_rnn_ae.set_defaults(func=train_rnn_ae) # Create sub-parser for training of the combined global and local RNN model parser_combined_model = subparsers.add_parser('combined_model', help='Train a Global + Local RNN Autoencoder.') parser_combined_model.add_argument('trajectories', type=str, help='Path to training trajectories.') parser_combined_model.add_argument('--video_resolution', default='856x480', type=str, help='Video resolution of the videos from where the trajectories ' 'were extracted.') parser_combined_model.add_argument('--resume_training', type=str, help='Pre-trained model weights.') gp_combined_model_arch = parser_combined_model.add_argument_group('Model Architecture') gp_combined_model_arch.add_argument('--message_passing', action='store_true', help='Whether to perform message passing between the global and local branches ' 'or not.') gp_combined_model_arch.add_argument('--reconstruct_original_data', action='store_true', help='Whether to reconstruct the original trajectories or the concatenation ' 'of the output of the global and local models.') gp_combined_model_arch.add_argument('--multiple_outputs', action='store_true', help='If specified, the network also outputs the global and local ' 'reconstructions/predictions.') gp_combined_model_arch.add_argument('--multiple_outputs_before_concatenation', action='store_true', help='Only meaningful if multiple_outputs is specified as well. If specified,' 'the global and local outputs are created before concatenation of the ' 'branches.') gp_combined_model_arch.add_argument('--input_length', default=16, type=int, help='Number of input time-steps to encode.') gp_combined_model_arch.add_argument('--rec_length', default=16, type=int, help='Number of time-steps to decode from the input sequence.') gp_combined_model_arch.add_argument('--pred_length', default=2, type=int, help='Number of time-steps to predict into future. Ignored if 0.') gp_combined_model_arch.add_argument('--reconstruct_reverse', action='store_true', help='Whether to reconstruct the reverse of the input sequence or ' 'not.') gp_combined_model_arch.add_argument('--cell_type', default='gru', type=str, choices=['vanilla', 'gru', 'lstm'], help='Type of cell used by the RNN.') gp_combined_model_arch.add_argument('--global_hidden_dims', nargs='+', default=[2], type=int, help='Number of hidden units per hidden layer of the global model.') gp_combined_model_arch.add_argument('--local_hidden_dims', nargs='+', default=[16], type=int, help='Number of hidden units per hidden layer of the local model.') gp_combined_model_arch.add_argument('--extra_hidden_dims', nargs='+', default=[], type=int, help='Number of hidden units per hidden layer after concatenation ' 'of the global and local models.') gp_combined_model_arch.add_argument('--output_activation', default='sigmoid', type=str, choices=['linear', 'sigmoid'], help='Activation function of the output layer.') gp_combined_model_hp = parser_combined_model.add_argument_group('Model Training Hyperparameters') gp_combined_model_hp.add_argument('--optimiser', default='adam', type=str, choices=['adam', 'rmsprop'], help='Optimiser to train model.') gp_combined_model_hp.add_argument('--learning_rate', default=0.001, type=float, help='Learning rate of the optimiser.') gp_combined_model_hp.add_argument('--loss', default='mse', type=str, choices=['log_loss', 'mae', 'mse', 'balanced_mse', 'balanced_mae'], help='Loss function to be minimised by the optimiser.') gp_combined_model_hp.add_argument('--l1_reg', default=0.0, type=float, help='Amount of L1 regularisation added to the model weights.') gp_combined_model_hp.add_argument('--l2_reg', default=0.0, type=float, help='Amount of L2 regularisation added to the model weights.') gp_combined_model_hp.add_argument('--epochs', default=5, type=int, help='Maximum number of epochs for training.') gp_combined_model_hp.add_argument('--batch_size', default=256, type=int, help='Mini-batch size for model training.') gp_combined_model_hp.add_argument('--input_missing_steps', action='store_true', help='Fill missing steps of trajectories with a weighted combination of ' 'the closest non-missing steps.') gp_combined_model_hp.add_argument('--global_normalisation_strategy', default='zero_one', type=str, choices=['zero_one', 'three_stds', 'robust'], help='Global normalisation strategy.') gp_combined_model_hp.add_argument('--local_normalisation_strategy', default='zero_one', type=str, choices=['zero_one', 'three_stds', 'robust'], help='Local normalisation strategy.') gp_combined_model_hp.add_argument('--out_normalisation_strategy', default='zero_one', type=str, choices=['zero_one', 'three_stds', 'robust']) gp_combined_model_logging = parser_combined_model.add_argument_group('Model Logging') gp_combined_model_logging.add_argument('--root_log_dir', type=str, help='Root directory to write: trained weights, training report ' 'and model architecture. A time-stamped sub-directory is ' 'created to save all files. Ignored if resume_training is ' 'specified.') parser_combined_model.set_defaults(func=train_combined_model) return parser def main(): arg_parser = create_arg_parser() args = arg_parser.parse_args() configure_gpu_resources(args.gpu_ids, args.gpu_memory_fraction) args.func(args) if __name__ == '__main__': main() ================================================ FILE: utils/metrics.py ================================================ import numpy as np from sklearn.metrics import roc_auc_score, average_precision_score from tbad.data import input2table from tbad.losses import binary_crossentropy, mean_squared_error, mean_absolute_error def frame_level_metrics(anomaly_masks, reconstruction_errors, reconstruction_frames): y_true, y_hat = {}, {} for full_id in anomaly_masks: _, video_id = full_id.split('_') y_true[video_id] = anomaly_masks[full_id].astype(np.int64) y_hat[video_id] = np.zeros_like(y_true[video_id], dtype=np.float64) for trajectory_id in reconstruction_errors: video_id, _ = trajectory_id.split('_') frames = reconstruction_frames[trajectory_id].astype(np.int64) y_hat[video_id][frames] = np.maximum(y_hat[video_id][frames], reconstruction_errors[trajectory_id]) y_true_, y_hat_ = [], [] for video_id in sorted(y_true.keys()): y_true_.append(y_true[video_id]) y_hat_.append(y_hat[video_id]) y_true_, y_hat_ = np.concatenate(y_true_), np.concatenate(y_hat_) return roc_auc_score(y_true_, y_hat_), average_precision_score(y_true_, y_hat_) def ground_truth_and_reconstructions(anomaly_masks, reconstruction_errors, reconstruction_frames): y_true, y_hat = {}, {} for full_id in anomaly_masks: _, video_id = full_id.split('_') y_true[video_id] = anomaly_masks[full_id].astype(np.int64) y_hat[video_id] = np.zeros_like(y_true[video_id], dtype=np.float64) for trajectory_id in reconstruction_errors: video_id, _ = trajectory_id.split('_') frames = reconstruction_frames[trajectory_id].astype(np.int64) y_hat[video_id][frames] = np.maximum(y_hat[video_id][frames], reconstruction_errors[trajectory_id]) y_true_, y_hat_, video_ids = [], [], [] for video_id in sorted(y_true.keys()): y_true_.append(y_true[video_id]) y_hat_.append(y_hat[video_id]) video_ids.extend([video_id] * len(y_true_[-1])) y_true_, y_hat_ = np.concatenate(y_true_), np.concatenate(y_hat_) return y_true_, y_hat_, video_ids def summarise_errors_per_frame(trajectory_errors_per_frame, trajectory_frames, summary_fn=np.mean): """Summarises the error of a frame. Argument(s): trajectory_errors_per_frame -- A numpy array of shape (trajectory_length,). trajectory_frames -- A numpy array of shape (trajectory_length // input_seq_len, input_seq_len). summary_fn -- A function to summarise errors that belong to the same frame. """ trajectory_frames_reshaped = trajectory_frames.reshape(-1).astype(np.int64) frame_ids = np.unique(trajectory_frames_reshaped) summarised_errors = np.empty_like(frame_ids, dtype=np.float64) for frame_index, frame_id in enumerate(frame_ids): summarised_errors[frame_index] = summary_fn(trajectory_errors_per_frame[trajectory_frames_reshaped == frame_id]) return summarised_errors def compute_reconstruction_errors(trajectories_coordinates, reconstructed_trajectories_coordinates, loss='mse'): loss_fn = {'log_loss': binary_crossentropy, 'mae': mean_absolute_error, 'mse': mean_squared_error}[loss] reconstruction_errors = {} for trajectory_id in trajectories_coordinates: trajectory_coordinates_tbl = input2table(trajectories_coordinates[trajectory_id]) reconstructed_trajectory_coordinates_tbl = input2table(reconstructed_trajectories_coordinates[trajectory_id]) reconstruction_error_per_frame = loss_fn(trajectory_coordinates_tbl, reconstructed_trajectory_coordinates_tbl) reconstruction_errors[trajectory_id] = reconstruction_error_per_frame return reconstruction_errors def summarise_reconstruction_errors(reconstruction_errors, trajectories_frames, summary_fn=np.mean): for trajectory_id in reconstruction_errors: reconstruction_error_per_frame = reconstruction_errors[trajectory_id] reconstruction_errors[trajectory_id] = summarise_errors_per_frame(reconstruction_error_per_frame, trajectories_frames[trajectory_id], summary_fn=summary_fn) return reconstruction_errors def discard_errors_from_padded_frames(reconstruction_errors, original_trajectory_lengths): """Discard errors from padded frames. Argument(s): reconstruction_errors: A dictionary where the keys identify the trajectory (video + person) and the values are numpy arrays of shape (trajectory_length,) containing the reconstruction error of each step. original_trajectory_lengths: A dictionary where the keys identify the trajectory (video + person) and the values are integers identifying the original length of the trajectory. Return(s): A dictionary similar to reconstruction_errors but the trajectories have the right length. """ for trajectory_id in reconstruction_errors: original_length = original_trajectory_lengths[trajectory_id] reconstruction_errors[trajectory_id] = reconstruction_errors[trajectory_id][:original_length] return reconstruction_errors ================================================ FILE: utils/score_scaling.py ================================================ import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm from sklearn.neighbors import KernelDensity import scipy.stats as stats class ScoreNormalization: def __init__(self, method="KDE", options=None): self.method = method self.options = {} if options is None else options self.name = "_".join([method]+["-".join([str(key), str(value)]) for key, value in self.options.items()]) if self.method == "KDE": kernel = self.options.get("kernel", "gaussian") bandwidth = self.options.get("bandwidth", 0.75) self.kde = KernelDensity(kernel=kernel, bandwidth=bandwidth) elif self.method == "histogram": raise ("Not implemented method {}".format(self.method)) elif self.method == "gamma": self.k = self.options.get("k", 1) self.loc = self.options.get("loc", 0) self.theta = self.options.get("theta", 1.5) elif self.method == "chi2": self.df = self.options.get("df", 2) self.loc = self.options.get("loc", 0) self.scale = self.options.get("scale", 0.5) else: raise ("Invalid method {}".format(self.method)) def fit(self, X): if self.method == "KDE": self.kde.fit(X) elif self.method == "histogram": raise ("Not implemented method {}".format(self.method)) elif self.method == "gamma": self.fit_k, self.fit_loc, self.fit_theta = stats.gamma.fit(X, self.k, loc=self.loc, scale=self.theta) elif self.method == "chi2": self.fit_df, self.fit_loc, self.fit_scale = stats.chi2.fit(X, self.df, loc=self.loc, scale=self.scale) pass else: raise ("Invalid method {}".format(self.method)) def score(self, x): if self.method == "KDE": return self.kde.score_samples(x) elif self.method == "gamma": return 1 - stats.gamma.cdf(x, self.fit_k, self.fit_loc, self.fit_theta) elif self.method == "chi2": return 1 - stats.chi2.cdf(x, self.fit_df, self.fit_loc, self.fit_scale) elif self.method == "histogram": raise ("Not implemented method {}".format(self.method)) else: raise ("Invalid method {}".format(self.method)) transform = score def get_fit_params_string(self): if self.method == "KDE": return "" elif self.method == "gamma": return "fit_k %3.1f fit_loc %3.1f fit_theta %3.1f" % (self.fit_k, self.fit_loc, self.fit_theta) elif self.method == "chi2": return "fit_df %s, fit_loc %s, fit_scale %s" % (self.fit_df, self.fit_loc, self.fit_scale) elif self.method == "histogram": return "" else: raise ("Invalid method {}".format(self.method)) def get_fit_params(self): if self.method == "KDE": return "" elif self.method == "gamma": return self.fit_k, self.fit_loc, self.fit_theta elif self.method == "chi2": return self.fit_df, self.fit_loc, self.fit_scale elif self.method == "histogram": return "" else: raise ("Invalid method {}".format(self.method)) def normalizing_lstm_autoencoder(training_sample_rate=1): """ models=[ ScoreNormalization(method="KDE", options={"kernel": "gaussian", "bandwidth": 0.01}), ScoreNormalization(method="KDE", options={"kernel": "gaussian", "bandwidth": 0.001}), ScoreNormalization(method="KDE", options={"kernel": "gaussian", "bandwidth": 0.0001}) ] """ models = [ScoreNormalization(method="gamma", options={})] # models = [ScoreNormalization(method="chi2", options={})] training_file = "/data/romero/ShanghaiTech/training/anomaly_model_output/reconstruction_errors_mse.npz" testing_file = "/data/romero/ShanghaiTech/testing/anomaly_model_output/reconstruction_errors_mse.npz" all_training_score = np.load(training_file) all_testing_score = np.load(testing_file) test_normed_score = {} train_normed_score = {} final_train_scores = {} final_test_scores = {} for cam_id in range(len(all_training_score.files)): training_score = all_training_score["arr_{}".format(cam_id)] testing_score = all_testing_score["arr_{}".format(cam_id)] is_non_zero_training_score = training_score > 0.0 non_zero_training_score = training_score[is_non_zero_training_score].reshape(-1, 1) non_zero_training_score = non_zero_training_score[0::training_sample_rate] is_non_zero_testing_score = testing_score > 0.0 non_zero_testing_score = testing_score[is_non_zero_testing_score].reshape(-1, 1) for model in models: model.fit(non_zero_training_score) train_normed_score[cam_id] = model.score(non_zero_training_score) test_normed_score[cam_id] = model.score(non_zero_testing_score) training_score = training_score.ravel() training_score[is_non_zero_training_score] = train_normed_score[cam_id].ravel() testing_score = testing_score.ravel() testing_score[is_non_zero_testing_score] = test_normed_score[cam_id].ravel() plot_title = 'camera ' + str(cam_id + 1) + ' ' + model.name + '_' + model.get_fit_params_string() visualize(non_zero_training_score, non_zero_testing_score, train_normed_score[cam_id], test_normed_score[cam_id], plot_title=plot_title) final_train_scores[cam_id] = training_score final_test_scores[cam_id] = testing_score def normalizing_3Dconv(): pass def visualize(X, X_test, dens_train, dens, plot_title): #---------------------------------------------------------------------- # Plot the progression of histograms to kernels num_bins = 50 fig, ax = plt.subplots() # histogram 1 # weights = np.ones_like(X) / float(num_bins) n, bins, patches = ax.hist(X, bins=num_bins, density=True, log=True, alpha=0.6, fc='#AAAAFF') ax.set_ylabel("Histogram") # p = X_test.ravel().argsort() # X_test = X_test.ravel()[p] # dens = dens[p] # p = X.ravel().argsort() # X = X.ravel()[p] # dens_train = dens_train[p] # ax.plot(X_test, dens, 'g-', label="test") # ax.plot(X, dens_train, 'k-', label="train") ax.scatter(X, dens_train, c='g', alpha=0.7, label='train') ax.scatter(X_test, dens, c='r', alpha=0.2, label='test') ax.legend(loc='upper left') ax.set_title(plot_title) plt.show() pass if __name__ == '__main__': normalizing_lstm_autoencoder(training_sample_rate=1) ================================================ FILE: visualise.py ================================================ import argparse from tbad.visualisation import render_trajectories_skeletons, render_video_diff_heatmaps from tbad.visualisation import render_video_diff_heatmaps_hasan, render_video_heatmaps_mpedrnn def create_arg_parser(): parser = argparse.ArgumentParser(description='Functions for Visualisation of Skeletons.') subparsers = parser.add_subparsers(title='sub-commands', description='Valida sub-commands.') # Visualisation of reconstructed/predicted skeletons and their bounding boxes parser_skeletons = subparsers.add_parser('skeletons', help='Visualise Reconstructed/Predicted Skeletons and ' 'their Bounding Boxes.') parser_skeletons.add_argument('frames', type=str, help='Directory containing video frames.') parser_skeletons.add_argument('--ground_truth_trajectories', type=str, help='Directory containing the ground-truth trajectories of people in the video.') parser_skeletons.add_argument('--draw_ground_truth_trajectories_skeleton', action='store_true', help='Whether to draw the ground-truth skeletons or not.') parser_skeletons.add_argument('--draw_ground_truth_trajectories_bounding_box', action='store_true', help='Whether to draw the bounding box of the ground-truth skeletons or not.') parser_skeletons.add_argument('--trajectories', type=str, help='Directory containing the reconstructed/predicted trajectories of people in ' 'the video.') parser_skeletons.add_argument('--draw_trajectories_skeleton', action='store_true', help='Whether to draw the reconstructed/predicted skeleton or not.') parser_skeletons.add_argument('--draw_trajectories_bounding_box', action='store_true', help='Whether to draw the bounding box of the reconstructed/predicted trajectories ' 'or not.') parser_skeletons.add_argument('--person_id', type=int, help='Draw only a specific person in the video.') parser_skeletons.add_argument('--draw_local_skeleton', action='store_true', help='If specified, draw local skeletons on a white background. It must be used ' 'in conjunction with --person_id, since it is only possible to visualise ' 'one pair (ground-truth, reconstructed/predicted) of local skeletons.') parser_skeletons.add_argument('--ground_truth_trajectories_colour', type=str, choices=['black', 'red'], help='Draw the ground-truth skeletons and bounding boxes in either black or red.' ' If not specified, colours are automatic assigned to skeletons and bounding ' 'boxes.') parser_skeletons.add_argument('--trajectories_colour', type=str, choices=['black', 'red'], help='Draw the reconstructed/predicted skeletons and bounding boxes in either ' 'black or red. If not specified, colours are automatic assigned to skeletons ' 'and bounding boxes.') parser_skeletons.add_argument('--write_dir', type=str, help='Directory to write rendered frames. If the specified directory does not ' 'exist, it will be created.') parser_skeletons.set_defaults(func=render_trajectories_skeletons) # Heatmap of the difference between two videos when the inputs are the video's frames parser_video_diff = subparsers.add_parser('video_diff', help='Visualise heatmap of the differences between ground-truth and ' 'reconstructed/predicted frames of a video.') parser_video_diff.add_argument('ground_truth_frames', type=str, help='Directory containing the ground-truth frames of a video.') parser_video_diff.add_argument('generated_frames', type=str, help='Directory containing the reconstructed/predicted frames of a video.') parser_video_diff.add_argument('--skip_first_n_frames', default=0, type=int, help='In case the reconstructed/predicted frames do not include some frames in the ' 'beginning, these can be skipped.') parser_video_diff.add_argument('--write_dir', type=str, help='Directory to write heatmaps. If the specified directory does not exist, ' 'it will be created.') parser_video_diff.set_defaults(func=render_video_diff_heatmaps) # Heatmap of the difference between two videos for Hasan's output (227x227 numpy arrays) parser_video_diff_hasan = subparsers.add_parser('video_diff_hasan', help='Visualise heatmap of the differences between ground-truth ' 'and reconstructed/predicted frames of a video.') parser_video_diff_hasan.add_argument('ground_truth_array', type=str, help='.npy file containing the grayscale intensity values of the ground-truth ' 'images.') parser_video_diff_hasan.add_argument('generated_array', type=str, help='.npy file containing the grayscale reconstructed/predicted intensity ' 'values of the generated image.') parser_video_diff_hasan.add_argument('--write_dir', type=str, help='Directory to write heatmaps. If the specified directory does not ' 'exist, it will be created.') parser_video_diff_hasan.set_defaults(func=render_video_diff_heatmaps_hasan) # Heatmap of our proposed method parser_heatmap_mpedrnn = subparsers.add_parser('video_heatmap_mpedrnn', help='Visualise heatmap of the skeletons in the video.') parser_heatmap_mpedrnn.add_argument('frames', type=str, help='Directory containing the video frames.') parser_heatmap_mpedrnn.add_argument('ground_truth_trajectories', type=str, help='Directory containing ground-truth trajectories of all skeletons in ' 'every camera and every video in the test set.') parser_heatmap_mpedrnn.add_argument('generated_trajectories', type=str, help='Directory containing generated trajectories of all skeletons in every ' 'camera and every video in the test set.') parser_heatmap_mpedrnn.add_argument('--camera_id', default='01', type=str, help='Which camera to plot heatmap.') parser_heatmap_mpedrnn.add_argument('--video_id', default='0014', type=str, help='Which video to plot heatmap.') parser_heatmap_mpedrnn.add_argument('--write_dir', type=str, help='Directory to write heatmaps. If the specified directory does not ' 'exist, it will be created.') parser_heatmap_mpedrnn.set_defaults(func=render_video_heatmaps_mpedrnn) return parser def main(): arg_parser = create_arg_parser() args = arg_parser.parse_args() args.func(args) if __name__ == '__main__': main()