├── .gitignore ├── README.md ├── environment.lock.yml ├── environment.yml ├── environment1.yml ├── jupyter-lab.sh ├── older version ├── t01 │ ├── demo_package │ │ ├── __init__.py │ │ └── demo_module.py │ └── tutorial1-Python_Pytorch.ipynb ├── t02 │ ├── imgs │ │ ├── error_types.png │ │ ├── neuron.png │ │ ├── perceptron.png │ │ ├── sgd1d.png │ │ └── sgd2d_2.png │ ├── plot_utils.py │ └── tutorial2-Logistic_Regression.ipynb ├── t03 │ ├── imgs │ │ ├── linear_discriminant.png │ │ ├── mlp.png │ │ ├── neuron.png │ │ ├── nonlinear_datasets.png │ │ ├── overfit_1-2-4HL_3N.jpg │ │ ├── overfit_1HL_3-6-20N.jpg │ │ ├── perceptron.png │ │ └── perceptron_db.png │ └── tutorial3-MLP.ipynb ├── t04 │ ├── img │ │ ├── 1x1_conv.png │ │ ├── arch.png │ │ ├── cat_translation.png │ │ ├── classification.png │ │ ├── cnn_filters.png │ │ ├── cnn_layer.jpeg │ │ ├── cnn_layers.jpeg │ │ ├── conv.gif │ │ ├── deeper_meme.jpeg │ │ ├── depthcol.jpeg │ │ ├── feature_hierarchy.png │ │ ├── filter_resp.png │ │ ├── fully_conv.png │ │ ├── maxpool.png │ │ ├── mlp.png │ │ ├── net_archs.png │ │ ├── overfit_1-2-4HL_3N.jpg │ │ ├── overfit_1HL_3-6-20N.jpg │ │ ├── pooling_invariance.png │ │ ├── receptive_field.png │ │ ├── receptive_field2.png │ │ ├── regression.png │ │ ├── resnet_arch_table.png │ │ ├── resnet_block.png │ │ ├── resnet_block2.png │ │ ├── resnet_plain_deep_error.png │ │ ├── toeplitz.png │ │ ├── vanilla_dnn_scale.png │ │ ├── zf1.png │ │ └── zf2.png │ └── tutorial4-CNNs.ipynb ├── t05 │ ├── DJIA_30 │ │ └── all_stocks_2006-01-01_to_2018-01-01.csv.gz │ ├── imgs │ │ ├── backprop-graph.png │ │ ├── backprop-modular.png │ │ ├── bilevel.png │ │ ├── enc-pred-dec.png │ │ ├── sgd-init.png │ │ ├── sgd-loss.png │ │ ├── sgd-lr-schedule.png │ │ ├── sgd-lr.png │ │ └── sgd-zigzag.png │ └── tutorial5-Optimization.ipynb ├── t06 │ ├── img │ │ ├── bptt.png │ │ ├── causal_convolution.png │ │ ├── cnn_filters.png │ │ ├── mlp.png │ │ ├── rnn_cell.png │ │ ├── rnn_layered.png │ │ ├── rnn_unrolled.png │ │ ├── rnn_use_cases.jpeg │ │ ├── sentiment_analysis.png │ │ ├── tbptt.png │ │ ├── tcn.png │ │ └── word_embeddings.png │ └── tutorial6-SeqModels.ipynb ├── t07 │ ├── img │ │ ├── GRU.png │ │ ├── attention-layer.png │ │ ├── bahdanau2015-annotated.png │ │ ├── bahdanau2015.png │ │ ├── enc_dec.png │ │ ├── rnn_layered.png │ │ ├── rnn_unrolled.png │ │ ├── self_attn_transformer.svg │ │ ├── seq2seq.svg │ │ ├── seq2seq1.png │ │ ├── seq2seq_attention.svg │ │ ├── seq2seq_predict.svg │ │ ├── sutskever2014_pca.png │ │ ├── xu2015_1.png │ │ └── xu2015_2.png │ └── tutorial7-Attention.ipynb ├── t08 │ ├── img │ │ ├── cifar10.png │ │ ├── cifar10_100.png │ │ ├── cnn_feature_vis.png │ │ ├── data_dist.jpg │ │ ├── ganin_da.png │ │ ├── ganin_da2.png │ │ ├── ganin_da3.png │ │ ├── mnist_m.png │ │ ├── pan_yang.png │ │ ├── target-dist-shift.png │ │ ├── temp-dist.jpg │ │ ├── tl_example.png │ │ ├── transfer-learning-medical.png │ │ ├── transfer_learning_digits.png │ │ ├── transferlearning.png │ │ ├── zf1.png │ │ └── zf2.png │ ├── tut7 │ │ ├── data.py │ │ └── plot_utils.py │ └── tutorial7-TL_DA.ipynb ├── t09 │ ├── .gitignore │ ├── atari_wrappers.py │ ├── img │ │ ├── deepmind_arch.png │ │ ├── deepmind_frames.png │ │ ├── deepmind_results1.png │ │ ├── deepmind_results2.png │ │ ├── mdp.png │ │ ├── mdp2.png │ │ ├── mdp_transition_prob.png │ │ ├── q_expectation.png │ │ ├── rl_episodes.png │ │ ├── rl_fields.png │ │ ├── rl_setting.png │ │ ├── rl_setting2.png │ │ ├── space-invaders-atari-2600.jpg │ │ └── v_expectation.png │ └── tutorial9-DeepRL.ipynb ├── t10 │ ├── img │ │ ├── conv.gif │ │ ├── gcn.png │ │ ├── laplacian_eigenfunctions.png │ │ ├── random_graph.png │ │ ├── spectral_generalization.png │ │ └── toeplitz.png │ └── tutorial10-GeometricDL.ipynb └── t11 │ ├── img │ ├── block_scheduling.png │ ├── execution_model.png │ ├── grid_blocks.png │ ├── hetero.png │ ├── host_device.png │ ├── kernel.png │ ├── kernel_geom.png │ ├── matmul_noshared.png │ ├── matmul_shared.png │ ├── mem_global.png │ ├── mem_local.png │ ├── mem_shared.png │ ├── numba_flowchart.png │ ├── sm.png │ └── thread_id_1d.png │ └── tutorial11-cuda.ipynb ├── run-all.sh ├── t00 - python, numpy, torch ├── demo_package │ ├── __init__.py │ └── demo_module.py └── tutorial0-Python_Pytorch.ipynb ├── t01 - linear models ├── imgs │ ├── error_types.png │ ├── neuron.png │ ├── perceptron.png │ ├── sgd1d.png │ └── sgd2d_2.png ├── plot_utils.py └── tutorial 1-Logistic_Regression.ipynb ├── t02 - mlp ├── imgs │ ├── linear_discriminant.png │ ├── mlp.png │ ├── neuron.png │ ├── nonlinear_datasets.png │ ├── overfit_1-2-4HL_3N.jpg │ ├── overfit_1HL_3-6-20N.jpg │ ├── perceptron.png │ └── perceptron_db.png ├── plot_utils.py └── tutorial 2 -MLP.ipynb ├── t03 - CNN ├── img │ ├── 1x1_conv.png │ ├── arch.png │ ├── cat_translation.png │ ├── classification.png │ ├── cnn_filters.png │ ├── cnn_layer.jpeg │ ├── cnn_layers.jpeg │ ├── conv.gif │ ├── deeper_meme.jpeg │ ├── depthcol.jpeg │ ├── feature_hierarchy.png │ ├── filter_resp.png │ ├── fully_conv.png │ ├── maxpool.png │ ├── mlp.png │ ├── net_archs.png │ ├── overfit_1-2-4HL_3N.jpg │ ├── overfit_1HL_3-6-20N.jpg │ ├── pooling_invariance.png │ ├── receptive_field.png │ ├── receptive_field2.png │ ├── regression.png │ ├── resnet_arch_table.png │ ├── resnet_block.png │ ├── resnet_block2.png │ ├── resnet_plain_deep_error.png │ ├── toeplitz.png │ ├── vanilla_dnn_scale.png │ ├── zf1.png │ └── zf2.png └── tutorial3-CNNs.ipynb ├── t04 - optimization ├── DJIA_30 │ └── all_stocks_2006-01-01_to_2018-01-01.csv.gz ├── imgs │ ├── Figure1.png │ ├── Figure4.png │ ├── backprop-graph.png │ ├── backprop-modular.png │ ├── bilevel.png │ ├── enc-pred-dec.png │ ├── figure2-highres.png │ ├── flat.png │ ├── lr.gif │ ├── paraboloid.png │ ├── scheduler.png │ ├── sgd-init.png │ ├── sgd-loss.png │ ├── sgd-lr-schedule.png │ ├── sgd-lr.png │ └── sgd-zigzag.png └── tutorial4-Optimization.ipynb ├── t05 - automatic differentiation ├── imgs │ ├── Figure1.png │ ├── Figure4.png │ ├── add_mult.png │ ├── backprop-graph.png │ ├── backprop-modular.png │ ├── backwardAD.png │ ├── bilevel.png │ ├── chain.png │ ├── chain_forward.png │ ├── chain_forwardAD.png │ ├── chain_reverseAD.png │ ├── enc-pred-dec.png │ ├── example_forward.png │ ├── example_forwardAD.png │ ├── example_graph.png │ ├── example_reverseAD.png │ ├── figure2-highres.png │ ├── flat.png │ ├── forwardAD.png │ ├── sgd-init.png │ ├── sgd-loss.png │ ├── sgd-lr-schedule.png │ ├── sgd-lr.png │ └── sgd-zigzag.png └── tut05-AutoDiff.ipynb ├── t06- Object detection ├── assets │ ├── fl.png │ ├── instance.png │ ├── panoptic.png │ ├── tut_objdet_cat.png │ ├── tut_objdet_catdog.jpeg │ ├── tut_objdet_detection.png │ ├── tut_objdet_detectron.png │ ├── tut_objdet_diagram.png │ ├── tut_objdet_dog.jpg │ ├── tut_objdet_faster_rcnn.png │ ├── tut_objdet_faster_rcnn_arch.png │ ├── tut_objdet_nms.png │ ├── tut_objdet_pyramid.PNG │ ├── tut_objdet_rcnn-family-summary.png │ ├── tut_objdet_rcnn.png │ ├── tut_objdet_rcnn2.jpg │ ├── tut_objdet_roi1.PNG │ ├── tut_objdet_roi2.png │ ├── tut_objdet_rpn_1.png │ ├── tut_objdet_rpn_2.jpeg │ ├── tut_objdet_selective_search.jpg │ ├── tut_objdet_size.png │ ├── tut_objdet_sliding.gif │ ├── tut_objdet_small_big_obj.PNG │ ├── tut_objdet_speed.jpg │ ├── tut_objdet_ssd_2.PNG │ ├── tut_objdet_ssd_arch.png │ ├── tut_objdet_svm.PNG │ ├── tut_objdet_warp.PNG │ ├── tut_objdet_yolo.png │ ├── tut_objdet_yolo_arch.png │ ├── tut_objdet_yolov2.png │ ├── tut_objdet_yolov4arch.png │ ├── tut_objdet_yolov4res.png │ ├── tut_seg_iou.png │ ├── yolo2.jpg │ ├── yolo8.png │ └── רשימת-מסמכים-נדרשים-לדוקטור.xlsx ├── imgs │ ├── ap_prac.png │ ├── confmat.png │ ├── pr.png │ ├── prauc.png │ ├── prgraph.png │ └── tut_objdet_roi1.PNG └── tutorial6-OD.ipynb ├── t07 - transfer learning ├── img │ ├── cifar10.png │ ├── cifar10_100.png │ ├── cnn_feature_vis.png │ ├── data_dist.jpg │ ├── ganin_da.png │ ├── ganin_da2.png │ ├── ganin_da3.png │ ├── mnist_m.png │ ├── pan_yang.png │ ├── target-dist-shift.png │ ├── temp-dist.jpg │ ├── tl_example.png │ ├── transfer-learning-medical.png │ ├── transfer_learning_digits.png │ ├── transferlearning.png │ ├── zf1.png │ └── zf2.png ├── tut7 │ ├── data.py │ └── plot_utils.py └── tutorial7-TL_DA.ipynb ├── t08- RNN ├── img │ ├── bptt.png │ ├── causal_convolution.png │ ├── cnn_filters.png │ ├── mlp.png │ ├── rnn_cell.png │ ├── rnn_layered.png │ ├── rnn_unrolled.png │ ├── rnn_use_cases.jpeg │ ├── sentiment_analysis.png │ ├── tasks.png │ ├── tbptt.png │ ├── tcn.png │ └── word_embeddings.png └── tutorial8-SeqModels.ipynb ├── t09- Attention ├── img │ ├── GRU.png │ ├── att.png │ ├── attention-glasses.png │ ├── attention-layer.png │ ├── attention-text.png │ ├── bahdanau2015-annotated.png │ ├── bahdanau2015.png │ ├── bleu.png │ ├── enc_dec.png │ ├── rnn_layered.png │ ├── rnn_unrolled.png │ ├── self_attn_transformer.svg │ ├── seq2seq.svg │ ├── seq2seq1.png │ ├── seq2seq_attention.svg │ ├── seq2seq_predict.svg │ ├── sutskever2014_pca.png │ ├── xu2015_1.png │ └── xu2015_2.png └── tutorial9-Attention.ipynb ├── t10- Transformers ├── img │ ├── GRU.png │ ├── Hydra29.webp │ ├── SesameStreet-Season46-ShowOpen-29.webp │ ├── aiayn.png │ ├── att.png │ ├── attention-glasses.png │ ├── attention-layer.png │ ├── attention-text.png │ ├── attention_jay.png │ ├── bahdanau2015-annotated.png │ ├── bahdanau2015.png │ ├── bayer.png │ ├── before.png │ ├── bert.png │ ├── bleu.png │ ├── description-image.avif │ ├── dnns-13.jpg.webp │ ├── enc_dec.png │ ├── gpt2.png │ ├── matrix_att_jay.png │ ├── matrix_att_jay2.png │ ├── mhatt_jay.png │ ├── q.png │ ├── rnn_layered.png │ ├── rnn_unrolled.png │ ├── self_attn_transformer.svg │ ├── seq2seq.svg │ ├── seq2seq1.png │ ├── seq2seq_attention.svg │ ├── seq2seq_predict.svg │ ├── size.png │ ├── ss.PNG │ ├── sutskever2014_pca.png │ ├── train.png │ ├── xu2015_1.png │ └── xu2015_2.png └── tutorial10-Transformers.ipynb ├── t11- VAE ├── img │ ├── gau.png │ ├── gen_disc.jpg │ ├── gmm.png │ └── vae.png └── tutorial11-VAE.ipynb ├── t111- efficient CNN ├── bonus tutorial-efficient CNNs.ipynb └── img │ ├── 1x1_conv.png │ ├── ChannelShuffle.png │ ├── IRB.png │ ├── IRB_linear.png │ ├── SSC.png │ ├── SqueezeNet.png │ ├── arch.png │ ├── bn_1.png │ ├── bn_2.png │ ├── bn_3.png │ ├── bn_4.png │ ├── bn_5.png │ ├── conv1.png │ ├── conv_dept.png │ ├── conv_dept2.png │ ├── eff.png │ ├── effv2.png │ ├── kd.png │ ├── low_rank.png │ ├── pooling_invariance.png │ ├── prune.png │ ├── receptive_field.png │ ├── receptive_field2.png │ ├── regression.png │ ├── resnet_arch_table.png │ ├── resnet_block.png │ ├── resnet_block2.png │ ├── rn.webp │ ├── sobel.png │ ├── ste.png │ └── swish.png ├── t12- GAN ├── gan_mnist_01.pt ├── gan_mnist_02.pt ├── img │ ├── 1_hmbyMq-akpx-VRq7ZfnGFA.png │ ├── 1_losses.png │ ├── 2cf8b4f1-7163-4af1-aa4b-6066329d554a.png │ ├── DCGAN.png │ ├── Earth-Movers-Distance.png │ ├── cgan.png │ ├── collaps.png │ ├── gan_diagram_discriminator.svg │ ├── gan_diagram_generator.svg │ ├── gan_osil.png │ ├── gau.png │ ├── gen_disc.jpg │ ├── gmm.png │ ├── hairstyle.jpeg │ ├── infogan.png │ ├── larit.png │ ├── mapping_net.png │ ├── progan.png │ ├── progang.gif │ ├── russel.jpg │ ├── style2-scalednoise.png │ ├── style2.png │ ├── stylefinal.png │ ├── vae.png │ └── wdistance.png └── tutorial12-GAN.ipynb ├── t13 - Diffusion Models ├── DDPMs.ipynb ├── Intro.gif ├── PixelCNN++.ppm ├── elbo.jpeg ├── forward_reverse.png ├── random_walk.gif └── training_and_sampling.png └── t14- Multi-Modal ├── CLIP.png ├── CO.png ├── Screenshot 2024-08-08 at 13.05.34.png ├── cca.png ├── clip.jpeg ├── dog.png ├── fus.png ├── gal.png ├── gay.jpeg ├── mixing.png ├── modals.png ├── rep.png ├── table.png ├── translation.png └── tutorial14- Multi-modal.ipynb /.gitignore: -------------------------------------------------------------------------------- 1 | data/ 2 | 3 | # Created by https://www.gitignore.io/api/python,osx,linux,windows 4 | 5 | ### Linux ### 6 | *~ 7 | 8 | # temporary files which can be created if a process still has a handle open of a deleted file 9 | .fuse_hidden* 10 | 11 | # KDE directory preferences 12 | .directory 13 | 14 | # Linux trash folder which might appear on any partition or disk 15 | .Trash-* 16 | 17 | # .nfs files are created when an open file is removed but is still being accessed 18 | .nfs* 19 | 20 | ### OSX ### 21 | # General 22 | .DS_Store 23 | .AppleDouble 24 | .LSOverride 25 | 26 | # Icon must end with two \r 27 | Icon 28 | 29 | # Thumbnails 30 | ._* 31 | 32 | # Files that might appear in the root of a volume 33 | .DocumentRevisions-V100 34 | .fseventsd 35 | .Spotlight-V100 36 | .TemporaryItems 37 | .Trashes 38 | .VolumeIcon.icns 39 | .com.apple.timemachine.donotpresent 40 | 41 | # Directories potentially created on remote AFP share 42 | .AppleDB 43 | .AppleDesktop 44 | Network Trash Folder 45 | Temporary Items 46 | .apdisk 47 | 48 | ### Python ### 49 | # Byte-compiled / optimized / DLL files 50 | __pycache__/ 51 | *.py[cod] 52 | *$py.class 53 | 54 | # C extensions 55 | *.so 56 | 57 | # Distribution / packaging 58 | .Python 59 | build/ 60 | develop-eggs/ 61 | dist/ 62 | downloads/ 63 | eggs/ 64 | .eggs/ 65 | lib/ 66 | lib64/ 67 | parts/ 68 | sdist/ 69 | var/ 70 | wheels/ 71 | *.egg-info/ 72 | .installed.cfg 73 | *.egg 74 | MANIFEST 75 | 76 | # PyInstaller 77 | # Usually these files are written by a python script from a template 78 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 79 | *.manifest 80 | *.spec 81 | 82 | # Installer logs 83 | pip-log.txt 84 | pip-delete-this-directory.txt 85 | 86 | # Unit test / coverage reports 87 | htmlcov/ 88 | .tox/ 89 | .nox/ 90 | .coverage 91 | .coverage.* 92 | .cache 93 | nosetests.xml 94 | coverage.xml 95 | *.cover 96 | .hypothesis/ 97 | .pytest_cache/ 98 | 99 | # Translations 100 | *.mo 101 | *.pot 102 | 103 | # Django stuff: 104 | *.log 105 | local_settings.py 106 | db.sqlite3 107 | 108 | # Flask stuff: 109 | instance/ 110 | .webassets-cache 111 | 112 | # Scrapy stuff: 113 | .scrapy 114 | 115 | # Sphinx documentation 116 | docs/_build/ 117 | 118 | # PyBuilder 119 | target/ 120 | 121 | # Jupyter Notebook 122 | .ipynb_checkpoints 123 | 124 | # IPython 125 | profile_default/ 126 | ipython_config.py 127 | 128 | # pyenv 129 | .python-version 130 | 131 | # celery beat schedule file 132 | celerybeat-schedule 133 | 134 | # SageMath parsed files 135 | *.sage.py 136 | 137 | # Environments 138 | .env 139 | .venv 140 | env/ 141 | venv/ 142 | ENV/ 143 | env.bak/ 144 | venv.bak/ 145 | 146 | # Spyder project settings 147 | .spyderproject 148 | .spyproject 149 | 150 | # Rope project settings 151 | .ropeproject 152 | 153 | # mkdocs documentation 154 | /site 155 | 156 | # mypy 157 | .mypy_cache/ 158 | .dmypy.json 159 | dmypy.json 160 | 161 | ### Python Patch ### 162 | .venv/ 163 | 164 | ### Python.VirtualEnv Stack ### 165 | # Virtualenv 166 | # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ 167 | [Bb]in 168 | [Ii]nclude 169 | [Ll]ib 170 | [Ll]ib64 171 | [Ll]ocal 172 | [Ss]cripts 173 | pyvenv.cfg 174 | pip-selfcheck.json 175 | 176 | ### Windows ### 177 | # Windows thumbnail cache files 178 | Thumbs.db 179 | ehthumbs.db 180 | ehthumbs_vista.db 181 | 182 | # Dump file 183 | *.stackdump 184 | 185 | # Folder config file 186 | [Dd]esktop.ini 187 | 188 | # Recycle Bin used on file shares 189 | $RECYCLE.BIN/ 190 | 191 | # Windows Installer files 192 | *.cab 193 | *.msi 194 | *.msix 195 | *.msm 196 | *.msp 197 | 198 | # Windows shortcuts 199 | *.lnk 200 | 201 | 202 | # End of https://www.gitignore.io/api/python,osx,linux,windows 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CS236781 Tutorials 2 | 3 | This repo contains the code and notebooks shown during course tutorials. 4 | 5 | You can also view the tutorial notebooks in your browser using `nbviewer` by clicking the 6 | button below. 7 | 8 | 9 | 10 | ## Environment set-up 11 | 12 | 1. Install the python3 version of [miniconda](https://conda.io/miniconda.html). 13 | Follow the [installation instructions](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) 14 | for your platform. 15 | 16 | 2. Use conda to create a virtual environment for the assignment. 17 | From the assignment's root directory, run 18 | 19 | ```shell 20 | conda env create -f environment.yml 21 | ``` 22 | 23 | This will install all the necessary packages into a new conda virtual environment named `cs236781`. 24 | 25 | 3. Activate the new environment by running 26 | 27 | ```shell 28 | conda activate cs236781-tutorials 29 | ``` 30 | 31 | 4. Optionally, execute the `run-all.sh` script to run all notebook and test that 32 | everything is installed correctly. 33 | 34 | Notes: 35 | - On Windows, you should also install Microsoft's [Build Tools for Visual 36 | Studio](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019) 37 | before installing the conda env. Make sure "C++ Build Tools" is selected during installation. 38 | - After a new tutorial is added, you should run `conda env update` from the repo 39 | directory to update your dependencies since each new tutorial might add ones. 40 | 41 | 42 | -------------------------------------------------------------------------------- /environment.lock.yml: -------------------------------------------------------------------------------- 1 | name: cs236781-tutorials 2 | channels: 3 | - pytorch 4 | - conda-forge 5 | - defaults 6 | dependencies: 7 | - apipkg=1.5 8 | - appnope=0.1.0 9 | - argon2-cffi=20.1.0 10 | - async_generator=1.10 11 | - attrs=20.2.0 12 | - backcall=0.2.0 13 | - blas=1.0 14 | - bleach=3.2.1 15 | - brotlipy=0.7.0 16 | - bzip2=1.0.8 17 | - ca-certificates=2020.10.14 18 | - cairo=1.14.12 19 | - catalogue=1.0.0 20 | - certifi=2020.6.20 21 | - cffi=1.14.0 22 | - chardet=3.0.4 23 | - click=7.1.2 24 | - cmake=3.18.2 25 | - coverage=5.3 26 | - cryptography=3.1.1 27 | - cudatoolkit=9.0 28 | - cycler=0.10.0 29 | - cymem=2.0.3 30 | - cython=0.29.21 31 | - cython-blis=0.4.1 32 | - dbus=1.13.18 33 | - decorator=4.4.2 34 | - defusedxml=0.6.0 35 | - entrypoints=0.3 36 | - execnet=1.7.1 37 | - expat=2.2.10 38 | - ffmpeg=4.2.2 39 | - fontconfig=2.13.0 40 | - freetype=2.10.4 41 | - gettext=0.19.8.1 42 | - giflib=5.2.1 43 | - glib=2.63.1 44 | - gmp=6.1.2 45 | - gnutls=3.6.5 46 | - graphite2=1.3.14 47 | - graphviz=2.42.3 48 | - harfbuzz=2.4.0 49 | - hdf5=1.10.6 50 | - icu=58.2 51 | - idna=2.10 52 | - importlib-metadata=2.0.0 53 | - importlib_metadata=2.0.0 54 | - iniconfig=1.1.1 55 | - intel-openmp=2019.4 56 | - ipykernel=5.3.4 57 | - ipython=7.18.1 58 | - ipython_genutils=0.2.0 59 | - ipywidgets=7.5.1 60 | - jasper=1.900.1 61 | - jedi=0.17.2 62 | - jinja2=2.11.2 63 | - joblib=0.17.0 64 | - jpeg=9d 65 | - json5=0.9.5 66 | - jsonschema=3.0.2 67 | - jupyter=1.0.0 68 | - jupyter_client=6.1.7 69 | - jupyter_console=6.2.0 70 | - jupyter_core=4.6.3 71 | - jupyterlab=2.2.6 72 | - jupyterlab_pygments=0.1.2 73 | - jupyterlab_server=1.2.0 74 | - kiwisolver=1.2.0 75 | - krb5=1.18.2 76 | - lame=3.100 77 | - lcms2=2.11 78 | - libblas=3.8.0 79 | - libcblas=3.8.0 80 | - libcurl=7.71.1 81 | - libcxx=11.0.0 82 | - libedit=3.1.20191231 83 | - libffi=3.2.1 84 | - libgfortran=3.0.1 85 | - libiconv=1.16 86 | - liblapack=3.8.0 87 | - liblapacke=3.8.0 88 | - libllvm10=10.0.1 89 | - libopencv=4.2.0 90 | - libopus=1.3.1 91 | - libpng=1.6.37 92 | - libsodium=1.0.18 93 | - libssh2=1.9.0 94 | - libtiff=4.1.0 95 | - libuv=1.40.0 96 | - libvpx=1.7.0 97 | - libwebp=1.0.2 98 | - libxml2=2.9.10 99 | - llvm-openmp=10.0.0 100 | - llvmlite=0.34.0 101 | - lz4-c=1.9.2 102 | - markupsafe=1.1.1 103 | - matplotlib=3.3.2 104 | - matplotlib-base=3.3.2 105 | - mistune=0.8.4 106 | - mkl=2019.4 107 | - mkl-service=2.3.0 108 | - mkl_fft=1.2.0 109 | - mkl_random=1.1.1 110 | - more-itertools=8.5.0 111 | - murmurhash=1.0.2 112 | - nbclient=0.5.1 113 | - nbconvert=6.0.7 114 | - nbformat=5.0.8 115 | - ncurses=6.2 116 | - nest-asyncio=1.4.1 117 | - nettle=3.4.1 118 | - networkx=2.5 119 | - ninja=1.10.1 120 | - nltk=3.5 121 | - nodejs=10.13.0 122 | - notebook=6.1.4 123 | - numba=0.51.2 124 | - numpy=1.19.2 125 | - numpy-base=1.19.2 126 | - olefile=0.46 127 | - opencv=4.2.0 128 | - openh264=2.1.0 129 | - openssl=1.1.1h 130 | - packaging=20.4 131 | - pandas=1.1.3 132 | - pandoc=2.11 133 | - pandocfilters=1.4.2 134 | - parso=0.7.0 135 | - pcre=8.44 136 | - pexpect=4.8.0 137 | - pickleshare=0.7.5 138 | - pillow=8.0.1 139 | - pip=20.2.4 140 | - pixman=0.40.0 141 | - plac=0.9.6 142 | - pluggy=0.13.1 143 | - preshed=3.0.2 144 | - prometheus_client=0.8.0 145 | - prompt-toolkit=3.0.8 146 | - prompt_toolkit=3.0.8 147 | - ptyprocess=0.6.0 148 | - py=1.9.0 149 | - py-opencv=4.2.0 150 | - pycparser=2.20 151 | - pygments=2.7.1 152 | - pyopenssl=19.1.0 153 | - pyparsing=2.4.7 154 | - pyqt=5.9.2 155 | - pyrsistent=0.17.3 156 | - pysocks=1.7.1 157 | - pytest=6.1.1 158 | - pytest-cov=2.10.1 159 | - pytest-forked=1.3.0 160 | - pytest-xdist=2.1.0 161 | - python=3.8.6 162 | - python-dateutil=2.8.1 163 | - python-graphviz=0.14.2 164 | - python_abi=3.8 165 | - pytorch=1.6.0 166 | - pytz=2020.1 167 | - pyzmq=19.0.2 168 | - qt=5.9.7 169 | - qtconsole=4.7.7 170 | - qtpy=1.9.0 171 | - readline=8.0 172 | - regex=2020.10.15 173 | - requests=2.24.0 174 | - rhash=1.4.0 175 | - rise=5.6.1 176 | - scikit-learn=0.23.2 177 | - scipy=1.5.0 178 | - send2trash=1.5.0 179 | - setuptools=50.3.0 180 | - sip=4.19.8 181 | - six=1.15.0 182 | - spacy=2.3.2 183 | - spacy-model-en_core_web_sm=2.3.1 184 | - sqlite=3.33.0 185 | - srsly=1.0.2 186 | - swig=3.0.12 187 | - terminado=0.9.1 188 | - testpath=0.4.4 189 | - thinc=7.4.1 190 | - threadpoolctl=2.1.0 191 | - tk=8.6.10 192 | - toml=0.10.1 193 | - torchtext=0.7.0 194 | - torchvision=0.7.0 195 | - tornado=6.0.4 196 | - tqdm=4.50.2 197 | - traitlets=5.0.5 198 | - urllib3=1.25.11 199 | - wasabi=0.8.0 200 | - wcwidth=0.2.5 201 | - webencodings=0.5.1 202 | - wheel=0.35.1 203 | - widgetsnbextension=3.5.1 204 | - x264=1!157.20191217 205 | - xz=5.2.5 206 | - zeromq=4.3.3 207 | - zipp=3.4.0 208 | - zlib=1.2.11 209 | - zstd=1.4.5 210 | - pip: 211 | - atari-py==0.2.6 212 | - box2d-py==2.3.8 213 | - cloudpickle==1.6.0 214 | - https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-2.3.0/de_core_news_sm-2.3.0.tar.gz 215 | - future==0.18.2 216 | - gym==0.17.3 217 | - nbmerge==0.0.4 218 | - pyglet==1.5.0 219 | - torchviz==0.0.1 220 | 221 | -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: cs236781-tutorials 2 | channels: 3 | - pytorch 4 | - conda-forge 5 | - defaults 6 | dependencies: 7 | # common 8 | - ipython 9 | - jupyter 10 | - jupyterlab 11 | - matplotlib 12 | - numpy 13 | - pandas 14 | - pip 15 | - pytest 16 | - pytest-xdist 17 | - python=3.8.12 18 | - scikit-learn=1.1.3 19 | - scipy 20 | - tqdm 21 | # pytorch 22 | - pytorch 23 | #- cudatoolkit 24 | - torchvision 25 | - torchtext 26 | -------------------------------------------------------------------------------- /environment1.yml: -------------------------------------------------------------------------------- 1 | name: cs236781-hw 2 | channels: 3 | - pytorch 4 | - conda-forge 5 | - defaults 6 | dependencies: 7 | - aiofiles=22.1.0=pyhd8ed1ab_0 8 | - aiosqlite=0.18.0=pyhd8ed1ab_0 9 | - anyio=3.6.2=pyhd8ed1ab_0 10 | - argon2-cffi=21.3.0=pyhd8ed1ab_0 11 | - argon2-cffi-bindings=21.2.0=py38h91455d4_3 12 | - asttokens=2.2.1=pyhd8ed1ab_0 13 | - attrs=22.2.0=pyh71513ae_0 14 | - babel=2.12.1=pyhd8ed1ab_1 15 | - backcall=0.2.0=pyh9f0ad1d_0 16 | - backports=1.0=pyhd8ed1ab_3 17 | - backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0 18 | - beautifulsoup4=4.12.0=pyha770c72_0 19 | - blas=2.116=mkl 20 | - blas-devel=3.9.0=16_win64_mkl 21 | - bleach=6.0.0=pyhd8ed1ab_0 22 | - brotli=1.0.9=hcfcfb64_8 23 | - brotli-bin=1.0.9=hcfcfb64_8 24 | - brotlipy=0.7.0=py38h91455d4_1005 25 | - bzip2=1.0.8=h8ffe710_4 26 | - ca-certificates=2022.12.7=h5b45459_0 27 | - certifi=2022.12.7=pyhd8ed1ab_0 28 | - cffi=1.15.1=py38h57701bc_3 29 | - charset-normalizer=3.1.0=pyhd8ed1ab_0 30 | - colorama=0.4.6=pyhd8ed1ab_0 31 | - comm=0.1.3=pyhd8ed1ab_0 32 | - contourpy=1.0.7=py38hb1fd069_0 33 | - cryptography=40.0.1=py38h95f5157_0 34 | - cudatoolkit=11.8.0=h09e9e62_11 35 | - cycler=0.11.0=pyhd8ed1ab_0 36 | - debugpy=1.6.6=py38hd3f51b4_0 37 | - decorator=5.1.1=pyhd8ed1ab_0 38 | - defusedxml=0.7.1=pyhd8ed1ab_0 39 | - entrypoints=0.4=pyhd8ed1ab_0 40 | - exceptiongroup=1.1.1=pyhd8ed1ab_0 41 | - execnet=1.9.0=pyhd8ed1ab_0 42 | - executing=1.2.0=pyhd8ed1ab_0 43 | - filelock=3.10.7=pyhd8ed1ab_0 44 | - flit-core=3.8.0=pyhd8ed1ab_0 45 | - fonttools=4.39.3=py38h91455d4_0 46 | - freetype=2.12.1=h546665d_1 47 | - gettext=0.21.1=h5728263_0 48 | - glib=2.74.1=h12be248_1 49 | - glib-tools=2.74.1=h12be248_1 50 | - gst-plugins-base=1.22.0=h001b923_2 51 | - gstreamer=1.22.0=h6b5321d_2 52 | - icu=70.1=h0e60522_0 53 | - idna=3.4=pyhd8ed1ab_0 54 | - importlib-metadata=6.1.0=pyha770c72_0 55 | - importlib-resources=5.12.0=pyhd8ed1ab_0 56 | - importlib_metadata=6.1.0=hd8ed1ab_0 57 | - importlib_resources=5.12.0=pyhd8ed1ab_0 58 | - iniconfig=2.0.0=pyhd8ed1ab_0 59 | - intel-openmp=2023.0.0=h57928b3_25922 60 | - ipykernel=6.22.0=pyh025b116_0 61 | - ipython=8.12.0=pyh08f2357_0 62 | - ipython_genutils=0.2.0=py_1 63 | - ipywidgets=8.0.6=pyhd8ed1ab_0 64 | - jedi=0.18.2=pyhd8ed1ab_0 65 | - jinja2=3.1.2=pyhd8ed1ab_1 66 | - joblib=1.2.0=pyhd8ed1ab_0 67 | - jpeg=9e=hcfcfb64_3 68 | - json5=0.9.5=pyh9f0ad1d_0 69 | - jsonschema=4.17.3=pyhd8ed1ab_0 70 | - jupyter=1.0.0=py38haa244fe_8 71 | - jupyter_client=8.1.0=pyhd8ed1ab_0 72 | - jupyter_console=6.6.3=pyhd8ed1ab_0 73 | - jupyter_core=5.3.0=py38haa244fe_0 74 | - jupyter_events=0.6.3=pyhd8ed1ab_0 75 | - jupyter_server=2.5.0=pyhd8ed1ab_0 76 | - jupyter_server_fileid=0.8.0=pyhd8ed1ab_0 77 | - jupyter_server_terminals=0.4.4=pyhd8ed1ab_1 78 | - jupyter_server_ydoc=0.8.0=pyhd8ed1ab_0 79 | - jupyter_ydoc=0.2.3=pyhd8ed1ab_0 80 | - jupyterlab=3.6.3=pyhd8ed1ab_0 81 | - jupyterlab_pygments=0.2.2=pyhd8ed1ab_0 82 | - jupyterlab_server=2.22.0=pyhd8ed1ab_0 83 | - jupyterlab_widgets=3.0.7=pyhd8ed1ab_0 84 | - kiwisolver=1.4.4=py38hb1fd069_1 85 | - krb5=1.20.1=heb0366b_0 86 | - lcms2=2.15=ha5c8aab_0 87 | - lerc=4.0.0=h63175ca_0 88 | - libblas=3.9.0=16_win64_mkl 89 | - libbrotlicommon=1.0.9=hcfcfb64_8 90 | - libbrotlidec=1.0.9=hcfcfb64_8 91 | - libbrotlienc=1.0.9=hcfcfb64_8 92 | - libcblas=3.9.0=16_win64_mkl 93 | - libclang=15.0.7=default_h77d9078_1 94 | - libclang13=15.0.7=default_h77d9078_1 95 | - libdeflate=1.17=hcfcfb64_0 96 | - libffi=3.4.2=h8ffe710_5 97 | - libglib=2.74.1=he8f3873_1 98 | - libhwloc=2.9.0=h51c2c0f_0 99 | - libiconv=1.17=h8ffe710_0 100 | - liblapack=3.9.0=16_win64_mkl 101 | - liblapacke=3.9.0=16_win64_mkl 102 | - libogg=1.3.4=h8ffe710_1 103 | - libpng=1.6.39=h19919ed_0 104 | - libsodium=1.0.18=h8d14728_1 105 | - libsqlite=3.40.0=hcfcfb64_0 106 | - libtiff=4.5.0=hf8721a0_2 107 | - libuv=1.44.2=h8ffe710_0 108 | - libvorbis=1.3.7=h0e60522_0 109 | - libwebp-base=1.3.0=hcfcfb64_0 110 | - libxcb=1.13=hcd874cb_1004 111 | - libxml2=2.10.3=hc3477c8_6 112 | - libzlib=1.2.13=hcfcfb64_4 113 | - m2w64-gcc-libgfortran=5.3.0=6 114 | - m2w64-gcc-libs=5.3.0=7 115 | - m2w64-gcc-libs-core=5.3.0=7 116 | - m2w64-gmp=6.1.0=2 117 | - m2w64-libwinpthread-git=5.0.0.4634.697f757=2 118 | - markupsafe=2.1.2=py38h91455d4_0 119 | - matplotlib=3.7.1=py38haa244fe_0 120 | - matplotlib-base=3.7.1=py38h528a6c7_0 121 | - matplotlib-inline=0.1.6=pyhd8ed1ab_0 122 | - mistune=2.0.5=pyhd8ed1ab_0 123 | - mkl=2022.1.0=h6a75c08_874 124 | - mkl-devel=2022.1.0=h57928b3_875 125 | - mkl-include=2022.1.0=h6a75c08_874 126 | - mpmath=1.3.0=pyhd8ed1ab_0 127 | - msys2-conda-epoch=20160418=1 128 | - munkres=1.1.4=pyh9f0ad1d_0 129 | - nbclassic=0.5.3=pyhb4ecaf3_3 130 | - nbclient=0.7.2=pyhd8ed1ab_0 131 | - nbconvert=7.2.10=pyhd8ed1ab_1 132 | - nbconvert-core=7.2.10=pyhd8ed1ab_1 133 | - nbconvert-pandoc=7.2.10=pyhd8ed1ab_1 134 | - nbformat=5.8.0=pyhd8ed1ab_0 135 | - nest-asyncio=1.5.6=pyhd8ed1ab_0 136 | - networkx=3.0=pyhd8ed1ab_0 137 | - notebook=6.5.3=pyha770c72_0 138 | - notebook-shim=0.2.2=pyhd8ed1ab_0 139 | - numpy=1.24.2=py38h7ec9225_0 140 | - openjpeg=2.5.0=ha2aaf27_2 141 | - openssl=3.1.0=hcfcfb64_0 142 | - packaging=23.0=pyhd8ed1ab_0 143 | - pandas=2.0.0=py38h5846ac1_0 144 | - pandoc=2.19.2=h57928b3_2 145 | - pandocfilters=1.5.0=pyhd8ed1ab_0 146 | - parso=0.8.3=pyhd8ed1ab_0 147 | - pcre2=10.40=h17e33f8_0 148 | - pickleshare=0.7.5=py_1003 149 | - pillow=9.4.0=py38h087119c_1 150 | - pip=23.0.1=pyhd8ed1ab_0 151 | - pkgutil-resolve-name=1.3.10=pyhd8ed1ab_0 152 | - platformdirs=3.2.0=pyhd8ed1ab_0 153 | - pluggy=1.0.0=pyhd8ed1ab_5 154 | - ply=3.11=py_1 155 | - pooch=1.7.0=pyha770c72_3 156 | - prometheus_client=0.16.0=pyhd8ed1ab_0 157 | - prompt-toolkit=3.0.38=pyha770c72_0 158 | - prompt_toolkit=3.0.38=hd8ed1ab_0 159 | - psutil=5.9.4=py38h91455d4_0 160 | - pthread-stubs=0.4=hcd874cb_1001 161 | - pthreads-win32=2.9.1=hfa6e2cd_3 162 | - pure_eval=0.2.2=pyhd8ed1ab_0 163 | - pycparser=2.21=pyhd8ed1ab_0 164 | - pygments=2.14.0=pyhd8ed1ab_0 165 | - pyopenssl=23.1.1=pyhd8ed1ab_0 166 | - pyparsing=3.0.9=pyhd8ed1ab_0 167 | - pyqt=5.15.7=py38hd6c051e_3 168 | - pyqt5-sip=12.11.0=py38hd3f51b4_3 169 | - pyrsistent=0.19.3=py38h91455d4_0 170 | - pysocks=1.7.1=pyh0701188_6 171 | - pytest=7.2.2=pyhd8ed1ab_0 172 | - pytest-xdist=3.2.1=pyhd8ed1ab_0 173 | - python=3.8.12=h900ac77_2_cpython 174 | - python-dateutil=2.8.2=pyhd8ed1ab_0 175 | - python-fastjsonschema=2.16.3=pyhd8ed1ab_0 176 | - python-json-logger=2.0.7=pyhd8ed1ab_0 177 | - python-tzdata=2023.3=pyhd8ed1ab_0 178 | - python_abi=3.8=3_cp38 179 | - pytorch=2.0.0=py3.8_cpu_0 180 | - pytorch-mutex=1.0=cpu 181 | - pytz=2023.3=pyhd8ed1ab_0 182 | - pywin32=304=py38hd3f51b4_2 183 | - pywinpty=2.0.10=py38hd3f51b4_0 184 | - pyyaml=6.0=py38h91455d4_5 185 | - pyzmq=25.0.2=py38ha85f68a_0 186 | - qt-main=5.15.8=h720456b_6 187 | - qtconsole=5.4.2=pyhd8ed1ab_0 188 | - qtconsole-base=5.4.2=pyha770c72_0 189 | - qtpy=2.3.1=pyhd8ed1ab_0 190 | - requests=2.28.2=pyhd8ed1ab_1 191 | - rfc3339-validator=0.1.4=pyhd8ed1ab_0 192 | - rfc3986-validator=0.1.1=pyh9f0ad1d_0 193 | - scikit-learn=1.1.3=py38h69724d7_1 194 | - scipy=1.10.1=py38h0f6ee2a_0 195 | - send2trash=1.8.0=pyhd8ed1ab_0 196 | - setuptools=67.6.1=pyhd8ed1ab_0 197 | - sip=6.7.7=py38hd3f51b4_1 198 | - six=1.16.0=pyh6c4a22f_0 199 | - sniffio=1.3.0=pyhd8ed1ab_0 200 | - soupsieve=2.3.2.post1=pyhd8ed1ab_0 201 | - sqlite=3.40.0=hcfcfb64_0 202 | - stack_data=0.6.2=pyhd8ed1ab_0 203 | - sympy=1.11.1=pyh04b8f61_3 204 | - tbb=2021.8.0=h91493d7_0 205 | - terminado=0.17.0=pyh08f2357_0 206 | - threadpoolctl=3.1.0=pyh8a188c0_0 207 | - tinycss2=1.2.1=pyhd8ed1ab_0 208 | - tk=8.6.12=h8ffe710_0 209 | - toml=0.10.2=pyhd8ed1ab_0 210 | - tomli=2.0.1=pyhd8ed1ab_0 211 | - torchdata=0.6.0=py38 212 | - torchtext=0.15.0=py38 213 | - torchvision=0.15.0=py38_cpu 214 | - tornado=6.2=py38h91455d4_1 215 | - tqdm=4.65.0=pyhd8ed1ab_1 216 | - traitlets=5.9.0=pyhd8ed1ab_0 217 | - typing-extensions=4.5.0=hd8ed1ab_0 218 | - typing_extensions=4.5.0=pyha770c72_0 219 | - ucrt=10.0.22621.0=h57928b3_0 220 | - unicodedata2=15.0.0=py38h91455d4_0 221 | - urllib3=1.26.15=pyhd8ed1ab_0 222 | - vc=14.3=hb6edc58_10 223 | - vs2015_runtime=14.34.31931=h4c5c07a_10 224 | - wcwidth=0.2.6=pyhd8ed1ab_0 225 | - webencodings=0.5.1=py_1 226 | - websocket-client=1.5.1=pyhd8ed1ab_0 227 | - wheel=0.40.0=pyhd8ed1ab_0 228 | - widgetsnbextension=4.0.7=pyhd8ed1ab_0 229 | - win_inet_pton=1.1.0=pyhd8ed1ab_6 230 | - winpty=0.4.3=4 231 | - xorg-libxau=1.0.9=hcd874cb_0 232 | - xorg-libxdmcp=1.1.3=hcd874cb_0 233 | - xz=5.2.6=h8d14728_0 234 | - y-py=0.5.9=py38h4900a04_0 235 | - yaml=0.2.5=h8ffe710_2 236 | - ypy-websocket=0.8.2=pyhd8ed1ab_0 237 | - zeromq=4.3.4=h0e60522_1 238 | - zipp=3.15.0=pyhd8ed1ab_0 239 | - zstd=1.5.2=h12be248_6 240 | - pip: 241 | - python-graphviz==0.20.1 242 | - torchviz==0.0.2 243 | prefix: C:\Users\moshe\anaconda3\envs\cs236781-hw 244 | -------------------------------------------------------------------------------- /jupyter-lab.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### 4 | # CS236781: Deep Learning 5 | # jupyter-lab.sh 6 | # 7 | # This script is intended to help you run jupyter lab on the course servers. 8 | # 9 | # Example usage: 10 | # 11 | # To run on the gateway machine (limited resources, no GPU): 12 | # ./jupyter-lab.sh 13 | # 14 | # To run on a compute node: 15 | # srun -c 2 --gres=gpu:1 --pty jupyter-lab.sh 16 | # 17 | 18 | ### 19 | # Conda parameters 20 | # 21 | CONDA_HOME=$HOME/miniconda3 22 | CONDA_ENV=cs236781-tutorials 23 | 24 | unset XDG_RUNTIME_DIR 25 | source $CONDA_HOME/etc/profile.d/conda.sh 26 | conda activate $CONDA_ENV 27 | 28 | # jupyter lab --no-browser --ip=$(hostname -I) --port-retries=100 29 | jupyter notebook --no-browser --ip=$(hostname -I) --port-retries=100 30 | 31 | -------------------------------------------------------------------------------- /older version/t01/demo_package/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Demo package init file. 3 | This file used to be required for defining a python pacakge, until python 3.3. 4 | """ 5 | 6 | # Package init code can be written here 7 | -------------------------------------------------------------------------------- /older version/t01/demo_package/demo_module.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import math 3 | 4 | 5 | def demo_func(a=1): 6 | """ 7 | Just a demo 8 | """ 9 | print(f'this is a demo, a={a}') 10 | 11 | 12 | # This will be executed when this module is imported for the first time 13 | demo_func(17) 14 | 15 | 16 | if __name__ == '__main__': 17 | """ 18 | This will be executed when the script is run from the command line. 19 | """ 20 | demo_func(a=42) 21 | 22 | -------------------------------------------------------------------------------- /older version/t02/imgs/error_types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t02/imgs/error_types.png -------------------------------------------------------------------------------- /older version/t02/imgs/neuron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t02/imgs/neuron.png -------------------------------------------------------------------------------- /older version/t02/imgs/perceptron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t02/imgs/perceptron.png -------------------------------------------------------------------------------- /older version/t02/imgs/sgd1d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t02/imgs/sgd1d.png -------------------------------------------------------------------------------- /older version/t02/imgs/sgd2d_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t02/imgs/sgd2d_2.png -------------------------------------------------------------------------------- /older version/t02/plot_utils.py: -------------------------------------------------------------------------------- 1 | import itertools 2 | import math 3 | import matplotlib.pyplot as plt 4 | 5 | 6 | def tensors_as_images(tensors, nrows=1, figsize=(8, 8), titles=[], 7 | wspace=0.1, hspace=0.2, cmap=None): 8 | """ 9 | Plots a sequence of pytorch tensors as images. 10 | :param tensors: A sequence of pytorch tensors, should have shape CxWxH 11 | """ 12 | assert nrows > 0 13 | 14 | num_tensors = len(tensors) 15 | 16 | ncols = math.ceil(num_tensors / nrows) 17 | 18 | fig, axes = plt.subplots(nrows=nrows, ncols=ncols, figsize=figsize, 19 | gridspec_kw=dict(wspace=wspace, hspace=hspace), 20 | subplot_kw=dict(yticks=[], xticks=[])) 21 | axes_flat = axes.reshape(-1) 22 | 23 | # Plot each tensor 24 | for i in range(num_tensors): 25 | ax = axes_flat[i] 26 | 27 | image_tensor = tensors[i] 28 | assert image_tensor.dim() == 3 # Make sure shape is CxWxH 29 | 30 | image = image_tensor.numpy() 31 | image = image.transpose(1, 2, 0) 32 | image = image.squeeze() # remove singleton dimensions if any exist 33 | 34 | ax.imshow(image, cmap=cmap) 35 | 36 | if len(titles) > i and titles[i] is not None: 37 | ax.set_title(titles[i]) 38 | 39 | # If there are more axes than tensors, remove their frames 40 | for j in range(num_tensors, len(axes_flat)): 41 | axes_flat[j].axis('off') 42 | 43 | return fig, axes 44 | 45 | 46 | def dataset_first_n(dataset, n, show_classes=False, class_labels=None, **kw): 47 | """ 48 | Plots first n images of a dataset containing tensor images. 49 | """ 50 | 51 | # [(img0, cls0), ..., # (imgN, clsN)] 52 | first_n = list(itertools.islice(dataset, n)) 53 | 54 | # Split (image, class) tuples 55 | first_n_images, first_n_classes = zip(*first_n) 56 | 57 | if show_classes: 58 | titles = first_n_classes 59 | if class_labels: 60 | titles = [class_labels[cls] for cls in first_n_classes] 61 | else: 62 | titles = [] 63 | 64 | return tensors_as_images(first_n_images, titles=titles, **kw) 65 | -------------------------------------------------------------------------------- /older version/t03/imgs/linear_discriminant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t03/imgs/linear_discriminant.png -------------------------------------------------------------------------------- /older version/t03/imgs/mlp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t03/imgs/mlp.png -------------------------------------------------------------------------------- /older version/t03/imgs/neuron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t03/imgs/neuron.png -------------------------------------------------------------------------------- /older version/t03/imgs/nonlinear_datasets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t03/imgs/nonlinear_datasets.png -------------------------------------------------------------------------------- /older version/t03/imgs/overfit_1-2-4HL_3N.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t03/imgs/overfit_1-2-4HL_3N.jpg -------------------------------------------------------------------------------- /older version/t03/imgs/overfit_1HL_3-6-20N.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t03/imgs/overfit_1HL_3-6-20N.jpg -------------------------------------------------------------------------------- /older version/t03/imgs/perceptron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t03/imgs/perceptron.png -------------------------------------------------------------------------------- /older version/t03/imgs/perceptron_db.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t03/imgs/perceptron_db.png -------------------------------------------------------------------------------- /older version/t04/img/1x1_conv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/1x1_conv.png -------------------------------------------------------------------------------- /older version/t04/img/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/arch.png -------------------------------------------------------------------------------- /older version/t04/img/cat_translation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/cat_translation.png -------------------------------------------------------------------------------- /older version/t04/img/classification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/classification.png -------------------------------------------------------------------------------- /older version/t04/img/cnn_filters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/cnn_filters.png -------------------------------------------------------------------------------- /older version/t04/img/cnn_layer.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/cnn_layer.jpeg -------------------------------------------------------------------------------- /older version/t04/img/cnn_layers.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/cnn_layers.jpeg -------------------------------------------------------------------------------- /older version/t04/img/conv.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/conv.gif -------------------------------------------------------------------------------- /older version/t04/img/deeper_meme.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/deeper_meme.jpeg -------------------------------------------------------------------------------- /older version/t04/img/depthcol.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/depthcol.jpeg -------------------------------------------------------------------------------- /older version/t04/img/feature_hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/feature_hierarchy.png -------------------------------------------------------------------------------- /older version/t04/img/filter_resp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/filter_resp.png -------------------------------------------------------------------------------- /older version/t04/img/fully_conv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/fully_conv.png -------------------------------------------------------------------------------- /older version/t04/img/maxpool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/maxpool.png -------------------------------------------------------------------------------- /older version/t04/img/mlp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/mlp.png -------------------------------------------------------------------------------- /older version/t04/img/net_archs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/net_archs.png -------------------------------------------------------------------------------- /older version/t04/img/overfit_1-2-4HL_3N.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/overfit_1-2-4HL_3N.jpg -------------------------------------------------------------------------------- /older version/t04/img/overfit_1HL_3-6-20N.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/overfit_1HL_3-6-20N.jpg -------------------------------------------------------------------------------- /older version/t04/img/pooling_invariance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/pooling_invariance.png -------------------------------------------------------------------------------- /older version/t04/img/receptive_field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/receptive_field.png -------------------------------------------------------------------------------- /older version/t04/img/receptive_field2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/receptive_field2.png -------------------------------------------------------------------------------- /older version/t04/img/regression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/regression.png -------------------------------------------------------------------------------- /older version/t04/img/resnet_arch_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/resnet_arch_table.png -------------------------------------------------------------------------------- /older version/t04/img/resnet_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/resnet_block.png -------------------------------------------------------------------------------- /older version/t04/img/resnet_block2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/resnet_block2.png -------------------------------------------------------------------------------- /older version/t04/img/resnet_plain_deep_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/resnet_plain_deep_error.png -------------------------------------------------------------------------------- /older version/t04/img/toeplitz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/toeplitz.png -------------------------------------------------------------------------------- /older version/t04/img/vanilla_dnn_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/vanilla_dnn_scale.png -------------------------------------------------------------------------------- /older version/t04/img/zf1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/zf1.png -------------------------------------------------------------------------------- /older version/t04/img/zf2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t04/img/zf2.png -------------------------------------------------------------------------------- /older version/t05/DJIA_30/all_stocks_2006-01-01_to_2018-01-01.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t05/DJIA_30/all_stocks_2006-01-01_to_2018-01-01.csv.gz -------------------------------------------------------------------------------- /older version/t05/imgs/backprop-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t05/imgs/backprop-graph.png -------------------------------------------------------------------------------- /older version/t05/imgs/backprop-modular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t05/imgs/backprop-modular.png -------------------------------------------------------------------------------- /older version/t05/imgs/bilevel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t05/imgs/bilevel.png -------------------------------------------------------------------------------- /older version/t05/imgs/enc-pred-dec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t05/imgs/enc-pred-dec.png -------------------------------------------------------------------------------- /older version/t05/imgs/sgd-init.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t05/imgs/sgd-init.png -------------------------------------------------------------------------------- /older version/t05/imgs/sgd-loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t05/imgs/sgd-loss.png -------------------------------------------------------------------------------- /older version/t05/imgs/sgd-lr-schedule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t05/imgs/sgd-lr-schedule.png -------------------------------------------------------------------------------- /older version/t05/imgs/sgd-lr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t05/imgs/sgd-lr.png -------------------------------------------------------------------------------- /older version/t05/imgs/sgd-zigzag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t05/imgs/sgd-zigzag.png -------------------------------------------------------------------------------- /older version/t06/img/bptt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/bptt.png -------------------------------------------------------------------------------- /older version/t06/img/causal_convolution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/causal_convolution.png -------------------------------------------------------------------------------- /older version/t06/img/cnn_filters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/cnn_filters.png -------------------------------------------------------------------------------- /older version/t06/img/mlp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/mlp.png -------------------------------------------------------------------------------- /older version/t06/img/rnn_cell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/rnn_cell.png -------------------------------------------------------------------------------- /older version/t06/img/rnn_layered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/rnn_layered.png -------------------------------------------------------------------------------- /older version/t06/img/rnn_unrolled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/rnn_unrolled.png -------------------------------------------------------------------------------- /older version/t06/img/rnn_use_cases.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/rnn_use_cases.jpeg -------------------------------------------------------------------------------- /older version/t06/img/sentiment_analysis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/sentiment_analysis.png -------------------------------------------------------------------------------- /older version/t06/img/tbptt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/tbptt.png -------------------------------------------------------------------------------- /older version/t06/img/tcn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/tcn.png -------------------------------------------------------------------------------- /older version/t06/img/word_embeddings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t06/img/word_embeddings.png -------------------------------------------------------------------------------- /older version/t07/img/GRU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/GRU.png -------------------------------------------------------------------------------- /older version/t07/img/attention-layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/attention-layer.png -------------------------------------------------------------------------------- /older version/t07/img/bahdanau2015-annotated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/bahdanau2015-annotated.png -------------------------------------------------------------------------------- /older version/t07/img/bahdanau2015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/bahdanau2015.png -------------------------------------------------------------------------------- /older version/t07/img/enc_dec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/enc_dec.png -------------------------------------------------------------------------------- /older version/t07/img/rnn_layered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/rnn_layered.png -------------------------------------------------------------------------------- /older version/t07/img/rnn_unrolled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/rnn_unrolled.png -------------------------------------------------------------------------------- /older version/t07/img/seq2seq1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/seq2seq1.png -------------------------------------------------------------------------------- /older version/t07/img/sutskever2014_pca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/sutskever2014_pca.png -------------------------------------------------------------------------------- /older version/t07/img/xu2015_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/xu2015_1.png -------------------------------------------------------------------------------- /older version/t07/img/xu2015_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t07/img/xu2015_2.png -------------------------------------------------------------------------------- /older version/t08/img/cifar10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/cifar10.png -------------------------------------------------------------------------------- /older version/t08/img/cifar10_100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/cifar10_100.png -------------------------------------------------------------------------------- /older version/t08/img/cnn_feature_vis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/cnn_feature_vis.png -------------------------------------------------------------------------------- /older version/t08/img/data_dist.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/data_dist.jpg -------------------------------------------------------------------------------- /older version/t08/img/ganin_da.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/ganin_da.png -------------------------------------------------------------------------------- /older version/t08/img/ganin_da2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/ganin_da2.png -------------------------------------------------------------------------------- /older version/t08/img/ganin_da3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/ganin_da3.png -------------------------------------------------------------------------------- /older version/t08/img/mnist_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/mnist_m.png -------------------------------------------------------------------------------- /older version/t08/img/pan_yang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/pan_yang.png -------------------------------------------------------------------------------- /older version/t08/img/target-dist-shift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/target-dist-shift.png -------------------------------------------------------------------------------- /older version/t08/img/temp-dist.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/temp-dist.jpg -------------------------------------------------------------------------------- /older version/t08/img/tl_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/tl_example.png -------------------------------------------------------------------------------- /older version/t08/img/transfer-learning-medical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/transfer-learning-medical.png -------------------------------------------------------------------------------- /older version/t08/img/transfer_learning_digits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/transfer_learning_digits.png -------------------------------------------------------------------------------- /older version/t08/img/transferlearning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/transferlearning.png -------------------------------------------------------------------------------- /older version/t08/img/zf1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/zf1.png -------------------------------------------------------------------------------- /older version/t08/img/zf2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t08/img/zf2.png -------------------------------------------------------------------------------- /older version/t08/tut7/data.py: -------------------------------------------------------------------------------- 1 | import torch.utils.data as data 2 | from PIL import Image 3 | import os 4 | 5 | 6 | class MNISTMDataset(data.Dataset): 7 | def __init__(self, data_root, data_list, transform=None): 8 | self.root = data_root 9 | self.transform = transform 10 | 11 | f = open(data_list, 'r') 12 | data_list = f.readlines() 13 | f.close() 14 | 15 | self.n_data = len(data_list) 16 | 17 | self.img_paths = [] 18 | self.img_labels = [] 19 | 20 | for data in data_list: 21 | self.img_paths.append(data[:-3]) 22 | self.img_labels.append(data[-2]) 23 | 24 | def __getitem__(self, item): 25 | img_paths, labels = self.img_paths[item], self.img_labels[item] 26 | imgs = Image.open(os.path.join(self.root, img_paths)).convert('RGB') 27 | 28 | if self.transform is not None: 29 | imgs = self.transform(imgs) 30 | labels = int(labels) 31 | 32 | return imgs, labels 33 | 34 | def __len__(self): 35 | return self.n_data -------------------------------------------------------------------------------- /older version/t08/tut7/plot_utils.py: -------------------------------------------------------------------------------- 1 | import math 2 | import itertools 3 | 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | 7 | 8 | def tensors_as_images(tensors, nrows=1, figsize=(8, 8), titles=[], 9 | wspace=0.1, hspace=0.2, cmap=None): 10 | """ 11 | Plots a sequence of pytorch tensors as images. 12 | 13 | :param tensors: A sequence of pytorch tensors, should have shape CxWxH 14 | """ 15 | assert nrows > 0 16 | 17 | num_tensors = len(tensors) 18 | 19 | ncols = math.ceil(num_tensors / nrows) 20 | 21 | fig, axes = plt.subplots(nrows=nrows, ncols=ncols, figsize=figsize, 22 | gridspec_kw=dict(wspace=wspace, hspace=hspace), 23 | subplot_kw=dict(yticks=[], xticks=[])) 24 | axes_flat = axes.reshape(-1) 25 | 26 | # Plot each tensor 27 | for i in range(num_tensors): 28 | ax = axes_flat[i] 29 | 30 | image_tensor = tensors[i] 31 | assert image_tensor.dim() == 3 # Make sure shape is CxWxH 32 | 33 | image = image_tensor.numpy() 34 | image = image.transpose(1, 2, 0) 35 | image = image.squeeze() # remove singleton dimensions if any exist 36 | 37 | # Scale to range 0..1 38 | min, max = np.min(image), np.max(image) 39 | image = (image-min) / (max-min) 40 | 41 | ax.imshow(image, cmap=cmap) 42 | 43 | if len(titles) > i and titles[i] is not None: 44 | ax.set_title(titles[i]) 45 | 46 | # If there are more axes than tensors, remove their frames 47 | for j in range(num_tensors, len(axes_flat)): 48 | axes_flat[j].axis('off') 49 | 50 | return fig, axes 51 | 52 | 53 | def dataset_first_n(dataset, n, show_classes=False, class_labels=None, 54 | random_start=True, **kw): 55 | """ 56 | Plots first n images of a dataset containing tensor images. 57 | """ 58 | 59 | if random_start: 60 | start = np.random.randint(0, len(dataset) - n) 61 | stop = start + n 62 | else: 63 | start = 0 64 | stop = n 65 | 66 | # [(img0, cls0), ..., # (imgN, clsN)] 67 | first_n = list(itertools.islice(dataset, start, stop)) 68 | 69 | # Split (image, class) tuples 70 | first_n_images, first_n_classes = zip(*first_n) 71 | 72 | if show_classes: 73 | titles = first_n_classes 74 | if class_labels: 75 | titles = [class_labels[cls] for cls in first_n_classes] 76 | else: 77 | titles = [] 78 | 79 | return tensors_as_images(first_n_images, titles=titles, **kw) 80 | -------------------------------------------------------------------------------- /older version/t09/.gitignore: -------------------------------------------------------------------------------- 1 | out/ 2 | -------------------------------------------------------------------------------- /older version/t09/atari_wrappers.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file was taken from the OpenAI baselines repo: 3 | https://github.com/openai/baselines/ 4 | """ 5 | 6 | import numpy as np 7 | import os 8 | os.environ.setdefault('PATH', '') 9 | from collections import deque 10 | import gym 11 | from gym import spaces 12 | import cv2 13 | cv2.ocl.setUseOpenCL(False) 14 | #from .wrappers import TimeLimit 15 | from gym.wrappers import TimeLimit 16 | 17 | 18 | class NoopResetEnv(gym.Wrapper): 19 | def __init__(self, env, noop_max=30): 20 | """Sample initial states by taking random number of no-ops on reset. 21 | No-op is assumed to be action 0. 22 | """ 23 | gym.Wrapper.__init__(self, env) 24 | self.noop_max = noop_max 25 | self.override_num_noops = None 26 | self.noop_action = 0 27 | assert env.unwrapped.get_action_meanings()[0] == 'NOOP' 28 | 29 | def reset(self, **kwargs): 30 | """ Do no-op action for a number of steps in [1, noop_max].""" 31 | self.env.reset(**kwargs) 32 | if self.override_num_noops is not None: 33 | noops = self.override_num_noops 34 | else: 35 | noops = self.unwrapped.np_random.randint(1, self.noop_max + 1) #pylint: disable=E1101 36 | assert noops > 0 37 | obs = None 38 | for _ in range(noops): 39 | obs, _, done, _ = self.env.step(self.noop_action) 40 | if done: 41 | obs = self.env.reset(**kwargs) 42 | return obs 43 | 44 | def step(self, ac): 45 | return self.env.step(ac) 46 | 47 | class FireResetEnv(gym.Wrapper): 48 | def __init__(self, env): 49 | """Take action on reset for environments that are fixed until firing.""" 50 | gym.Wrapper.__init__(self, env) 51 | assert env.unwrapped.get_action_meanings()[1] == 'FIRE' 52 | assert len(env.unwrapped.get_action_meanings()) >= 3 53 | 54 | def reset(self, **kwargs): 55 | self.env.reset(**kwargs) 56 | obs, _, done, _ = self.env.step(1) 57 | if done: 58 | self.env.reset(**kwargs) 59 | obs, _, done, _ = self.env.step(2) 60 | if done: 61 | self.env.reset(**kwargs) 62 | return obs 63 | 64 | def step(self, ac): 65 | return self.env.step(ac) 66 | 67 | class EpisodicLifeEnv(gym.Wrapper): 68 | def __init__(self, env): 69 | """Make end-of-life == end-of-episode, but only reset on true game over. 70 | Done by DeepMind for the DQN and co. since it helps value estimation. 71 | """ 72 | gym.Wrapper.__init__(self, env) 73 | self.lives = 0 74 | self.was_real_done = True 75 | 76 | def step(self, action): 77 | obs, reward, done, info = self.env.step(action) 78 | self.was_real_done = done 79 | # check current lives, make loss of life terminal, 80 | # then update lives to handle bonus lives 81 | lives = self.env.unwrapped.ale.lives() 82 | if lives < self.lives and lives > 0: 83 | # for Qbert sometimes we stay in lives == 0 condition for a few frames 84 | # so it's important to keep lives > 0, so that we only reset once 85 | # the environment advertises done. 86 | done = True 87 | self.lives = lives 88 | return obs, reward, done, info 89 | 90 | def reset(self, **kwargs): 91 | """Reset only when lives are exhausted. 92 | This way all states are still reachable even though lives are episodic, 93 | and the learner need not know about any of this behind-the-scenes. 94 | """ 95 | if self.was_real_done: 96 | obs = self.env.reset(**kwargs) 97 | else: 98 | # no-op step to advance from terminal/lost life state 99 | obs, _, _, _ = self.env.step(0) 100 | self.lives = self.env.unwrapped.ale.lives() 101 | return obs 102 | 103 | class MaxAndSkipEnv(gym.Wrapper): 104 | def __init__(self, env, skip=4): 105 | """Return only every `skip`-th frame""" 106 | gym.Wrapper.__init__(self, env) 107 | # most recent raw observations (for max pooling across time steps) 108 | self._obs_buffer = np.zeros((2,)+env.observation_space.shape, dtype=np.uint8) 109 | self._skip = skip 110 | 111 | def step(self, action): 112 | """Repeat action, sum reward, and max over last observations.""" 113 | total_reward = 0.0 114 | done = None 115 | for i in range(self._skip): 116 | obs, reward, done, info = self.env.step(action) 117 | if i == self._skip - 2: self._obs_buffer[0] = obs 118 | if i == self._skip - 1: self._obs_buffer[1] = obs 119 | total_reward += reward 120 | if done: 121 | break 122 | # Note that the observation on the done=True frame 123 | # doesn't matter 124 | max_frame = self._obs_buffer.max(axis=0) 125 | 126 | return max_frame, total_reward, done, info 127 | 128 | def reset(self, **kwargs): 129 | return self.env.reset(**kwargs) 130 | 131 | class ClipRewardEnv(gym.RewardWrapper): 132 | def __init__(self, env): 133 | gym.RewardWrapper.__init__(self, env) 134 | 135 | def reward(self, reward): 136 | """Bin reward to {+1, 0, -1} by its sign.""" 137 | return np.sign(reward) 138 | 139 | 140 | class WarpFrame(gym.ObservationWrapper): 141 | def __init__(self, env, width=84, height=84, grayscale=True, dict_space_key=None): 142 | """ 143 | Warp frames to 84x84 as done in the Nature paper and later work. 144 | If the environment uses dictionary observations, `dict_space_key` can be specified which indicates which 145 | observation should be warped. 146 | """ 147 | super().__init__(env) 148 | self._width = width 149 | self._height = height 150 | self._grayscale = grayscale 151 | self._key = dict_space_key 152 | if self._grayscale: 153 | num_colors = 1 154 | else: 155 | num_colors = 3 156 | 157 | new_space = gym.spaces.Box( 158 | low=0, 159 | high=255, 160 | shape=(self._height, self._width, num_colors), 161 | dtype=np.uint8, 162 | ) 163 | if self._key is None: 164 | original_space = self.observation_space 165 | self.observation_space = new_space 166 | else: 167 | original_space = self.observation_space.spaces[self._key] 168 | self.observation_space.spaces[self._key] = new_space 169 | assert original_space.dtype == np.uint8 and len(original_space.shape) == 3 170 | 171 | def observation(self, obs): 172 | if self._key is None: 173 | frame = obs 174 | else: 175 | frame = obs[self._key] 176 | 177 | if self._grayscale: 178 | frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY) 179 | frame = cv2.resize( 180 | frame, (self._width, self._height), interpolation=cv2.INTER_AREA 181 | ) 182 | if self._grayscale: 183 | frame = np.expand_dims(frame, -1) 184 | 185 | if self._key is None: 186 | obs = frame 187 | else: 188 | obs = obs.copy() 189 | obs[self._key] = frame 190 | return obs 191 | 192 | 193 | class FrameStack(gym.Wrapper): 194 | def __init__(self, env, k): 195 | """Stack k last frames. 196 | Returns lazy array, which is much more memory efficient. 197 | See Also 198 | -------- 199 | baselines.common.atari_wrappers.LazyFrames 200 | """ 201 | gym.Wrapper.__init__(self, env) 202 | self.k = k 203 | self.frames = deque([], maxlen=k) 204 | shp = env.observation_space.shape 205 | self.observation_space = spaces.Box(low=0, high=255, shape=(shp[:-1] + (shp[-1] * k,)), dtype=env.observation_space.dtype) 206 | 207 | def reset(self): 208 | ob = self.env.reset() 209 | for _ in range(self.k): 210 | self.frames.append(ob) 211 | return self._get_ob() 212 | 213 | def step(self, action): 214 | ob, reward, done, info = self.env.step(action) 215 | self.frames.append(ob) 216 | return self._get_ob(), reward, done, info 217 | 218 | def _get_ob(self): 219 | assert len(self.frames) == self.k 220 | return LazyFrames(list(self.frames)) 221 | 222 | class ScaledFloatFrame(gym.ObservationWrapper): 223 | def __init__(self, env): 224 | gym.ObservationWrapper.__init__(self, env) 225 | self.observation_space = gym.spaces.Box(low=0, high=1, shape=env.observation_space.shape, dtype=np.float32) 226 | 227 | def observation(self, observation): 228 | # careful! This undoes the memory optimization, use 229 | # with smaller replay buffers only. 230 | return np.array(observation).astype(np.float32) / 255.0 231 | 232 | class LazyFrames(object): 233 | def __init__(self, frames): 234 | """This object ensures that common frames between the observations are only stored once. 235 | It exists purely to optimize memory usage which can be huge for DQN's 1M frames replay 236 | buffers. 237 | This object should only be converted to numpy array before being passed to the model. 238 | You'd not believe how complex the previous solution was.""" 239 | self._frames = frames 240 | self._out = None 241 | 242 | def _force(self): 243 | if self._out is None: 244 | self._out = np.concatenate(self._frames, axis=-1) 245 | self._frames = None 246 | return self._out 247 | 248 | def __array__(self, dtype=None): 249 | out = self._force() 250 | if dtype is not None: 251 | out = out.astype(dtype) 252 | return out 253 | 254 | def __len__(self): 255 | return len(self._force()) 256 | 257 | def __getitem__(self, i): 258 | return self._force()[..., i] 259 | 260 | def make_atari(env_id, max_episode_steps=None): 261 | env = gym.make(env_id) 262 | assert 'NoFrameskip' in env.spec.id 263 | env = NoopResetEnv(env, noop_max=30) 264 | env = MaxAndSkipEnv(env, skip=4) 265 | if max_episode_steps is not None: 266 | env = TimeLimit(env, max_episode_steps=max_episode_steps) 267 | return env 268 | 269 | def wrap_deepmind(env, episode_life=True, clip_rewards=True, frame_stack=False, scale=False): 270 | """Configure environment for DeepMind-style Atari. 271 | """ 272 | if episode_life: 273 | env = EpisodicLifeEnv(env) 274 | if 'FIRE' in env.unwrapped.get_action_meanings(): 275 | env = FireResetEnv(env) 276 | env = WarpFrame(env) 277 | if scale: 278 | env = ScaledFloatFrame(env) 279 | if clip_rewards: 280 | env = ClipRewardEnv(env) 281 | if frame_stack: 282 | env = FrameStack(env, 4) 283 | return env 284 | -------------------------------------------------------------------------------- /older version/t09/img/deepmind_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/deepmind_arch.png -------------------------------------------------------------------------------- /older version/t09/img/deepmind_frames.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/deepmind_frames.png -------------------------------------------------------------------------------- /older version/t09/img/deepmind_results1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/deepmind_results1.png -------------------------------------------------------------------------------- /older version/t09/img/deepmind_results2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/deepmind_results2.png -------------------------------------------------------------------------------- /older version/t09/img/mdp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/mdp.png -------------------------------------------------------------------------------- /older version/t09/img/mdp2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/mdp2.png -------------------------------------------------------------------------------- /older version/t09/img/mdp_transition_prob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/mdp_transition_prob.png -------------------------------------------------------------------------------- /older version/t09/img/q_expectation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/q_expectation.png -------------------------------------------------------------------------------- /older version/t09/img/rl_episodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/rl_episodes.png -------------------------------------------------------------------------------- /older version/t09/img/rl_fields.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/rl_fields.png -------------------------------------------------------------------------------- /older version/t09/img/rl_setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/rl_setting.png -------------------------------------------------------------------------------- /older version/t09/img/rl_setting2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/rl_setting2.png -------------------------------------------------------------------------------- /older version/t09/img/space-invaders-atari-2600.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/space-invaders-atari-2600.jpg -------------------------------------------------------------------------------- /older version/t09/img/v_expectation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t09/img/v_expectation.png -------------------------------------------------------------------------------- /older version/t10/img/conv.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t10/img/conv.gif -------------------------------------------------------------------------------- /older version/t10/img/gcn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t10/img/gcn.png -------------------------------------------------------------------------------- /older version/t10/img/laplacian_eigenfunctions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t10/img/laplacian_eigenfunctions.png -------------------------------------------------------------------------------- /older version/t10/img/random_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t10/img/random_graph.png -------------------------------------------------------------------------------- /older version/t10/img/spectral_generalization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t10/img/spectral_generalization.png -------------------------------------------------------------------------------- /older version/t10/img/toeplitz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t10/img/toeplitz.png -------------------------------------------------------------------------------- /older version/t11/img/block_scheduling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/block_scheduling.png -------------------------------------------------------------------------------- /older version/t11/img/execution_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/execution_model.png -------------------------------------------------------------------------------- /older version/t11/img/grid_blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/grid_blocks.png -------------------------------------------------------------------------------- /older version/t11/img/hetero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/hetero.png -------------------------------------------------------------------------------- /older version/t11/img/host_device.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/host_device.png -------------------------------------------------------------------------------- /older version/t11/img/kernel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/kernel.png -------------------------------------------------------------------------------- /older version/t11/img/kernel_geom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/kernel_geom.png -------------------------------------------------------------------------------- /older version/t11/img/matmul_noshared.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/matmul_noshared.png -------------------------------------------------------------------------------- /older version/t11/img/matmul_shared.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/matmul_shared.png -------------------------------------------------------------------------------- /older version/t11/img/mem_global.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/mem_global.png -------------------------------------------------------------------------------- /older version/t11/img/mem_local.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/mem_local.png -------------------------------------------------------------------------------- /older version/t11/img/mem_shared.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/mem_shared.png -------------------------------------------------------------------------------- /older version/t11/img/numba_flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/numba_flowchart.png -------------------------------------------------------------------------------- /older version/t11/img/sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/sm.png -------------------------------------------------------------------------------- /older version/t11/img/thread_id_1d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/older version/t11/img/thread_id_1d.png -------------------------------------------------------------------------------- /run-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -x 4 | 5 | # Runs all the tutotial notebooks 6 | jupyter nbconvert --execute --inplace --to notebook --ExecutePreprocessor.timeout=300 ./t*/*.ipynb 7 | -------------------------------------------------------------------------------- /t00 - python, numpy, torch/demo_package/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Demo package init file. 3 | This file used to be required for defining a python pacakge, until python 3.3. 4 | """ 5 | 6 | # Package init code can be written here 7 | -------------------------------------------------------------------------------- /t00 - python, numpy, torch/demo_package/demo_module.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import math 3 | 4 | 5 | def demo_func(a=1): 6 | """ 7 | Just a demo 8 | """ 9 | print(f'this is a demo, a={a}') 10 | 11 | 12 | # This will be executed when this module is imported for the first time 13 | demo_func(17) 14 | 15 | 16 | if __name__ == '__main__': 17 | """ 18 | This will be executed when the script is run from the command line. 19 | """ 20 | demo_func(a=42) 21 | 22 | -------------------------------------------------------------------------------- /t01 - linear models/imgs/error_types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t01 - linear models/imgs/error_types.png -------------------------------------------------------------------------------- /t01 - linear models/imgs/neuron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t01 - linear models/imgs/neuron.png -------------------------------------------------------------------------------- /t01 - linear models/imgs/perceptron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t01 - linear models/imgs/perceptron.png -------------------------------------------------------------------------------- /t01 - linear models/imgs/sgd1d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t01 - linear models/imgs/sgd1d.png -------------------------------------------------------------------------------- /t01 - linear models/imgs/sgd2d_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t01 - linear models/imgs/sgd2d_2.png -------------------------------------------------------------------------------- /t01 - linear models/plot_utils.py: -------------------------------------------------------------------------------- 1 | import itertools 2 | import math 3 | import matplotlib.pyplot as plt 4 | 5 | 6 | def tensors_as_images(tensors, nrows=1, figsize=(8, 8), titles=[], 7 | wspace=0.1, hspace=0.2, cmap=None): 8 | """ 9 | Plots a sequence of pytorch tensors as images. 10 | :param tensors: A sequence of pytorch tensors, should have shape CxWxH 11 | """ 12 | assert nrows > 0 13 | 14 | num_tensors = len(tensors) 15 | 16 | ncols = math.ceil(num_tensors / nrows) 17 | 18 | fig, axes = plt.subplots(nrows=nrows, ncols=ncols, figsize=figsize, 19 | gridspec_kw=dict(wspace=wspace, hspace=hspace), 20 | subplot_kw=dict(yticks=[], xticks=[])) 21 | axes_flat = axes.reshape(-1) 22 | 23 | # Plot each tensor 24 | for i in range(num_tensors): 25 | ax = axes_flat[i] 26 | 27 | image_tensor = tensors[i] 28 | assert image_tensor.dim() == 3 # Make sure shape is CxWxH 29 | 30 | image = image_tensor.numpy() 31 | image = image.transpose(1, 2, 0) 32 | image = image.squeeze() # remove singleton dimensions if any exist 33 | 34 | ax.imshow(image, cmap=cmap) 35 | 36 | if len(titles) > i and titles[i] is not None: 37 | ax.set_title(titles[i]) 38 | 39 | # If there are more axes than tensors, remove their frames 40 | for j in range(num_tensors, len(axes_flat)): 41 | axes_flat[j].axis('off') 42 | 43 | return fig, axes 44 | 45 | 46 | def dataset_first_n(dataset, n, show_classes=False, class_labels=None, **kw): 47 | """ 48 | Plots first n images of a dataset containing tensor images. 49 | """ 50 | 51 | # [(img0, cls0), ..., # (imgN, clsN)] 52 | first_n = list(itertools.islice(dataset, n)) 53 | 54 | # Split (image, class) tuples 55 | first_n_images, first_n_classes = zip(*first_n) 56 | 57 | if show_classes: 58 | titles = first_n_classes 59 | if class_labels: 60 | titles = [class_labels[cls] for cls in first_n_classes] 61 | else: 62 | titles = [] 63 | 64 | return tensors_as_images(first_n_images, titles=titles, **kw) 65 | -------------------------------------------------------------------------------- /t02 - mlp/imgs/linear_discriminant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t02 - mlp/imgs/linear_discriminant.png -------------------------------------------------------------------------------- /t02 - mlp/imgs/mlp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t02 - mlp/imgs/mlp.png -------------------------------------------------------------------------------- /t02 - mlp/imgs/neuron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t02 - mlp/imgs/neuron.png -------------------------------------------------------------------------------- /t02 - mlp/imgs/nonlinear_datasets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t02 - mlp/imgs/nonlinear_datasets.png -------------------------------------------------------------------------------- /t02 - mlp/imgs/overfit_1-2-4HL_3N.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t02 - mlp/imgs/overfit_1-2-4HL_3N.jpg -------------------------------------------------------------------------------- /t02 - mlp/imgs/overfit_1HL_3-6-20N.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t02 - mlp/imgs/overfit_1HL_3-6-20N.jpg -------------------------------------------------------------------------------- /t02 - mlp/imgs/perceptron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t02 - mlp/imgs/perceptron.png -------------------------------------------------------------------------------- /t02 - mlp/imgs/perceptron_db.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t02 - mlp/imgs/perceptron_db.png -------------------------------------------------------------------------------- /t02 - mlp/plot_utils.py: -------------------------------------------------------------------------------- 1 | import itertools 2 | import math 3 | import matplotlib.pyplot as plt 4 | 5 | 6 | def tensors_as_images(tensors, nrows=1, figsize=(8, 8), titles=[], 7 | wspace=0.1, hspace=0.2, cmap=None): 8 | """ 9 | Plots a sequence of pytorch tensors as images. 10 | :param tensors: A sequence of pytorch tensors, should have shape CxWxH 11 | """ 12 | assert nrows > 0 13 | 14 | num_tensors = len(tensors) 15 | 16 | ncols = math.ceil(num_tensors / nrows) 17 | 18 | fig, axes = plt.subplots(nrows=nrows, ncols=ncols, figsize=figsize, 19 | gridspec_kw=dict(wspace=wspace, hspace=hspace), 20 | subplot_kw=dict(yticks=[], xticks=[])) 21 | axes_flat = axes.reshape(-1) 22 | 23 | # Plot each tensor 24 | for i in range(num_tensors): 25 | ax = axes_flat[i] 26 | 27 | image_tensor = tensors[i] 28 | assert image_tensor.dim() == 3 # Make sure shape is CxWxH 29 | 30 | image = image_tensor.numpy() 31 | image = image.transpose(1, 2, 0) 32 | image = image.squeeze() # remove singleton dimensions if any exist 33 | 34 | ax.imshow(image, cmap=cmap) 35 | 36 | if len(titles) > i and titles[i] is not None: 37 | ax.set_title(titles[i]) 38 | 39 | # If there are more axes than tensors, remove their frames 40 | for j in range(num_tensors, len(axes_flat)): 41 | axes_flat[j].axis('off') 42 | 43 | return fig, axes 44 | 45 | 46 | def dataset_first_n(dataset, n, show_classes=False, class_labels=None, **kw): 47 | """ 48 | Plots first n images of a dataset containing tensor images. 49 | """ 50 | 51 | # [(img0, cls0), ..., # (imgN, clsN)] 52 | first_n = list(itertools.islice(dataset, n)) 53 | 54 | # Split (image, class) tuples 55 | first_n_images, first_n_classes = zip(*first_n) 56 | 57 | if show_classes: 58 | titles = first_n_classes 59 | if class_labels: 60 | titles = [class_labels[cls] for cls in first_n_classes] 61 | else: 62 | titles = [] 63 | 64 | return tensors_as_images(first_n_images, titles=titles, **kw) 65 | -------------------------------------------------------------------------------- /t03 - CNN/img/1x1_conv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/1x1_conv.png -------------------------------------------------------------------------------- /t03 - CNN/img/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/arch.png -------------------------------------------------------------------------------- /t03 - CNN/img/cat_translation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/cat_translation.png -------------------------------------------------------------------------------- /t03 - CNN/img/classification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/classification.png -------------------------------------------------------------------------------- /t03 - CNN/img/cnn_filters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/cnn_filters.png -------------------------------------------------------------------------------- /t03 - CNN/img/cnn_layer.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/cnn_layer.jpeg -------------------------------------------------------------------------------- /t03 - CNN/img/cnn_layers.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/cnn_layers.jpeg -------------------------------------------------------------------------------- /t03 - CNN/img/conv.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/conv.gif -------------------------------------------------------------------------------- /t03 - CNN/img/deeper_meme.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/deeper_meme.jpeg -------------------------------------------------------------------------------- /t03 - CNN/img/depthcol.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/depthcol.jpeg -------------------------------------------------------------------------------- /t03 - CNN/img/feature_hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/feature_hierarchy.png -------------------------------------------------------------------------------- /t03 - CNN/img/filter_resp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/filter_resp.png -------------------------------------------------------------------------------- /t03 - CNN/img/fully_conv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/fully_conv.png -------------------------------------------------------------------------------- /t03 - CNN/img/maxpool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/maxpool.png -------------------------------------------------------------------------------- /t03 - CNN/img/mlp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/mlp.png -------------------------------------------------------------------------------- /t03 - CNN/img/net_archs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/net_archs.png -------------------------------------------------------------------------------- /t03 - CNN/img/overfit_1-2-4HL_3N.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/overfit_1-2-4HL_3N.jpg -------------------------------------------------------------------------------- /t03 - CNN/img/overfit_1HL_3-6-20N.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/overfit_1HL_3-6-20N.jpg -------------------------------------------------------------------------------- /t03 - CNN/img/pooling_invariance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/pooling_invariance.png -------------------------------------------------------------------------------- /t03 - CNN/img/receptive_field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/receptive_field.png -------------------------------------------------------------------------------- /t03 - CNN/img/receptive_field2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/receptive_field2.png -------------------------------------------------------------------------------- /t03 - CNN/img/regression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/regression.png -------------------------------------------------------------------------------- /t03 - CNN/img/resnet_arch_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/resnet_arch_table.png -------------------------------------------------------------------------------- /t03 - CNN/img/resnet_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/resnet_block.png -------------------------------------------------------------------------------- /t03 - CNN/img/resnet_block2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/resnet_block2.png -------------------------------------------------------------------------------- /t03 - CNN/img/resnet_plain_deep_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/resnet_plain_deep_error.png -------------------------------------------------------------------------------- /t03 - CNN/img/toeplitz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/toeplitz.png -------------------------------------------------------------------------------- /t03 - CNN/img/vanilla_dnn_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/vanilla_dnn_scale.png -------------------------------------------------------------------------------- /t03 - CNN/img/zf1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/zf1.png -------------------------------------------------------------------------------- /t03 - CNN/img/zf2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t03 - CNN/img/zf2.png -------------------------------------------------------------------------------- /t04 - optimization/DJIA_30/all_stocks_2006-01-01_to_2018-01-01.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/DJIA_30/all_stocks_2006-01-01_to_2018-01-01.csv.gz -------------------------------------------------------------------------------- /t04 - optimization/imgs/Figure1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/Figure1.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/Figure4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/Figure4.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/backprop-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/backprop-graph.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/backprop-modular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/backprop-modular.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/bilevel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/bilevel.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/enc-pred-dec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/enc-pred-dec.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/figure2-highres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/figure2-highres.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/flat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/flat.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/lr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/lr.gif -------------------------------------------------------------------------------- /t04 - optimization/imgs/paraboloid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/paraboloid.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/scheduler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/scheduler.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/sgd-init.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/sgd-init.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/sgd-loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/sgd-loss.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/sgd-lr-schedule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/sgd-lr-schedule.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/sgd-lr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/sgd-lr.png -------------------------------------------------------------------------------- /t04 - optimization/imgs/sgd-zigzag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t04 - optimization/imgs/sgd-zigzag.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/Figure1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/Figure1.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/Figure4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/Figure4.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/add_mult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/add_mult.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/backprop-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/backprop-graph.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/backprop-modular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/backprop-modular.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/backwardAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/backwardAD.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/bilevel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/bilevel.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/chain.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/chain_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/chain_forward.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/chain_forwardAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/chain_forwardAD.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/chain_reverseAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/chain_reverseAD.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/enc-pred-dec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/enc-pred-dec.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/example_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/example_forward.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/example_forwardAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/example_forwardAD.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/example_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/example_graph.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/example_reverseAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/example_reverseAD.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/figure2-highres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/figure2-highres.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/flat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/flat.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/forwardAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/forwardAD.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/sgd-init.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/sgd-init.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/sgd-loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/sgd-loss.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/sgd-lr-schedule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/sgd-lr-schedule.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/sgd-lr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/sgd-lr.png -------------------------------------------------------------------------------- /t05 - automatic differentiation/imgs/sgd-zigzag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t05 - automatic differentiation/imgs/sgd-zigzag.png -------------------------------------------------------------------------------- /t06- Object detection/assets/fl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/fl.png -------------------------------------------------------------------------------- /t06- Object detection/assets/instance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/instance.png -------------------------------------------------------------------------------- /t06- Object detection/assets/panoptic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/panoptic.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_cat.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_catdog.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_catdog.jpeg -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_detection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_detection.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_detectron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_detectron.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_diagram.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_dog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_dog.jpg -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_faster_rcnn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_faster_rcnn.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_faster_rcnn_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_faster_rcnn_arch.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_nms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_nms.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_pyramid.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_pyramid.PNG -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_rcnn-family-summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_rcnn-family-summary.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_rcnn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_rcnn.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_rcnn2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_rcnn2.jpg -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_roi1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_roi1.PNG -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_roi2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_roi2.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_rpn_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_rpn_1.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_rpn_2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_rpn_2.jpeg -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_selective_search.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_selective_search.jpg -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_size.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_sliding.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_sliding.gif -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_small_big_obj.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_small_big_obj.PNG -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_speed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_speed.jpg -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_ssd_2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_ssd_2.PNG -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_ssd_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_ssd_arch.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_svm.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_svm.PNG -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_warp.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_warp.PNG -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_yolo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_yolo.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_yolo_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_yolo_arch.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_yolov2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_yolov2.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_yolov4arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_yolov4arch.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_objdet_yolov4res.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_objdet_yolov4res.png -------------------------------------------------------------------------------- /t06- Object detection/assets/tut_seg_iou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/tut_seg_iou.png -------------------------------------------------------------------------------- /t06- Object detection/assets/yolo2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/yolo2.jpg -------------------------------------------------------------------------------- /t06- Object detection/assets/yolo8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/yolo8.png -------------------------------------------------------------------------------- /t06- Object detection/assets/רשימת-מסמכים-נדרשים-לדוקטור.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/assets/רשימת-מסמכים-נדרשים-לדוקטור.xlsx -------------------------------------------------------------------------------- /t06- Object detection/imgs/ap_prac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/imgs/ap_prac.png -------------------------------------------------------------------------------- /t06- Object detection/imgs/confmat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/imgs/confmat.png -------------------------------------------------------------------------------- /t06- Object detection/imgs/pr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/imgs/pr.png -------------------------------------------------------------------------------- /t06- Object detection/imgs/prauc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/imgs/prauc.png -------------------------------------------------------------------------------- /t06- Object detection/imgs/prgraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/imgs/prgraph.png -------------------------------------------------------------------------------- /t06- Object detection/imgs/tut_objdet_roi1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t06- Object detection/imgs/tut_objdet_roi1.PNG -------------------------------------------------------------------------------- /t07 - transfer learning/img/cifar10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/cifar10.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/cifar10_100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/cifar10_100.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/cnn_feature_vis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/cnn_feature_vis.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/data_dist.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/data_dist.jpg -------------------------------------------------------------------------------- /t07 - transfer learning/img/ganin_da.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/ganin_da.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/ganin_da2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/ganin_da2.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/ganin_da3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/ganin_da3.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/mnist_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/mnist_m.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/pan_yang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/pan_yang.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/target-dist-shift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/target-dist-shift.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/temp-dist.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/temp-dist.jpg -------------------------------------------------------------------------------- /t07 - transfer learning/img/tl_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/tl_example.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/transfer-learning-medical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/transfer-learning-medical.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/transfer_learning_digits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/transfer_learning_digits.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/transferlearning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/transferlearning.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/zf1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/zf1.png -------------------------------------------------------------------------------- /t07 - transfer learning/img/zf2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t07 - transfer learning/img/zf2.png -------------------------------------------------------------------------------- /t07 - transfer learning/tut7/data.py: -------------------------------------------------------------------------------- 1 | import torch.utils.data as data 2 | from PIL import Image 3 | import os 4 | 5 | 6 | class MNISTMDataset(data.Dataset): 7 | def __init__(self, data_root, data_list, transform=None): 8 | self.root = data_root 9 | self.transform = transform 10 | 11 | f = open(data_list, 'r') 12 | data_list = f.readlines() 13 | f.close() 14 | 15 | self.n_data = len(data_list) 16 | 17 | self.img_paths = [] 18 | self.img_labels = [] 19 | 20 | for data in data_list: 21 | self.img_paths.append(data[:-3]) 22 | self.img_labels.append(data[-2]) 23 | 24 | def __getitem__(self, item): 25 | img_paths, labels = self.img_paths[item], self.img_labels[item] 26 | imgs = Image.open(os.path.join(self.root, img_paths)).convert('RGB') 27 | 28 | if self.transform is not None: 29 | imgs = self.transform(imgs) 30 | labels = int(labels) 31 | 32 | return imgs, labels 33 | 34 | def __len__(self): 35 | return self.n_data -------------------------------------------------------------------------------- /t07 - transfer learning/tut7/plot_utils.py: -------------------------------------------------------------------------------- 1 | import math 2 | import itertools 3 | 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | 7 | 8 | def tensors_as_images(tensors, nrows=1, figsize=(8, 8), titles=[], 9 | wspace=0.1, hspace=0.2, cmap=None): 10 | """ 11 | Plots a sequence of pytorch tensors as images. 12 | 13 | :param tensors: A sequence of pytorch tensors, should have shape CxWxH 14 | """ 15 | assert nrows > 0 16 | 17 | num_tensors = len(tensors) 18 | 19 | ncols = math.ceil(num_tensors / nrows) 20 | 21 | fig, axes = plt.subplots(nrows=nrows, ncols=ncols, figsize=figsize, 22 | gridspec_kw=dict(wspace=wspace, hspace=hspace), 23 | subplot_kw=dict(yticks=[], xticks=[])) 24 | axes_flat = axes.reshape(-1) 25 | 26 | # Plot each tensor 27 | for i in range(num_tensors): 28 | ax = axes_flat[i] 29 | 30 | image_tensor = tensors[i] 31 | assert image_tensor.dim() == 3 # Make sure shape is CxWxH 32 | 33 | image = image_tensor.numpy() 34 | image = image.transpose(1, 2, 0) 35 | image = image.squeeze() # remove singleton dimensions if any exist 36 | 37 | # Scale to range 0..1 38 | min, max = np.min(image), np.max(image) 39 | image = (image-min) / (max-min) 40 | 41 | ax.imshow(image, cmap=cmap) 42 | 43 | if len(titles) > i and titles[i] is not None: 44 | ax.set_title(titles[i]) 45 | 46 | # If there are more axes than tensors, remove their frames 47 | for j in range(num_tensors, len(axes_flat)): 48 | axes_flat[j].axis('off') 49 | 50 | return fig, axes 51 | 52 | 53 | def dataset_first_n(dataset, n, show_classes=False, class_labels=None, 54 | random_start=True, **kw): 55 | """ 56 | Plots first n images of a dataset containing tensor images. 57 | """ 58 | 59 | if random_start: 60 | start = np.random.randint(0, len(dataset) - n) 61 | stop = start + n 62 | else: 63 | start = 0 64 | stop = n 65 | 66 | # [(img0, cls0), ..., # (imgN, clsN)] 67 | first_n = list(itertools.islice(dataset, start, stop)) 68 | 69 | # Split (image, class) tuples 70 | first_n_images, first_n_classes = zip(*first_n) 71 | 72 | if show_classes: 73 | titles = first_n_classes 74 | if class_labels: 75 | titles = [class_labels[cls] for cls in first_n_classes] 76 | else: 77 | titles = [] 78 | 79 | return tensors_as_images(first_n_images, titles=titles, **kw) 80 | -------------------------------------------------------------------------------- /t08- RNN/img/bptt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/bptt.png -------------------------------------------------------------------------------- /t08- RNN/img/causal_convolution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/causal_convolution.png -------------------------------------------------------------------------------- /t08- RNN/img/cnn_filters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/cnn_filters.png -------------------------------------------------------------------------------- /t08- RNN/img/mlp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/mlp.png -------------------------------------------------------------------------------- /t08- RNN/img/rnn_cell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/rnn_cell.png -------------------------------------------------------------------------------- /t08- RNN/img/rnn_layered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/rnn_layered.png -------------------------------------------------------------------------------- /t08- RNN/img/rnn_unrolled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/rnn_unrolled.png -------------------------------------------------------------------------------- /t08- RNN/img/rnn_use_cases.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/rnn_use_cases.jpeg -------------------------------------------------------------------------------- /t08- RNN/img/sentiment_analysis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/sentiment_analysis.png -------------------------------------------------------------------------------- /t08- RNN/img/tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/tasks.png -------------------------------------------------------------------------------- /t08- RNN/img/tbptt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/tbptt.png -------------------------------------------------------------------------------- /t08- RNN/img/tcn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/tcn.png -------------------------------------------------------------------------------- /t08- RNN/img/word_embeddings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t08- RNN/img/word_embeddings.png -------------------------------------------------------------------------------- /t09- Attention/img/GRU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/GRU.png -------------------------------------------------------------------------------- /t09- Attention/img/att.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/att.png -------------------------------------------------------------------------------- /t09- Attention/img/attention-glasses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/attention-glasses.png -------------------------------------------------------------------------------- /t09- Attention/img/attention-layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/attention-layer.png -------------------------------------------------------------------------------- /t09- Attention/img/attention-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/attention-text.png -------------------------------------------------------------------------------- /t09- Attention/img/bahdanau2015-annotated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/bahdanau2015-annotated.png -------------------------------------------------------------------------------- /t09- Attention/img/bahdanau2015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/bahdanau2015.png -------------------------------------------------------------------------------- /t09- Attention/img/bleu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/bleu.png -------------------------------------------------------------------------------- /t09- Attention/img/enc_dec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/enc_dec.png -------------------------------------------------------------------------------- /t09- Attention/img/rnn_layered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/rnn_layered.png -------------------------------------------------------------------------------- /t09- Attention/img/rnn_unrolled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/rnn_unrolled.png -------------------------------------------------------------------------------- /t09- Attention/img/seq2seq1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/seq2seq1.png -------------------------------------------------------------------------------- /t09- Attention/img/sutskever2014_pca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/sutskever2014_pca.png -------------------------------------------------------------------------------- /t09- Attention/img/xu2015_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/xu2015_1.png -------------------------------------------------------------------------------- /t09- Attention/img/xu2015_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t09- Attention/img/xu2015_2.png -------------------------------------------------------------------------------- /t10- Transformers/img/GRU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/GRU.png -------------------------------------------------------------------------------- /t10- Transformers/img/Hydra29.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/Hydra29.webp -------------------------------------------------------------------------------- /t10- Transformers/img/SesameStreet-Season46-ShowOpen-29.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/SesameStreet-Season46-ShowOpen-29.webp -------------------------------------------------------------------------------- /t10- Transformers/img/aiayn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/aiayn.png -------------------------------------------------------------------------------- /t10- Transformers/img/att.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/att.png -------------------------------------------------------------------------------- /t10- Transformers/img/attention-glasses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/attention-glasses.png -------------------------------------------------------------------------------- /t10- Transformers/img/attention-layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/attention-layer.png -------------------------------------------------------------------------------- /t10- Transformers/img/attention-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/attention-text.png -------------------------------------------------------------------------------- /t10- Transformers/img/attention_jay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/attention_jay.png -------------------------------------------------------------------------------- /t10- Transformers/img/bahdanau2015-annotated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/bahdanau2015-annotated.png -------------------------------------------------------------------------------- /t10- Transformers/img/bahdanau2015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/bahdanau2015.png -------------------------------------------------------------------------------- /t10- Transformers/img/bayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/bayer.png -------------------------------------------------------------------------------- /t10- Transformers/img/before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/before.png -------------------------------------------------------------------------------- /t10- Transformers/img/bert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/bert.png -------------------------------------------------------------------------------- /t10- Transformers/img/bleu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/bleu.png -------------------------------------------------------------------------------- /t10- Transformers/img/description-image.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/description-image.avif -------------------------------------------------------------------------------- /t10- Transformers/img/dnns-13.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/dnns-13.jpg.webp -------------------------------------------------------------------------------- /t10- Transformers/img/enc_dec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/enc_dec.png -------------------------------------------------------------------------------- /t10- Transformers/img/gpt2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/gpt2.png -------------------------------------------------------------------------------- /t10- Transformers/img/matrix_att_jay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/matrix_att_jay.png -------------------------------------------------------------------------------- /t10- Transformers/img/matrix_att_jay2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/matrix_att_jay2.png -------------------------------------------------------------------------------- /t10- Transformers/img/mhatt_jay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/mhatt_jay.png -------------------------------------------------------------------------------- /t10- Transformers/img/q.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/q.png -------------------------------------------------------------------------------- /t10- Transformers/img/rnn_layered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/rnn_layered.png -------------------------------------------------------------------------------- /t10- Transformers/img/rnn_unrolled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/rnn_unrolled.png -------------------------------------------------------------------------------- /t10- Transformers/img/seq2seq1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/seq2seq1.png -------------------------------------------------------------------------------- /t10- Transformers/img/size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/size.png -------------------------------------------------------------------------------- /t10- Transformers/img/ss.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/ss.PNG -------------------------------------------------------------------------------- /t10- Transformers/img/sutskever2014_pca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/sutskever2014_pca.png -------------------------------------------------------------------------------- /t10- Transformers/img/train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/train.png -------------------------------------------------------------------------------- /t10- Transformers/img/xu2015_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/xu2015_1.png -------------------------------------------------------------------------------- /t10- Transformers/img/xu2015_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t10- Transformers/img/xu2015_2.png -------------------------------------------------------------------------------- /t11- VAE/img/gau.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t11- VAE/img/gau.png -------------------------------------------------------------------------------- /t11- VAE/img/gen_disc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t11- VAE/img/gen_disc.jpg -------------------------------------------------------------------------------- /t11- VAE/img/gmm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t11- VAE/img/gmm.png -------------------------------------------------------------------------------- /t11- VAE/img/vae.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t11- VAE/img/vae.png -------------------------------------------------------------------------------- /t111- efficient CNN/bonus tutorial-efficient CNNs.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "slideshow": { 7 | "slide_type": "slide" 8 | } 9 | }, 10 | "source": [ 11 | "$$\n", 12 | "\\newcommand{\\mat}[1]{\\boldsymbol {#1}}\n", 13 | "\\newcommand{\\mattr}[1]{\\boldsymbol {#1}^\\top}\n", 14 | "\\newcommand{\\matinv}[1]{\\boldsymbol {#1}^{-1}}\n", 15 | "\\newcommand{\\vec}[1]{\\boldsymbol {#1}}\n", 16 | "\\newcommand{\\vectr}[1]{\\boldsymbol {#1}^\\top}\n", 17 | "\\newcommand{\\rvar}[1]{\\mathrm {#1}}\n", 18 | "\\newcommand{\\rvec}[1]{\\boldsymbol{\\mathrm{#1}}}\n", 19 | "\\newcommand{\\diag}{\\mathop{\\mathrm {diag}}}\n", 20 | "\\newcommand{\\set}[1]{\\mathbb {#1}}\n", 21 | "\\newcommand{\\norm}[1]{\\left\\lVert#1\\right\\rVert}\n", 22 | "\\newcommand{\\pderiv}[2]{\\frac{\\partial #1}{\\partial #2}}\n", 23 | "\\newcommand{\\bb}[1]{\\boldsymbol{#1}}\n", 24 | "$$\n", 25 | "\n", 26 | "\n", 27 | "# CS236781: Deep Learning\n", 28 | "# Bonus Tutorial: Efficient and special CNNs" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "metadata": { 34 | "slideshow": { 35 | "slide_type": "subslide" 36 | } 37 | }, 38 | "source": [ 39 | "## Introduction\n", 40 | "\n", 41 | "In this tutorial, we will cover:\n", 42 | "\n", 43 | "- Recup over resnets\n", 44 | "- Batch Normalization\n", 45 | "- SqueezeNet\n", 46 | "- Depthwise Separable Convolutions\n", 47 | "- MobileNet\n", 48 | "- MobileNet v2\n", 49 | "- MobileNet v3\n", 50 | "- ShuffleNet \n", 51 | "- EfficientNet " 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": 1, 57 | "metadata": { 58 | "execution": { 59 | "iopub.execute_input": "2022-03-24T07:23:40.304945Z", 60 | "iopub.status.busy": "2022-03-24T07:23:40.300065Z", 61 | "iopub.status.idle": "2022-03-24T07:23:41.606026Z", 62 | "shell.execute_reply": "2022-03-24T07:23:41.605724Z" 63 | }, 64 | "slideshow": { 65 | "slide_type": "subslide" 66 | } 67 | }, 68 | "outputs": [], 69 | "source": [ 70 | "# Setup\n", 71 | "%matplotlib inline\n", 72 | "import os\n", 73 | "import sys\n", 74 | "import torch\n", 75 | "import torchvision\n", 76 | "import matplotlib.pyplot as plt" 77 | ] 78 | }, 79 | { 80 | "cell_type": "code", 81 | "execution_count": 2, 82 | "metadata": { 83 | "execution": { 84 | "iopub.execute_input": "2022-03-24T07:23:41.608025Z", 85 | "iopub.status.busy": "2022-03-24T07:23:41.607915Z", 86 | "iopub.status.idle": "2022-03-24T07:23:41.621298Z", 87 | "shell.execute_reply": "2022-03-24T07:23:41.621040Z" 88 | }, 89 | "slideshow": { 90 | "slide_type": "fragment" 91 | } 92 | }, 93 | "outputs": [], 94 | "source": [ 95 | "plt.rcParams['font.size'] = 20\n", 96 | "data_dir = os.path.expanduser('~/.pytorch-datasets')" 97 | ] 98 | }, 99 | { 100 | "cell_type": "markdown", 101 | "metadata": { 102 | "slideshow": { 103 | "slide_type": "slide" 104 | } 105 | }, 106 | "source": [ 107 | "## Theory Reminders" 108 | ] 109 | }, 110 | { 111 | "cell_type": "markdown", 112 | "metadata": { 113 | "slideshow": { 114 | "slide_type": "fragment" 115 | } 116 | }, 117 | "source": [ 118 | "### Convolution neural networks (CNNs)" 119 | ] 120 | }, 121 | { 122 | "cell_type": "markdown", 123 | "metadata": { 124 | "slideshow": { 125 | "slide_type": "slide" 126 | } 127 | }, 128 | "source": [ 129 | "
" 130 | ] 131 | }, 132 | { 133 | "cell_type": "markdown", 134 | "metadata": { 135 | "slideshow": { 136 | "slide_type": "subslide" 137 | } 138 | }, 139 | "source": [ 140 | "#### Resnet\n", 141 | "\n", 142 | "
\n", 143 | "\n", 144 | "(Left: basic block; right: bottleneck block).\n", 145 | "\n", 146 | "Here the weight layers are `3x3` or `1x1` convolutions followed by batch-normalization." 147 | ] 148 | }, 149 | { 150 | "cell_type": "markdown", 151 | "metadata": { 152 | "slideshow": { 153 | "slide_type": "subslide" 154 | } 155 | }, 156 | "source": [ 157 | "
\n", 158 | "\n", 159 | "\n", 160 | "
" 161 | ] 162 | }, 163 | { 164 | "cell_type": "markdown", 165 | "metadata": { 166 | "slideshow": { 167 | "slide_type": "slide" 168 | } 169 | }, 170 | "source": [ 171 | "### Batch Normalization" 172 | ] 173 | }, 174 | { 175 | "cell_type": "markdown", 176 | "metadata": { 177 | "slideshow": { 178 | "slide_type": "fragment" 179 | } 180 | }, 181 | "source": [ 182 | "Batch normalization is a technique for improving the speed, performance, and stability of deep neural networks.\n", 183 | "It is used to normalize the input layer by adjusting and scaling the activations.\n", 184 | "BN works for all pixels of the feature - channel-wize ( $\\in \\mathcal{R}^c$).\n", 185 | "\n", 186 | "The original goal was to accelerating training by reducing **Internal Covariate Shift**\n", 187 | "**Covariate Shift** is when the distribution of input data shifts between the training environment and live environment.\n", 188 | "reducing the shift- i.e, make not only the input be normal distributed but also the intermidiate features, shuld accelerate the learning process.\n", 189 | "\n", 190 | "This claim was disproof to some degree, and [other suggestions](https://arxiv.org/pdf/1805.11604.pdf) claims that it improves the Lipschitzness of both the loss and the gradients. In other words, it creates a smoother loss landscape that is easier to optimize the hypotesis over.\n", 191 | "\"scale\"\n" 192 | ] 193 | }, 194 | { 195 | "cell_type": "markdown", 196 | "metadata": { 197 | "slideshow": { 198 | "slide_type": "subslide" 199 | } 200 | }, 201 | "source": [ 202 | "**Batch Norm** has 4 groups of parameters, two are learnable and the other are statistical from the data\n", 203 | "
\"scale\"
\n", 204 | "But at test time, we cannot use the statistics of a batch to classify (why?)" 205 | ] 206 | }, 207 | { 208 | "cell_type": "markdown", 209 | "metadata": { 210 | "slideshow": { 211 | "slide_type": "subslide" 212 | } 213 | }, 214 | "source": [ 215 | "#### During trainig\n", 216 | "
\"scale\"
\n", 217 | "\n", 218 | "the momentum $\\alpha = 0.9$ and epsilon is 1e-5 to avoid devision by 0\n", 219 | "\n" 220 | ] 221 | }, 222 | { 223 | "cell_type": "markdown", 224 | "metadata": { 225 | "slideshow": { 226 | "slide_type": "subslide" 227 | } 228 | }, 229 | "source": [ 230 | "#### During test\n", 231 | "
\"scale\"
" 232 | ] 233 | }, 234 | { 235 | "cell_type": "code", 236 | "execution_count": 3, 237 | "metadata": { 238 | "slideshow": { 239 | "slide_type": "subslide" 240 | } 241 | }, 242 | "outputs": [], 243 | "source": [ 244 | "import torch.nn as nn\n", 245 | "\n", 246 | "# A function to count the number of parameters in an nn.Module.\n", 247 | "def num_params(layer):\n", 248 | " return sum([p.numel() for p in layer.parameters()])\n" 249 | ] 250 | }, 251 | { 252 | "cell_type": "markdown", 253 | "metadata": { 254 | "slideshow": { 255 | "slide_type": "fragment" 256 | } 257 | }, 258 | "source": [ 259 | "Let's use torch BN2D" 260 | ] 261 | }, 262 | { 263 | "cell_type": "code", 264 | "execution_count": 4, 265 | "metadata": { 266 | "slideshow": { 267 | "slide_type": "fragment" 268 | } 269 | }, 270 | "outputs": [ 271 | { 272 | "name": "stdout", 273 | "output_type": "stream", 274 | "text": [ 275 | "bn1: 20 parameters\n" 276 | ] 277 | } 278 | ], 279 | "source": [ 280 | "# First conv layer: works on input image volume\n", 281 | "bn1 = nn.BatchNorm2d(10)\n", 282 | "print(f'bn1: {num_params(bn1)} parameters')" 283 | ] 284 | }, 285 | { 286 | "cell_type": "markdown", 287 | "metadata": { 288 | "slideshow": { 289 | "slide_type": "fragment" 290 | } 291 | }, 292 | "source": [ 293 | "What would be the output shape?" 294 | ] 295 | }, 296 | { 297 | "cell_type": "code", 298 | "execution_count": 5, 299 | "metadata": { 300 | "slideshow": { 301 | "slide_type": "fragment" 302 | } 303 | }, 304 | "outputs": [ 305 | { 306 | "data": { 307 | "text/plain": [ 308 | "torch.Size([1, 10, 32, 32])" 309 | ] 310 | }, 311 | "execution_count": 5, 312 | "metadata": {}, 313 | "output_type": "execute_result" 314 | } 315 | ], 316 | "source": [ 317 | "input_fm = torch.randn(1,10,32,32)\n", 318 | "output_fm = bn1(input_fm)\n", 319 | "output_fm.shape" 320 | ] 321 | }, 322 | { 323 | "cell_type": "markdown", 324 | "metadata": { 325 | "slideshow": { 326 | "slide_type": "slide" 327 | } 328 | }, 329 | "source": [ 330 | "# Efficiency in nueral networks" 331 | ] 332 | }, 333 | { 334 | "cell_type": "markdown", 335 | "metadata": { 336 | "execution": { 337 | "iopub.execute_input": "2022-03-24T07:23:42.496857Z", 338 | "iopub.status.busy": "2022-03-24T07:23:42.496774Z", 339 | "iopub.status.idle": "2022-03-24T07:23:42.511150Z", 340 | "shell.execute_reply": "2022-03-24T07:23:42.510875Z" 341 | }, 342 | "slideshow": { 343 | "slide_type": "fragment" 344 | } 345 | }, 346 | "source": [ 347 | "Besides of creating better models, the deep learning revolution came to edge devices, like phones, drones, cars and more.\n", 348 | "\n", 349 | "The race to create compact yet sufficient models has began.\n" 350 | ] 351 | }, 352 | { 353 | "cell_type": "markdown", 354 | "metadata": { 355 | "slideshow": { 356 | "slide_type": "subslide" 357 | } 358 | }, 359 | "source": [ 360 | "## Separable Convolutions" 361 | ] 362 | }, 363 | { 364 | "cell_type": "markdown", 365 | "metadata": { 366 | "slideshow": { 367 | "slide_type": "fragment" 368 | } 369 | }, 370 | "source": [ 371 | "We already know that convolution operation is a sparse matrix multiplication.\n", 372 | "\n", 373 | "What if we could decompose this matrix?" 374 | ] 375 | }, 376 | { 377 | "cell_type": "markdown", 378 | "metadata": { 379 | "slideshow": { 380 | "slide_type": "subslide" 381 | } 382 | }, 383 | "source": [ 384 | "### Spatially Separable Convolutions\n", 385 | "\n", 386 | "The spatially separable convolution operates on the 2D spatial dimensions of images, i.e. height and width. Conceptually, spatially separable convolution decomposes a convolution into two separate operations. For an example shown below, a Sobel kernel, which is a 3x3 kernel, is divided into a 3x1 and 1x3 kernel.\n", 387 | "\n", 388 | "
\"scale\"
" 389 | ] 390 | }, 391 | { 392 | "cell_type": "markdown", 393 | "metadata": { 394 | "slideshow": { 395 | "slide_type": "subslide" 396 | } 397 | }, 398 | "source": [ 399 | "Naturally, it would look like that:\n", 400 | "\n", 401 | "
\"scale\"
\n", 402 | "\n", 403 | "And while $1\\times H \\times W$ input image with $f\\times f$ convolution would do (no padding) $(H-2)\\times(W-2)\\times f \\times f$ multiplications.\n", 404 | "\n", 405 | "Spatially Separable Convolutions would do $(H-2) \\times W \\times f + (H-2) \\times (W-2)\\times f $ multiplications.\n", 406 | "\n", 407 | "The drawback is the types of convolution we can represent and can be decomposed like that." 408 | ] 409 | }, 410 | { 411 | "cell_type": "markdown", 412 | "metadata": { 413 | "slideshow": { 414 | "slide_type": "subslide" 415 | } 416 | }, 417 | "source": [ 418 | "## Depthwise Separable Convolutions:" 419 | ] 420 | }, 421 | { 422 | "cell_type": "markdown", 423 | "metadata": { 424 | "slideshow": { 425 | "slide_type": "fragment" 426 | } 427 | }, 428 | "source": [ 429 | "Another way to reduce computation complexity is to devide the input channels per convolution." 430 | ] 431 | }, 432 | { 433 | "cell_type": "markdown", 434 | "metadata": { 435 | "slideshow": { 436 | "slide_type": "subslide" 437 | } 438 | }, 439 | "source": [ 440 | "### Depthwise Convolution\n", 441 | "\n", 442 | "Let's look at 128 convolution kernels of 3x3 with input of size 3x7x7:\n", 443 | "\n", 444 | "
\"scale\"
\n", 445 | "\n", 446 | "we see that each channel of the output contain information from all input channels.\n", 447 | "\n", 448 | "However, we can devide each input channel seperatly and convolve kernels with a dept of 1:\n", 449 | "\n", 450 | "\n", 451 | "
\"scale\"
\n" 452 | ] 453 | }, 454 | { 455 | "cell_type": "markdown", 456 | "metadata": { 457 | "slideshow": { 458 | "slide_type": "fragment" 459 | } 460 | }, 461 | "source": [ 462 | "What seems to be the problems?" 463 | ] 464 | }, 465 | { 466 | "cell_type": "markdown", 467 | "metadata": { 468 | "slideshow": { 469 | "slide_type": "subslide" 470 | } 471 | }, 472 | "source": [ 473 | "In order to aggregate the information and create a rich feature map, we add anothe step of 1x1 conv that expand the feature map:\n", 474 | "\n", 475 | "
\"scale\"
\n" 476 | ] 477 | }, 478 | { 479 | "cell_type": "code", 480 | "execution_count": 6, 481 | "metadata": { 482 | "slideshow": { 483 | "slide_type": "subslide" 484 | } 485 | }, 486 | "outputs": [], 487 | "source": [ 488 | "class depthwise_separable_conv(nn.Module):\n", 489 | " def __init__(self, nin, kernels_per_layer, nout): \n", 490 | " super(depthwise_separable_conv, self).__init__() \n", 491 | " self.depthwise = nn.Conv2d(nin, nin * kernels_per_layer, kernel_size=3, padding=1, groups=nin) \n", 492 | " self.pointwise = nn.Conv2d(nin * kernels_per_layer, nout, kernel_size=1) \n", 493 | " def forward(self, x): \n", 494 | " out = self.depthwise(x) \n", 495 | " out = self.pointwise(out) \n", 496 | " return out" 497 | ] 498 | }, 499 | { 500 | "cell_type": "code", 501 | "execution_count": 20, 502 | "metadata": { 503 | "slideshow": { 504 | "slide_type": "fragment" 505 | } 506 | }, 507 | "outputs": [ 508 | { 509 | "name": "stdout", 510 | "output_type": "stream", 511 | "text": [ 512 | "input shape: torch.Size([1, 10, 32, 32])\n", 513 | "DS Conv output shape: torch.Size([1, 128, 32, 32])\n" 514 | ] 515 | } 516 | ], 517 | "source": [ 518 | "conv = nn.Conv2d(input_fm.shape[1],3,128)\n", 519 | "dsc = depthwise_separable_conv(input_fm.shape[1],3,128)\n", 520 | "print(f'input shape: {input_fm.shape}')\n", 521 | "print(f'DS Conv output shape: {dsc(input_fm).shape}')\n" 522 | ] 523 | }, 524 | { 525 | "cell_type": "code", 526 | "execution_count": 21, 527 | "metadata": { 528 | "slideshow": { 529 | "slide_type": "fragment" 530 | } 531 | }, 532 | "outputs": [ 533 | { 534 | "name": "stdout", 535 | "output_type": "stream", 536 | "text": [ 537 | "simple convolution has: 491523 parameters\n", 538 | "depthwise separable conv has: 4268 parameters\n" 539 | ] 540 | } 541 | ], 542 | "source": [ 543 | "print(f'simple convolution has: {num_params(conv)} parameters')\n", 544 | "print(f'depthwise separable conv has: {num_params(dsc)} parameters')" 545 | ] 546 | }, 547 | { 548 | "cell_type": "markdown", 549 | "metadata": { 550 | "slideshow": { 551 | "slide_type": "slide" 552 | } 553 | }, 554 | "source": [ 555 | "### SqueezeNet" 556 | ] 557 | }, 558 | { 559 | "cell_type": "markdown", 560 | "metadata": { 561 | "execution": { 562 | "iopub.execute_input": "2022-03-24T07:23:42.512891Z", 563 | "iopub.status.busy": "2022-03-24T07:23:42.512788Z", 564 | "iopub.status.idle": "2022-03-24T07:23:42.532553Z", 565 | "shell.execute_reply": "2022-03-24T07:23:42.532226Z" 566 | }, 567 | "scrolled": true, 568 | "slideshow": { 569 | "slide_type": "fragment" 570 | } 571 | }, 572 | "source": [ 573 | "First attempt to make a mobile device friently model\n", 574 | "\n", 575 | "The main building block in SqueezeNet is the **Fire module**\n", 576 | "\n", 577 | "\n", 578 | "
" 579 | ] 580 | }, 581 | { 582 | "cell_type": "markdown", 583 | "metadata": { 584 | "slideshow": { 585 | "slide_type": "subslide" 586 | } 587 | }, 588 | "source": [ 589 | "It first has a **squeeze layer**. This is a 1×1 convolution that reduces the number of channels, for example from 64 to 16 in the above picture.\n", 590 | "\n", 591 | "This is followed by an **expand block**: two parallel convolution layers: one with a 1×1 kernel, the other with a 3×3 kernel. These conv layers also increase the number of channels again, from 16 back to 64. Their outputs are concatenated, so the output of this fire module has 128 channels in total.\n", 592 | "\n", 593 | "The idea exist in Resnet bottleneck blocks as well, yet the model has about 10% from the Resnet18 parameters!" 594 | ] 595 | }, 596 | { 597 | "cell_type": "markdown", 598 | "metadata": { 599 | "slideshow": { 600 | "slide_type": "fragment" 601 | } 602 | }, 603 | "source": [ 604 | "#### Preformence (ImageNet 1K):\n", 605 | "\n", 606 | "* Accuracy: 57.5%\n", 607 | "\n", 608 | "* Parameters 1.25M \n", 609 | "\n", 610 | "to compare to other networks: (Resnet18 - 11.75M (acc-69.758%) , Resnet50 - 23.5M (acc - 80.8%), VGG16 - 134.7M (acc ~ 64%))" 611 | ] 612 | }, 613 | { 614 | "cell_type": "markdown", 615 | "metadata": { 616 | "slideshow": { 617 | "slide_type": "slide" 618 | } 619 | }, 620 | "source": [ 621 | "## MobileNet" 622 | ] 623 | }, 624 | { 625 | "cell_type": "markdown", 626 | "metadata": { 627 | "slideshow": { 628 | "slide_type": "subslide" 629 | } 630 | }, 631 | "source": [ 632 | "The main idea, was to use **Depthwise Separable Convolutions** instead of the expensive regular ones..\n", 633 | "\n", 634 | "MobileNet v1 consists of 13 convolution blocks in a row. It does not use max pooling to reduce the spatial dimensions, but some of the depthwise layers have stride 2.\n", 635 | "\n", 636 | "At the end is a global average pooling layer followed by a fully-connected layer.\n", 637 | "\n", 638 | "Often ReLU6 is used as the activation function instead of plain old ReLU.\n", 639 | "\n", 640 | "due to increased robustness when used with low-precision computation." 641 | ] 642 | }, 643 | { 644 | "cell_type": "code", 645 | "execution_count": 9, 646 | "metadata": { 647 | "slideshow": { 648 | "slide_type": "fragment" 649 | } 650 | }, 651 | "outputs": [], 652 | "source": [ 653 | "def relu(x):\n", 654 | " return max(0, x)\n", 655 | "def relu6(x):\n", 656 | " return min(max(0, x), 6)" 657 | ] 658 | }, 659 | { 660 | "cell_type": "markdown", 661 | "metadata": { 662 | "slideshow": { 663 | "slide_type": "fragment" 664 | } 665 | }, 666 | "source": [ 667 | "#### Preformence (ImageNet 1K):\n", 668 | "\n", 669 | "* Accuracy: 70.9%\n", 670 | "\n", 671 | "* Parameters 4.2M \n" 672 | ] 673 | }, 674 | { 675 | "cell_type": "markdown", 676 | "metadata": { 677 | "slideshow": { 678 | "slide_type": "slide" 679 | } 680 | }, 681 | "source": [ 682 | "### Mobilenet V2" 683 | ] 684 | }, 685 | { 686 | "cell_type": "markdown", 687 | "metadata": { 688 | "slideshow": { 689 | "slide_type": "fragment" 690 | } 691 | }, 692 | "source": [ 693 | "Recall that in Resnet, we had bottleneck blocks.\n", 694 | "\n", 695 | "Those goes as wide->narrow->wide in order to reduce the computational complexity.\n", 696 | "\n", 697 | "In Mobilenet, we state that DSC breaks down the complexity, and basically do not benefit that greatly from this setup.\n", 698 | "\n", 699 | "Mobilenet V2 introduced **Inverted Residuals**, as the blocks are narrow->wide->narrow:\n", 700 | "\n", 701 | "\n", 702 | "
\n", 703 | "\n", 704 | "The authors describe this idea as an inverted residual block because skip connections exist between narrow parts of the network which is opposite of how an original residual connection works." 705 | ] 706 | }, 707 | { 708 | "cell_type": "markdown", 709 | "metadata": { 710 | "slideshow": { 711 | "slide_type": "subslide" 712 | } 713 | }, 714 | "source": [ 715 | "#### Linear bottlenecks:\n", 716 | "\n", 717 | "The reason we use non-linear activation functions in neural networks is that multiple matrix multiplications cannot be reduced to a single numerical operation. It allows us to build neural networks that have multiple layers. At the same time the activation function ReLU, which is commonly used in neural networks, discards values that are smaller than 0. This loss of information can be tackled by increasing the number of channels in order to increase the capacity of the network.\n", 718 | "\n", 719 | "The authors introduced the idea of a linear bottleneck where the last convolution of a residual block has a linear output (no activisions) before it’s added to the initial activations..\n", 720 | "\n", 721 | "
\n" 722 | ] 723 | }, 724 | { 725 | "cell_type": "markdown", 726 | "metadata": { 727 | "slideshow": { 728 | "slide_type": "subslide" 729 | } 730 | }, 731 | "source": [ 732 | "#### Preformence (ImageNet 1K):\n", 733 | "\n", 734 | "* Accuracy: 71.8%\n", 735 | "\n", 736 | "* Parameters 3.47M " 737 | ] 738 | }, 739 | { 740 | "cell_type": "markdown", 741 | "metadata": { 742 | "slideshow": { 743 | "slide_type": "slide" 744 | } 745 | }, 746 | "source": [ 747 | "### MobileNet V3" 748 | ] 749 | }, 750 | { 751 | "cell_type": "markdown", 752 | "metadata": { 753 | "slideshow": { 754 | "slide_type": "subslide" 755 | } 756 | }, 757 | "source": [ 758 | "Improvement over V2 with some tricks:\n", 759 | "\n", 760 | "* uses also [Squeeze-and-Excitation Networks](https://arxiv.org/pdf/1709.01507.pdf)\n", 761 | "* Neural Architecture Search for Block-Wise Search\n", 762 | "* [NetAdapt](https://arxiv.org/pdf/1804.03230.pdf) for Layer wise search\n", 763 | "* Network Improvements — Layer removal and H-swish\n", 764 | "\n", 765 | "$Hswish(x) = x \\frac{ReLU6(x+3)}{6}$\n", 766 | "\n", 767 | "
\n" 768 | ] 769 | }, 770 | { 771 | "cell_type": "markdown", 772 | "metadata": { 773 | "slideshow": { 774 | "slide_type": "subslide" 775 | } 776 | }, 777 | "source": [ 778 | "#### Preformence (ImageNet 1K):\n", 779 | "\n", 780 | "#### small:\n", 781 | "* Accuracy: 67.5%\n", 782 | "* Parameters 2.9M\n", 783 | "\n", 784 | "#### large:\n", 785 | "* Accuracy: 75.2%\n", 786 | "* Parameters 5.4M" 787 | ] 788 | }, 789 | { 790 | "cell_type": "markdown", 791 | "metadata": { 792 | "slideshow": { 793 | "slide_type": "slide" 794 | } 795 | }, 796 | "source": [ 797 | "## ShuffleNet" 798 | ] 799 | }, 800 | { 801 | "cell_type": "markdown", 802 | "metadata": { 803 | "slideshow": { 804 | "slide_type": "subslide" 805 | } 806 | }, 807 | "source": [ 808 | "Many of the modern architectures use lots of dense 1×1 convolutions, also known as pointwise convolutions, but they can be relatively expensive. To bring down this cost, we can use group convolutions on those layers. But those have side effects (what?) can be mitigated using a channel shuffle operation.\n", 809 | "\n", 810 | "A group-wise convolution divides the input feature maps into two or more groups in the channel dimension, and performs convolution separately on each group. It is the same as slicing the input into several feature maps of smaller depth, and then running a different convolution on each.\n", 811 | "\n", 812 | "
\n", 813 | "\n", 814 | "\n", 815 | "you can read more in [here](https://arxiv.org/pdf/1707.01083.pdf)\n" 816 | ] 817 | }, 818 | { 819 | "cell_type": "markdown", 820 | "metadata": { 821 | "slideshow": { 822 | "slide_type": "subslide" 823 | } 824 | }, 825 | "source": [ 826 | "#### Preformence (ImageNet 1K):\n", 827 | "\n", 828 | "#### V1:\n", 829 | "* Accuracy: 69.4%\n", 830 | "* Parameters 2.3M\n", 831 | "\n", 832 | "#### V2 large:\n", 833 | "* Accuracy: 77.1%\n", 834 | "* Parameters 6.7M" 835 | ] 836 | }, 837 | { 838 | "cell_type": "markdown", 839 | "metadata": { 840 | "slideshow": { 841 | "slide_type": "slide" 842 | } 843 | }, 844 | "source": [ 845 | "## EfficientNet: The King of fixed solutions" 846 | ] 847 | }, 848 | { 849 | "cell_type": "markdown", 850 | "metadata": { 851 | "slideshow": { 852 | "slide_type": "subslide" 853 | } 854 | }, 855 | "source": [ 856 | "Build by **AutoML NAS** framework\n", 857 | "\n", 858 | "The network is fine-tuned for obtaining maximum accuracy but is also penalized if the network is very computationally heavy.\n", 859 | "\n", 860 | "It is also penalized for slow inference time when the network takes a lot of time to make predictions. The architecture uses a mobile inverted bottleneck convolution similar to MobileNet V2 but is much larger due to the increase in FLOPS. This baseline model is scaled up to obtain the family of EfficientNets.\n", 861 | "\n", 862 | "
\n" 863 | ] 864 | }, 865 | { 866 | "cell_type": "markdown", 867 | "metadata": { 868 | "slideshow": { 869 | "slide_type": "subslide" 870 | } 871 | }, 872 | "source": [ 873 | "And the second version:\n", 874 | "\n", 875 | "
\n", 876 | "\n" 877 | ] 878 | }, 879 | { 880 | "cell_type": "markdown", 881 | "metadata": { 882 | "slideshow": { 883 | "slide_type": "subslide" 884 | } 885 | }, 886 | "source": [ 887 | "The model was build using more advanced NAS methods.\n", 888 | "\n", 889 | "Original code for [V1](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet) and [V2](https://github.com/google/automl/tree/master/efficientnetv2)\n", 890 | "\n", 891 | "recommanded implementations in pytorch (since google don't like us...) can be found in\n", 892 | "[Timm](https://github.com/rwightman/pytorch-image-models/blob/main/timm/models/efficientnet.py) or [Luke Melas-Kyriazi](https://github.com/lukemelas/EfficientNet-PyTorch)\n" 893 | ] 894 | }, 895 | { 896 | "cell_type": "markdown", 897 | "metadata": { 898 | "slideshow": { 899 | "slide_type": "slide" 900 | } 901 | }, 902 | "source": [ 903 | "##### custom solutions\n", 904 | "\n", 905 | "Today, we have a good understanding that edge devices have diffrent HW architecture and we might want to build a custom solutions.\n", 906 | "\n", 907 | "Many works uses NAS with specific hardware constraint in order to find a fast and good solution.\n", 908 | "\n", 909 | "\n", 910 | "Other methods exist in order to accelerate the inference or trainig time.\n", 911 | "\n", 912 | "\n", 913 | "low rank factorization | Quantization \n", 914 | "- | - \n", 915 | "![alt](img/low_rank.png) | ![alt](img/ste.png) \n", 916 | "Pruning | Knowlege distillation \n", 917 | " ![alt](img/prune.png) | ![alt](img/kd.png)" 918 | ] 919 | }, 920 | { 921 | "cell_type": "markdown", 922 | "metadata": { 923 | "slideshow": { 924 | "slide_type": "subslide" 925 | } 926 | }, 927 | "source": [ 928 | "#### Thanks!" 929 | ] 930 | }, 931 | { 932 | "cell_type": "markdown", 933 | "metadata": { 934 | "slideshow": { 935 | "slide_type": "subslide" 936 | } 937 | }, 938 | "source": [ 939 | "**Credits**\n", 940 | "\n", 941 | "This tutorial was written by [Moshe Kimhi](https://mkimhi.github.io/).
\n", 942 | "To re-use, please provide attribution and link to the original.\n", 943 | "\n", 944 | "Some images in this tutorial were taken and/or adapted from the following sources:\n", 945 | "\n", 946 | "- Sebastian Raschka, https://sebastianraschka.com/\n", 947 | "- Deep Learning, Goodfellow, Bengio and Courville, MIT Press, 2016\n", 948 | "- Fundamentals of Deep Learning, Nikhil Buduma, Oreilly 2017\n", 949 | "- Deep Learning with Python, Francios Chollet, Manning 2018\n", 950 | "- Stanford cs231n course notes by Andrej Karpathy\n", 951 | "- Ketan Doshi on medium\n", 952 | "- \"A Survey of Quantization Methods for Efficient Neural Network Inference\", A.Golami 2021\n", 953 | "- \"Learning both Weights and Connections for Efficient Neural Networks\", Song Han, 2015\n", 954 | "- \"Rethinking the Knowledge Distillation From the Perspective of Model Calibration\" Lehan Yang 2021" 955 | ] 956 | }, 957 | { 958 | "cell_type": "code", 959 | "execution_count": null, 960 | "metadata": {}, 961 | "outputs": [], 962 | "source": [] 963 | } 964 | ], 965 | "metadata": { 966 | "celltoolbar": "Slideshow", 967 | "kernelspec": { 968 | "display_name": "Python 3 (ipykernel)", 969 | "language": "python", 970 | "name": "python3" 971 | }, 972 | "language_info": { 973 | "codemirror_mode": { 974 | "name": "ipython", 975 | "version": 3 976 | }, 977 | "file_extension": ".py", 978 | "mimetype": "text/x-python", 979 | "name": "python", 980 | "nbconvert_exporter": "python", 981 | "pygments_lexer": "ipython3", 982 | "version": "3.8.12" 983 | }, 984 | "rise": { 985 | "scroll": true 986 | } 987 | }, 988 | "nbformat": 4, 989 | "nbformat_minor": 4 990 | } 991 | -------------------------------------------------------------------------------- /t111- efficient CNN/img/1x1_conv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/1x1_conv.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/ChannelShuffle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/ChannelShuffle.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/IRB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/IRB.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/IRB_linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/IRB_linear.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/SSC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/SSC.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/SqueezeNet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/SqueezeNet.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/arch.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/bn_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/bn_1.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/bn_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/bn_2.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/bn_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/bn_3.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/bn_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/bn_4.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/bn_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/bn_5.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/conv1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/conv1.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/conv_dept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/conv_dept.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/conv_dept2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/conv_dept2.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/eff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/eff.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/effv2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/effv2.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/kd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/kd.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/low_rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/low_rank.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/pooling_invariance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/pooling_invariance.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/prune.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/prune.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/receptive_field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/receptive_field.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/receptive_field2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/receptive_field2.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/regression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/regression.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/resnet_arch_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/resnet_arch_table.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/resnet_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/resnet_block.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/resnet_block2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/resnet_block2.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/rn.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/rn.webp -------------------------------------------------------------------------------- /t111- efficient CNN/img/sobel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/sobel.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/ste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/ste.png -------------------------------------------------------------------------------- /t111- efficient CNN/img/swish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t111- efficient CNN/img/swish.png -------------------------------------------------------------------------------- /t12- GAN/gan_mnist_01.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/gan_mnist_01.pt -------------------------------------------------------------------------------- /t12- GAN/gan_mnist_02.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/gan_mnist_02.pt -------------------------------------------------------------------------------- /t12- GAN/img/1_hmbyMq-akpx-VRq7ZfnGFA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/1_hmbyMq-akpx-VRq7ZfnGFA.png -------------------------------------------------------------------------------- /t12- GAN/img/1_losses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/1_losses.png -------------------------------------------------------------------------------- /t12- GAN/img/2cf8b4f1-7163-4af1-aa4b-6066329d554a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/2cf8b4f1-7163-4af1-aa4b-6066329d554a.png -------------------------------------------------------------------------------- /t12- GAN/img/DCGAN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/DCGAN.png -------------------------------------------------------------------------------- /t12- GAN/img/Earth-Movers-Distance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/Earth-Movers-Distance.png -------------------------------------------------------------------------------- /t12- GAN/img/cgan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/cgan.png -------------------------------------------------------------------------------- /t12- GAN/img/collaps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/collaps.png -------------------------------------------------------------------------------- /t12- GAN/img/gan_osil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/gan_osil.png -------------------------------------------------------------------------------- /t12- GAN/img/gau.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/gau.png -------------------------------------------------------------------------------- /t12- GAN/img/gen_disc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/gen_disc.jpg -------------------------------------------------------------------------------- /t12- GAN/img/gmm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/gmm.png -------------------------------------------------------------------------------- /t12- GAN/img/hairstyle.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/hairstyle.jpeg -------------------------------------------------------------------------------- /t12- GAN/img/infogan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/infogan.png -------------------------------------------------------------------------------- /t12- GAN/img/larit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/larit.png -------------------------------------------------------------------------------- /t12- GAN/img/mapping_net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/mapping_net.png -------------------------------------------------------------------------------- /t12- GAN/img/progan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/progan.png -------------------------------------------------------------------------------- /t12- GAN/img/progang.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/progang.gif -------------------------------------------------------------------------------- /t12- GAN/img/russel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/russel.jpg -------------------------------------------------------------------------------- /t12- GAN/img/style2-scalednoise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/style2-scalednoise.png -------------------------------------------------------------------------------- /t12- GAN/img/style2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/style2.png -------------------------------------------------------------------------------- /t12- GAN/img/stylefinal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/stylefinal.png -------------------------------------------------------------------------------- /t12- GAN/img/vae.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/vae.png -------------------------------------------------------------------------------- /t12- GAN/img/wdistance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t12- GAN/img/wdistance.png -------------------------------------------------------------------------------- /t13 - Diffusion Models/Intro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t13 - Diffusion Models/Intro.gif -------------------------------------------------------------------------------- /t13 - Diffusion Models/PixelCNN++.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t13 - Diffusion Models/PixelCNN++.ppm -------------------------------------------------------------------------------- /t13 - Diffusion Models/elbo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t13 - Diffusion Models/elbo.jpeg -------------------------------------------------------------------------------- /t13 - Diffusion Models/forward_reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t13 - Diffusion Models/forward_reverse.png -------------------------------------------------------------------------------- /t13 - Diffusion Models/random_walk.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t13 - Diffusion Models/random_walk.gif -------------------------------------------------------------------------------- /t13 - Diffusion Models/training_and_sampling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t13 - Diffusion Models/training_and_sampling.png -------------------------------------------------------------------------------- /t14- Multi-Modal/CLIP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/CLIP.png -------------------------------------------------------------------------------- /t14- Multi-Modal/CO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/CO.png -------------------------------------------------------------------------------- /t14- Multi-Modal/Screenshot 2024-08-08 at 13.05.34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/Screenshot 2024-08-08 at 13.05.34.png -------------------------------------------------------------------------------- /t14- Multi-Modal/cca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/cca.png -------------------------------------------------------------------------------- /t14- Multi-Modal/clip.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/clip.jpeg -------------------------------------------------------------------------------- /t14- Multi-Modal/dog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/dog.png -------------------------------------------------------------------------------- /t14- Multi-Modal/fus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/fus.png -------------------------------------------------------------------------------- /t14- Multi-Modal/gal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/gal.png -------------------------------------------------------------------------------- /t14- Multi-Modal/gay.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/gay.jpeg -------------------------------------------------------------------------------- /t14- Multi-Modal/mixing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/mixing.png -------------------------------------------------------------------------------- /t14- Multi-Modal/modals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/modals.png -------------------------------------------------------------------------------- /t14- Multi-Modal/rep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/rep.png -------------------------------------------------------------------------------- /t14- Multi-Modal/table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/table.png -------------------------------------------------------------------------------- /t14- Multi-Modal/translation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vistalab-technion/cs236781-tutorials/02cc21d2c5b9d734d872c0d5da41750edf03ebdd/t14- Multi-Modal/translation.png --------------------------------------------------------------------------------