Skip to content

Commit 7c3cab5

Browse files
updated README with visualization updates
1 parent 15eaec8 commit 7c3cab5

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

README.md

+31-27
Original file line numberDiff line numberDiff line change
@@ -69,37 +69,27 @@ Currently, following datasets and models are supported.
6969
#### Bayesian
7070

7171
`python main_bayesian.py`
72-
* set hyperparameters in `config_bayesian.py`
72+
* set hyperparameters in `config_bayesian.py`
7373

7474

7575
#### Frequentist
7676

7777
`python main_frequentist.py`
78-
* set hyperparameters in `config_frequentist.py`
79-
80-
---------------------------------------------------------------------------------------------------------
81-
82-
83-
84-
### Directory Structure:
85-
`layers/`: Contains ModuleWrapper, FlattenLayer, Bayesian layers (BBBConv2d and BBBLinear).
86-
`models/BayesianModels/`: Contains standard Bayesian models (BBBLeNet, BBBAlexNet, BBB3Conv3FC).
87-
`models/NonBayesianModels/`: Contains standard Non-Bayesian models (LeNet, AlexNet).
88-
`checkpoints/`: Checkpoint directory for the best model will be saved here.
89-
`tests/`: Basic unittest cases for layers and models.
90-
`main_bayesian.py`: Train and Evaluate Bayesian models.
91-
`config_bayesian.py`: Hyperparameters for `main_bayesian` file.
92-
`main_frequentist.py`: Train and Evaluate non-Bayesian (Frequentist) models.
93-
`config_frequentist.py`: Hyperparameters for `main_frequentist` file.
94-
`visualize_mean_var.py`: Plotting Distributions and Line graphs of mean and variances.
78+
* set hyperparameters in `config_frequentist.py`
9579

9680
---------------------------------------------------------------------------------------------------------
9781

9882

9983

10084
### Recording Mean and Variance:
101-
If `record_mean_var` is `True`, then mean and variances for layers in `record_layers` list will be logged in checkpoints directory. You can also specify recording frequency per epoch. All these mentioned parameters can be modified in `config_bayesian.py`.
85+
If `record_mean_var` is `True`, then mean and variances for layers in `record_layers` list will be logged in checkpoints directory. Recording frequency per epoch can be defined. All these mentioned parameters can be modified in the `config_bayesian.py` file.
10286

87+
#### DistPlots
88+
![Average Mean value change of FC3 Layer (Node 0)](experiments/figures/fc3-node_0-mean-distplot.gif)
89+
![Average Standard Deviation value change of FC3 Layer (Node 0)](experiments/figures/fc3-node_0-std-distplot.gif)
90+
![Distribution update of FC3 Layer (Node 0)](experiments/figures/fc3-node_0-both-distplot.gif)
91+
92+
#### LinePlots
10393
![Mean value change of FC3 Layer (Node 0)](experiments/figures/fc3-node_0-mean-lineplot.jpg)
10494
![Standard Deviation value change of FC3 Layer (Node 0)](experiments/figures/fc3-node_0-std-lineplot.jpg)
10595

@@ -111,18 +101,32 @@ If `record_mean_var` is `True`, then mean and variances for layers in `record_la
111101
3. Choosing `recording_freq_per_epoch` higher than number of training iterations will raise `ZeroDivisionError`.
112102

113103
In order to visualize the recorded values, `visualize_mean_var.py` contains `draw_distributions` and `draw_lineplot` methods. Following are the arguments which needs to be passed to `visualize_mean_var.py`:
114-
1. `--filename`: Path to log file.
115-
2. `--data_type`: Draw plots for what? `mean` or `std`? Default is `'mean'`.
116-
3. `--node_no`: Index of the node for which to draw plots. Index is after flattening of the layer. Default is 0 i.e, first node.
117-
4. `--plot_type`: Which plot to draw? Currently we support lineplot and distplot. Default is `'lineplot'`.
118-
5. `--plot_time`: Pauses the plot for this much amount of time before updating it. Default is 1 second.
119-
6. `--save_plots`: Whether to save plots or not. Default is 0 for No. 1 is for Yes.
120-
7. `--save_dir`: Directory for saving plots. Must end with `'/'`. If not provided, default directory will be `filename_directory/plots/`.
104+
* `--filename`: Path to log file.
105+
* `--data_type`: Draw plots for what? `mean`, `std` or `both`? Default is `'mean'`.
106+
* `--node_no`: Index of the node for which to draw plots. Index is after flattening of the layer. Default is 0 i.e, first node.
107+
* `--plot_type`: Which plot to draw? Currently we support lineplot and distplot. Default is `'lineplot'`.
108+
* `--plot_time`: Pauses the plot for this much amount of time before updating it. Default is 1 second.
109+
* `--save_plots`: Whether to save plots or not. Default is 0 for No. 1 is for Yes.
110+
* `--save_dir`: Directory for saving plots. Must end with `'/'`. If not provided, default directory will be `filename_directory/plots/`.
111+
112+
---------------------------------------------------------------------------------------------------------
113+
114+
### Directory Structure:
115+
`layers/`: Contains ModuleWrapper, FlattenLayer, Bayesian layers (BBBConv2d and BBBLinear).
116+
`models/BayesianModels/`: Contains standard Bayesian models (BBBLeNet, BBBAlexNet, BBB3Conv3FC).
117+
`models/NonBayesianModels/`: Contains standard Non-Bayesian models (LeNet, AlexNet).
118+
`checkpoints/`: Checkpoint directory for the best model will be saved here.
119+
`tests/`: Basic unittest cases for layers and models.
120+
`main_bayesian.py`: Train and Evaluate Bayesian models.
121+
`config_bayesian.py`: Hyperparameters for `main_bayesian` file.
122+
`main_frequentist.py`: Train and Evaluate non-Bayesian (Frequentist) models.
123+
`config_frequentist.py`: Hyperparameters for `main_frequentist` file.
124+
`visualize_mean_var.py`: Plotting Distributions and Line graphs of mean and variances.
121125

122126
---------------------------------------------------------------------------------------------------------
123127

124128

125-
If you are using this work, please cite:
129+
If you are using this work, please cite the authors:
126130

127131
```
128132
@article{shridhar2019comprehensive,

0 commit comments

Comments
 (0)