You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,17 +152,17 @@ python setup.py install
152
152
```
153
153
### Quickstart
154
154
155
-
Below is a step-by-step guide on how to use our `ddranking`. This demo is based on LRS on soft labels (source code can be found in `demo_soft.py`). You can find LRS on hard labels in `demo_hard.py` and ARS in `demo_aug.py`.
155
+
Below is a step-by-step guide on how to use our `ddranking`. This demo is based on LRS on soft labels (source code can be found in `demo_lrs_soft.py`). You can find LRS on hard labels in `demo_lrs_hard.py` and ARS in `demo_aug.py`.
156
156
DD-Ranking supports multi-GPU Distributed evaluation. You can simply use `torchrun` to launch the evaluation.
157
157
158
158
**Step1**: Intialize a soft-label metric evaluator object. Config files are recommended for users to specify hyper-parameters. Sample config files are provided [here](https://github.com/NUS-HPC-AI-Lab/DD-Ranking/tree/main/configs).
<p>To ease the usage of DD-Ranking, we allow users to specify the parameters of the evaluator in a config file. The config file is a YAML file that contains the parameters of the evaluator. We illustrate the config file with the following example.</p>
158
+
<p>To ease the usage of DD-Ranking, we allow users to specify the parameters of the evaluator in a config file. The config file is a YAML file that contains the parameters of the evaluator. We illustrate the config file with the following examples.</p>
custom_val_trans: null # custom torchvision-based transformations to process validation data; please follow the format above for your own transformations
191
194
192
-
use_aug_for_hard: false # whether to use data augmentation for hard label evaluation
193
-
194
195
soft_label_mode: M # soft label mode
195
196
soft_label_criterion: kl # soft label criterion
196
-
temperature: 30.0 # temperature for soft label
197
+
loss_fn_kwargs:
198
+
temperature: 30.0 # temperature for soft label
199
+
scale_loss: false # whether to scale the loss
200
+
197
201
optimizer: adamw # optimizer
198
202
lr_scheduler: cosine # learning rate scheduler
199
203
weight_decay: 0.01 # weight decay
204
+
momentum: 0.9 # momentum
200
205
num_eval: 5 # number of evaluations
206
+
eval_full_data: false # whether to compute the test accuracy on the full dataset
201
207
num_epochs: 400 # number of training epochs
202
-
default_lr: 0.001 # default learning rate
203
208
num_workers: 4 # number of workers
204
209
device: cuda # device
210
+
dist: true # whether to use distributed training
205
211
syn_batch_size: 256 # batch size for synthetic data
206
212
real_batch_size: 256 # batch size for real data
207
213
save_path: ./results.csv # path to save the results
214
+
215
+
random_data_format: tensor # format of the random data, tensor or image
216
+
random_data_path: ./random_data # path to the save the random data
217
+
208
218
</code></pre>
209
219
<p>To use config file, you can follow the example below.</p>
<li><strong>use_zca</strong>(<spanstyle="color:#FF6B00;">bool</span>): Whether to use ZCA whitening. When set to True, the dataset will <strong>not be</strong> normalized using the mean and standard deviation of the training set.</li>
169
+
<li><strong>custom_train_trans</strong>(<spanstyle="color:#FF6B00;">Optional[Callable]</span>): Custom transformation on the training set.</li>
169
170
<li><strong>custom_val_trans</strong>(<spanstyle="color:#FF6B00;">Optional[Callable]</span>): Custom transformation on the validation set.</li>
170
171
<li><strong>device</strong>(<spanstyle="color:#FF6B00;">str</span>): Device for performing ZCA whitening.</li>
<p>Below is a step-by-step guide on how to use our <code>dd_ranking</code>. This demo is based on soft labels (source code can be found in <code>demo_soft.py</code>). You can find hard label demo in <code>demo_hard.py</code>.</p>
158
+
<p>Below is a step-by-step guide on how to use our <code>dd_ranking</code>. This demo is for label-robust score (LRS) on soft labels (source code can be found in <code>demo_lrs_soft.py</code>). You can find the demo for LRS on hard label demo in <code>demo_lrs_hard.py</code> and the demo for augmentation-robust score (ARS) in <code>demo_ars.py</code>.
159
+
DD-Ranking supports multi-GPU Distributed evaluation. You can simply use <code>torchrun</code> to launch the evaluation.</p>
159
160
<p><strong>Step1</strong>: Intialize a soft-label metric evaluator object. Config files are recommended for users to specify hyper-parameters. Sample config files are provided <ahref="https://github.com/NUS-HPC-AI-Lab/DD-Ranking/tree/main/configs">here</a>.</p>
0 commit comments