diff --git a/.buildinfo b/.buildinfo new file mode 100644 index 00000000..2ca62b35 --- /dev/null +++ b/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: d5c1b9e9bb8d82f448a9ba8864bf23fc +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/_images/apple_black.png b/_images/apple_black.png new file mode 100644 index 00000000..63facb7c Binary files /dev/null and b/_images/apple_black.png differ diff --git a/_images/apple_white.png b/_images/apple_white.png new file mode 100644 index 00000000..37e64ab2 Binary files /dev/null and b/_images/apple_white.png differ diff --git a/_images/center_cropped.png b/_images/center_cropped.png new file mode 100644 index 00000000..683c9a46 Binary files /dev/null and b/_images/center_cropped.png differ diff --git a/_images/grad_cam.png b/_images/grad_cam.png new file mode 100644 index 00000000..ced15b1d Binary files /dev/null and b/_images/grad_cam.png differ diff --git a/_images/grad_cam_impose.png b/_images/grad_cam_impose.png new file mode 100644 index 00000000..6950f6b6 Binary files /dev/null and b/_images/grad_cam_impose.png differ diff --git a/_images/saliency_map.png b/_images/saliency_map.png new file mode 100644 index 00000000..46a3b91f Binary files /dev/null and b/_images/saliency_map.png differ diff --git a/_images/saliency_map_impose.png b/_images/saliency_map_impose.png new file mode 100644 index 00000000..e93f2509 Binary files /dev/null and b/_images/saliency_map_impose.png differ diff --git a/_images/square_black.png b/_images/square_black.png new file mode 100644 index 00000000..c8b20e4c Binary files /dev/null and b/_images/square_black.png differ diff --git a/_images/square_white.png b/_images/square_white.png new file mode 100644 index 00000000..c4e40e84 Binary files /dev/null and b/_images/square_white.png differ diff --git a/_images/watermark_black.png b/_images/watermark_black.png new file mode 100644 index 00000000..ce9a622e Binary files /dev/null and b/_images/watermark_black.png differ diff --git a/_images/watermark_white.png b/_images/watermark_white.png new file mode 100644 index 00000000..4839ba47 Binary files /dev/null and b/_images/watermark_white.png differ diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt new file mode 100644 index 00000000..03a08142 --- /dev/null +++ b/_sources/index.rst.txt @@ -0,0 +1,24 @@ + +TrojanZoo documentation +======================== +TrojanZoo is a universal pytorch platform for conducting security researches (especially for backdoor attacks/defenses) for image classification in deep learning. + +.. toctree:: + :caption: Tutorials + :titlesonly: + + basic + +.. toctree:: + :caption: TrojanZoo Documentation + :titlesonly: + + trojanzoo + trojanvision + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` diff --git a/_sources/trojanvision/attacks/adv.rst.txt b/_sources/trojanvision/attacks/adv.rst.txt new file mode 100644 index 00000000..401cf220 --- /dev/null +++ b/_sources/trojanvision/attacks/adv.rst.txt @@ -0,0 +1,6 @@ +.. _trojanvision.attacks.adv: + +adv +================ + +.. currentmodule:: trojanvision.attacks diff --git a/_sources/trojanvision/attacks/backdoor/clean_label.rst.txt b/_sources/trojanvision/attacks/backdoor/clean_label.rst.txt new file mode 100644 index 00000000..d340d192 --- /dev/null +++ b/_sources/trojanvision/attacks/backdoor/clean_label.rst.txt @@ -0,0 +1,12 @@ +.. _trojanvision.attacks.backdoor.clean_label: + +clean_label +================ + +.. currentmodule:: trojanvision.attacks + +.. autoclass:: InvisiblePoison + :members: + +.. autoclass:: Refool + :members: diff --git a/_sources/trojanvision/attacks/backdoor/dynamic.rst.txt b/_sources/trojanvision/attacks/backdoor/dynamic.rst.txt new file mode 100644 index 00000000..b140a658 --- /dev/null +++ b/_sources/trojanvision/attacks/backdoor/dynamic.rst.txt @@ -0,0 +1,9 @@ +.. _trojanvision.attacks.backdoor.dynamic: + +dynamic +================ + +.. currentmodule:: trojanvision.attacks + +.. autoclass:: InputAwareDynamic + :members: diff --git a/_sources/trojanvision/attacks/backdoor/index.rst.txt b/_sources/trojanvision/attacks/backdoor/index.rst.txt new file mode 100644 index 00000000..4628b2a6 --- /dev/null +++ b/_sources/trojanvision/attacks/backdoor/index.rst.txt @@ -0,0 +1,13 @@ +.. _trojanvision.attacks.backdoor: + +backdoor +================ + +.. currentmodule:: trojanvision.attacks + +.. toctree:: + :maxdepth: 2 + + normal + clean_label + dynamic diff --git a/_sources/trojanvision/attacks/backdoor/normal.rst.txt b/_sources/trojanvision/attacks/backdoor/normal.rst.txt new file mode 100644 index 00000000..a039412f --- /dev/null +++ b/_sources/trojanvision/attacks/backdoor/normal.rst.txt @@ -0,0 +1,21 @@ +.. _trojanvision.attacks.backdoor.normal: + +normal +================ + +.. currentmodule:: trojanvision.attacks + +.. autoclass:: BadNet + :members: + +.. autoclass:: TrojanNN + :members: + +.. autoclass:: IMC + :members: + +.. autoclass:: LatentBackdoor + :members: + +.. autoclass:: TrojanNet + :members: diff --git a/_sources/trojanvision/attacks/index.rst.txt b/_sources/trojanvision/attacks/index.rst.txt new file mode 100644 index 00000000..0c75b9b7 --- /dev/null +++ b/_sources/trojanvision/attacks/index.rst.txt @@ -0,0 +1,26 @@ +.. _trojanvision.attacks: + +attacks +======== + +.. currentmodule:: trojanvision.attacks + + +.. toctree:: + :maxdepth: 3 + + adv + backdoor/index + + +.. autofunction:: add_argument +.. autofunction:: create + +.. autoclass:: BackdoorAttack + :members: + +.. autoclass:: CleanLabelBackdoor + :members: + +.. autoclass:: DynamicBackdoor + :members: diff --git a/_sources/trojanvision/configs.rst.txt b/_sources/trojanvision/configs.rst.txt new file mode 100644 index 00000000..c0f979f6 --- /dev/null +++ b/_sources/trojanvision/configs.rst.txt @@ -0,0 +1,9 @@ +.. _trojanvision.configs: + +configs +======== + +.. currentmodule:: trojanvision.configs + +.. automodule:: trojanvision.configs + :members: diff --git a/_sources/trojanvision/datasets/folder.rst.txt b/_sources/trojanvision/datasets/folder.rst.txt new file mode 100644 index 00000000..c288a657 --- /dev/null +++ b/_sources/trojanvision/datasets/folder.rst.txt @@ -0,0 +1,23 @@ +.. _trojanvision.datasets.folder: + +folder +======= +.. currentmodule:: trojanvision.datasets + +.. autoclass:: CUB200 + :members: + +.. autoclass:: CUB200_2011 + :members: + +.. autoclass:: GTSRB + :members: + +.. autoclass:: ImageNet + :members: + +.. autoclass:: ISIC2018 + :members: + +.. autoclass:: VGGface2 + :members: diff --git a/_sources/trojanvision/datasets/index.rst.txt b/_sources/trojanvision/datasets/index.rst.txt new file mode 100644 index 00000000..edeb5ef5 --- /dev/null +++ b/_sources/trojanvision/datasets/index.rst.txt @@ -0,0 +1,20 @@ +.. _trojanvision.datasets: + +datasets +========= +.. currentmodule:: trojanvision.datasets + +.. toctree:: + :maxdepth: 2 + + normal + folder + +.. autofunction:: add_argument +.. autofunction:: create + +.. autoclass:: ImageSet + :members: + +.. autoclass:: ImageFolder + :members: diff --git a/_sources/trojanvision/datasets/normal.rst.txt b/_sources/trojanvision/datasets/normal.rst.txt new file mode 100644 index 00000000..7cd851ae --- /dev/null +++ b/_sources/trojanvision/datasets/normal.rst.txt @@ -0,0 +1,23 @@ +.. _trojanvision.datasets.normal: + +normal +======= +.. currentmodule:: trojanvision.datasets + +.. autoclass:: MNIST + :members: + +.. autoclass:: CIFAR10 + :members: + +.. autoclass:: CIFAR100 + :members: + +.. autoclass:: ImageNet16 + :members: + +.. autoclass:: ImageNet32 + :members: + +.. autoclass:: STL10 + :members: diff --git a/_sources/trojanvision/defenses/adv.rst.txt b/_sources/trojanvision/defenses/adv.rst.txt new file mode 100644 index 00000000..e53fc1cd --- /dev/null +++ b/_sources/trojanvision/defenses/adv.rst.txt @@ -0,0 +1,6 @@ +.. _trojanvision.defenses.adv: + +adv +==== + +.. currentmodule:: trojanvision.defenses diff --git a/_sources/trojanvision/defenses/backdoor/attack_agnostic.rst.txt b/_sources/trojanvision/defenses/backdoor/attack_agnostic.rst.txt new file mode 100644 index 00000000..d20ce92f --- /dev/null +++ b/_sources/trojanvision/defenses/backdoor/attack_agnostic.rst.txt @@ -0,0 +1,21 @@ +.. _trojanvision.defenses.backdoor.attack_agnostic: + +attack_agnostic +================ + +.. currentmodule:: trojanvision.defenses + +.. autoclass:: AdvTrain + :members: + +.. autoclass:: FinePruning + :members: + +.. autoclass:: MagNet + :members: + +.. autoclass:: RandomizedSmooth + :members: + +.. autoclass:: Recompress + :members: diff --git a/_sources/trojanvision/defenses/backdoor/index.rst.txt b/_sources/trojanvision/defenses/backdoor/index.rst.txt new file mode 100644 index 00000000..94114b67 --- /dev/null +++ b/_sources/trojanvision/defenses/backdoor/index.rst.txt @@ -0,0 +1,14 @@ +.. _trojanvision.defenses.backdoor: + +backdoor +========= + +.. currentmodule:: trojanvision.defenses + +.. toctree:: + :maxdepth: 2 + + attack_agnostic + input_filtering + training_filtering + model_inspection diff --git a/_sources/trojanvision/defenses/backdoor/input_filtering.rst.txt b/_sources/trojanvision/defenses/backdoor/input_filtering.rst.txt new file mode 100644 index 00000000..e1e64568 --- /dev/null +++ b/_sources/trojanvision/defenses/backdoor/input_filtering.rst.txt @@ -0,0 +1,12 @@ +.. _trojanvision.defenses.backdoor.input_filtering: + +input_filtering +================ + +.. currentmodule:: trojanvision.defenses + +.. autoclass:: Neo + :members: + +.. autoclass:: Strip + :members: diff --git a/_sources/trojanvision/defenses/backdoor/model_inspection.rst.txt b/_sources/trojanvision/defenses/backdoor/model_inspection.rst.txt new file mode 100644 index 00000000..dd97a5b4 --- /dev/null +++ b/_sources/trojanvision/defenses/backdoor/model_inspection.rst.txt @@ -0,0 +1,21 @@ +.. _trojanvision.defenses.backdoor.model_inspection: + +model_inspection +================= + +.. currentmodule:: trojanvision.defenses + +.. autoclass:: ABS + :members: + +.. autoclass:: DeepInspect + :members: + +.. autoclass:: NeuralCleanse + :members: + +.. autoclass:: NeuronInspect + :members: + +.. autoclass:: Tabor + :members: diff --git a/_sources/trojanvision/defenses/backdoor/training_filtering.rst.txt b/_sources/trojanvision/defenses/backdoor/training_filtering.rst.txt new file mode 100644 index 00000000..b0d8ad30 --- /dev/null +++ b/_sources/trojanvision/defenses/backdoor/training_filtering.rst.txt @@ -0,0 +1,12 @@ +.. _trojanvision.defenses.backdoor.training_filtering: + +training_filtering +=================== + +.. currentmodule:: trojanvision.defenses + +.. autoclass:: ActivationClustering + :members: + +.. .. autoclass:: SpectralSignature +.. :members: diff --git a/_sources/trojanvision/defenses/index.rst.txt b/_sources/trojanvision/defenses/index.rst.txt new file mode 100644 index 00000000..d50679b3 --- /dev/null +++ b/_sources/trojanvision/defenses/index.rst.txt @@ -0,0 +1,28 @@ +.. _trojanvision.defenses: + +defenses +========= + +.. currentmodule:: trojanvision.defenses + +.. toctree:: + :maxdepth: 3 + + adv + backdoor/index + + +.. autofunction:: add_argument +.. autofunction:: create + +.. autoclass:: BackdoorDefense + :members: + +.. autoclass:: InputFiltering + :members: + +.. autoclass:: TrainingFiltering + :members: + +.. autoclass:: ModelInspection + :members: diff --git a/_sources/trojanvision/environ.rst.txt b/_sources/trojanvision/environ.rst.txt new file mode 100644 index 00000000..b42aacbc --- /dev/null +++ b/_sources/trojanvision/environ.rst.txt @@ -0,0 +1,8 @@ +.. _trojanvision.environ: + +environ +======== + +.. currentmodule:: trojanvision.environ + +.. automodule:: trojanvision.environ diff --git a/_sources/trojanvision/index.rst.txt b/_sources/trojanvision/index.rst.txt new file mode 100644 index 00000000..02197536 --- /dev/null +++ b/_sources/trojanvision/index.rst.txt @@ -0,0 +1,18 @@ +.. _trojanvision: + +trojanvision +============= + +.. toctree:: + :titlesonly: + + attacks/index + configs + datasets/index + defenses/index + environ + marks + models/index + optim + trainer + utils diff --git a/_sources/trojanvision/marks.rst.txt b/_sources/trojanvision/marks.rst.txt new file mode 100644 index 00000000..acf37c3d --- /dev/null +++ b/_sources/trojanvision/marks.rst.txt @@ -0,0 +1,12 @@ +.. _trojanvision.marks: + +marks +====== + +.. currentmodule:: trojanvision.marks + +.. autofunction:: add_argument +.. autofunction:: create + +.. autoclass:: Watermark + :members: diff --git a/_sources/trojanvision/models/index.rst.txt b/_sources/trojanvision/models/index.rst.txt new file mode 100644 index 00000000..e41a59c0 --- /dev/null +++ b/_sources/trojanvision/models/index.rst.txt @@ -0,0 +1,20 @@ +.. _trojanvision.models: + +models +======= + +.. currentmodule:: trojanvision.models + +.. toctree:: + :maxdepth: 2 + + torchvision + nas + others + +.. autofunction:: add_argument +.. autofunction:: create +.. autofunction:: output_available_models + +.. autoclass:: ImageModel + :members: diff --git a/_sources/trojanvision/models/nas.rst.txt b/_sources/trojanvision/models/nas.rst.txt new file mode 100644 index 00000000..21161794 --- /dev/null +++ b/_sources/trojanvision/models/nas.rst.txt @@ -0,0 +1,21 @@ +.. _trojanvision.models.nas: + +nas +============ + +.. currentmodule:: trojanvision.models + +.. autoclass:: DARTS + :members: + +.. autoclass:: ENAS + :members: + +.. autoclass:: NATSbench + :members: + +.. autoclass:: PNASNet + :members: + +.. autoclass:: ProxylessNAS + :members: diff --git a/_sources/trojanvision/models/others.rst.txt b/_sources/trojanvision/models/others.rst.txt new file mode 100644 index 00000000..9b87e7b0 --- /dev/null +++ b/_sources/trojanvision/models/others.rst.txt @@ -0,0 +1,9 @@ +.. _trojanvision.models.others: + +others +============ + +.. currentmodule:: trojanvision.models + +.. autoclass:: MagNet + :members: diff --git a/_sources/trojanvision/models/torchvision.rst.txt b/_sources/trojanvision/models/torchvision.rst.txt new file mode 100644 index 00000000..fb9f91c3 --- /dev/null +++ b/_sources/trojanvision/models/torchvision.rst.txt @@ -0,0 +1,30 @@ +.. _trojanvision.models.torchvision: + +torchvision +============ + +.. currentmodule:: trojanvision.models + +.. autoclass:: AlexNet + :members: + +.. autoclass:: DenseNet + :members: + +.. autoclass:: EfficientNet + :members: + +.. autoclass:: MNASNet + :members: + +.. autoclass:: MobileNet + :members: + +.. autoclass:: ResNet + :members: + +.. autoclass:: ShuffleNetV2 + :members: + +.. autoclass:: VGG + :members: diff --git a/_sources/trojanvision/optim.rst.txt b/_sources/trojanvision/optim.rst.txt new file mode 100644 index 00000000..983096cb --- /dev/null +++ b/_sources/trojanvision/optim.rst.txt @@ -0,0 +1,6 @@ +.. _trojanvision.optim: + +optim +====== + +.. currentmodule:: trojanvision.optim diff --git a/_sources/trojanvision/trainer.rst.txt b/_sources/trojanvision/trainer.rst.txt new file mode 100644 index 00000000..cd945afd --- /dev/null +++ b/_sources/trojanvision/trainer.rst.txt @@ -0,0 +1,8 @@ +.. _trojanvision.trainer: + +trainer +======== + +.. currentmodule:: trojanvision.trainer + +.. automodule:: trojanvision.trainer diff --git a/_sources/trojanvision/utils.rst.txt b/_sources/trojanvision/utils.rst.txt new file mode 100644 index 00000000..14e7fcc4 --- /dev/null +++ b/_sources/trojanvision/utils.rst.txt @@ -0,0 +1,6 @@ +.. _trojanvision.utils: + +utils +====== + +.. currentmodule:: trojanvision.utils diff --git a/_sources/trojanzoo/attacks.rst.txt b/_sources/trojanzoo/attacks.rst.txt new file mode 100644 index 00000000..84689fdd --- /dev/null +++ b/_sources/trojanzoo/attacks.rst.txt @@ -0,0 +1,12 @@ +.. _trojanzoo.attacks: + +attacks +======== + +.. currentmodule:: trojanzoo.attacks + +.. autofunction:: add_argument +.. autofunction:: create + +.. autoclass:: Attack + :members: diff --git a/_sources/trojanzoo/configs.rst.txt b/_sources/trojanzoo/configs.rst.txt new file mode 100644 index 00000000..d3facc78 --- /dev/null +++ b/_sources/trojanzoo/configs.rst.txt @@ -0,0 +1,9 @@ +.. _trojanzoo.configs: + +configs +======== + +.. currentmodule:: trojanzoo.configs + +.. automodule:: trojanzoo.configs + :members: diff --git a/_sources/trojanzoo/datasets.rst.txt b/_sources/trojanzoo/datasets.rst.txt new file mode 100644 index 00000000..f14c264a --- /dev/null +++ b/_sources/trojanzoo/datasets.rst.txt @@ -0,0 +1,12 @@ +.. _trojanzoo.datasets: + +datasets +========= + +.. currentmodule:: trojanzoo.datasets + +.. autofunction:: add_argument +.. autofunction:: create + +.. autoclass:: Dataset + :members: diff --git a/_sources/trojanzoo/defenses.rst.txt b/_sources/trojanzoo/defenses.rst.txt new file mode 100644 index 00000000..57d3842d --- /dev/null +++ b/_sources/trojanzoo/defenses.rst.txt @@ -0,0 +1,12 @@ +.. _trojanzoo.defenses: + +defenses +========= + +.. currentmodule:: trojanzoo.defenses + +.. autofunction:: add_argument +.. autofunction:: create + +.. autoclass:: Defense + :members: diff --git a/_sources/trojanzoo/environ.rst.txt b/_sources/trojanzoo/environ.rst.txt new file mode 100644 index 00000000..3fd975bf --- /dev/null +++ b/_sources/trojanzoo/environ.rst.txt @@ -0,0 +1,12 @@ +.. _trojanzoo.environ: + +environ +======== + +.. currentmodule:: trojanzoo.environ + +.. autofunction:: add_argument +.. autofunction:: create + +.. autoclass:: Env + :members: diff --git a/_sources/trojanzoo/index.rst.txt b/_sources/trojanzoo/index.rst.txt new file mode 100644 index 00000000..9f7db84a --- /dev/null +++ b/_sources/trojanzoo/index.rst.txt @@ -0,0 +1,17 @@ +.. _trojanzoo: + +trojanzoo +========== + +.. toctree:: + :titlesonly: + + attacks + configs + datasets + defenses + environ + models + optim + trainer + utils/index diff --git a/_sources/trojanzoo/models.rst.txt b/_sources/trojanzoo/models.rst.txt new file mode 100644 index 00000000..ed8c3224 --- /dev/null +++ b/_sources/trojanzoo/models.rst.txt @@ -0,0 +1,18 @@ +.. _trojanzoo.models: + +models +======= + +.. currentmodule:: trojanzoo.models + +.. autofunction:: add_argument +.. autofunction:: create +.. autofunction:: output_available_models + +.. autoclass:: Model + :members: + :private-members: _train, _validate + +.. autoclass:: _Model + :members: + diff --git a/_sources/trojanzoo/optim.rst.txt b/_sources/trojanzoo/optim.rst.txt new file mode 100644 index 00000000..9209df78 --- /dev/null +++ b/_sources/trojanzoo/optim.rst.txt @@ -0,0 +1,9 @@ +.. _trojanzoo.optim: + +optim +====== + +.. currentmodule:: trojanzoo.optim + +.. autoclass:: Optimizer + :members: diff --git a/_sources/trojanzoo/trainer.rst.txt b/_sources/trojanzoo/trainer.rst.txt new file mode 100644 index 00000000..ecb68f50 --- /dev/null +++ b/_sources/trojanzoo/trainer.rst.txt @@ -0,0 +1,12 @@ +.. _trojanzoo.trainer: + +trainer +======== + +.. currentmodule:: trojanzoo.trainer + +.. autofunction:: add_argument +.. autofunction:: create + +.. autoclass:: Trainer + :members: diff --git a/_sources/trojanzoo/utils/data.rst.txt b/_sources/trojanzoo/utils/data.rst.txt new file mode 100644 index 00000000..42bdb273 --- /dev/null +++ b/_sources/trojanzoo/utils/data.rst.txt @@ -0,0 +1,12 @@ +.. _trojanzoo.utils.data: + +data +===== + +.. currentmodule:: trojanzoo.utils.data + +.. autoclass:: TensorListDataset +.. autofunction:: dataset_to_tensor +.. autofunction:: sample_batch +.. autofunction:: split_dataset +.. autofunction:: get_class_subset diff --git a/_sources/trojanzoo/utils/fim.rst.txt b/_sources/trojanzoo/utils/fim.rst.txt new file mode 100644 index 00000000..60fd7acb --- /dev/null +++ b/_sources/trojanzoo/utils/fim.rst.txt @@ -0,0 +1,12 @@ +.. _trojanzoo.utils.fim: + +fim +==== + +.. currentmodule:: trojanzoo.utils.fim + +.. autoclass:: BaseKFAC +.. autoclass:: KFAC +.. autoclass:: EKFAC +.. autoclass:: BaseState +.. autoclass:: KFACState diff --git a/_sources/trojanzoo/utils/index.rst.txt b/_sources/trojanzoo/utils/index.rst.txt new file mode 100644 index 00000000..0544efa8 --- /dev/null +++ b/_sources/trojanzoo/utils/index.rst.txt @@ -0,0 +1,23 @@ +.. _trojanzoo.utils: + +utils +====== + +.. currentmodule:: trojanzoo.utils + +.. toctree:: + :maxdepth: 2 + + data + fim + logger + model + module + tensor + train + +.. autoclass:: trojanzoo.utils.lock.Lock + :members: + +.. autofunction:: trojanzoo.utils.memory.empty_cache +.. autofunction:: trojanzoo.utils.memory.output_memory diff --git a/_sources/trojanzoo/utils/logger.rst.txt b/_sources/trojanzoo/utils/logger.rst.txt new file mode 100644 index 00000000..08db161d --- /dev/null +++ b/_sources/trojanzoo/utils/logger.rst.txt @@ -0,0 +1,15 @@ +.. _trojanzoo.utils.logger: + +logger +======= + +.. currentmodule:: trojanzoo.utils.logger + +.. autoclass:: SmoothedValue + :members: + +.. autoclass:: MetricLogger + :members: + +.. autoclass:: AverageMeter + :members: \ No newline at end of file diff --git a/_sources/trojanzoo/utils/model.rst.txt b/_sources/trojanzoo/utils/model.rst.txt new file mode 100644 index 00000000..dffc8533 --- /dev/null +++ b/_sources/trojanzoo/utils/model.rst.txt @@ -0,0 +1,16 @@ +.. _trojanzoo.utils.model: + +model +====== + +.. currentmodule:: trojanzoo.utils.model + +.. autofunction:: init_weights +.. autofunction:: get_layer_name +.. autofunction:: get_all_layer +.. autofunction:: get_layer +.. autofunction:: summary +.. autofunction:: activate_params +.. autofunction:: accuracy +.. autofunction:: generate_target +.. autoclass:: ExponentialMovingAverage diff --git a/_sources/trojanzoo/utils/module.rst.txt b/_sources/trojanzoo/utils/module.rst.txt new file mode 100644 index 00000000..77c9e30a --- /dev/null +++ b/_sources/trojanzoo/utils/module.rst.txt @@ -0,0 +1,29 @@ +.. _trojanzoo.utils.module: + +module +======= + +.. currentmodule:: trojanzoo.utils.module + +.. process +.. -------------------------------------- + +.. autoclass:: BasicObject + :members: + +.. autoclass:: Process + :members: + +.. autoclass:: ModelProcess + :members: + +.. param +.. -------------------------------------- + +.. autoclass:: Module + :members: + :undoc-members: + +.. autoclass:: Param + :members: + :undoc-members: diff --git a/_sources/trojanzoo/utils/tensor.rst.txt b/_sources/trojanzoo/utils/tensor.rst.txt new file mode 100644 index 00000000..2eed45f2 --- /dev/null +++ b/_sources/trojanzoo/utils/tensor.rst.txt @@ -0,0 +1,11 @@ +.. _trojanzoo.utils.tensor: + +tensor +======= + +.. currentmodule:: trojanzoo.utils.tensor + +.. autofunction:: tanh_func +.. autofunction:: atan_func +.. autofunction:: repeat_to_batch +.. autofunction:: add_noise diff --git a/_sources/trojanzoo/utils/train.rst.txt b/_sources/trojanzoo/utils/train.rst.txt new file mode 100644 index 00000000..1eebdd6e --- /dev/null +++ b/_sources/trojanzoo/utils/train.rst.txt @@ -0,0 +1,9 @@ +.. _trojanzoo.utils.train: + +train +====== + +.. currentmodule:: trojanzoo.utils.train + +.. autofunction:: train +.. autofunction:: validate diff --git a/_sources/tutorials/basic.rst.txt b/_sources/tutorials/basic.rst.txt new file mode 100644 index 00000000..95b4042b --- /dev/null +++ b/_sources/tutorials/basic.rst.txt @@ -0,0 +1,41 @@ +.. _tutorials.basic: + +basic +====== + +You can view `example files at GitHub `_. + +Following is `backdoor_defense.py `_ +to show the basic workflow. + +.. code-block:: python + + #!/usr/bin/env python3 + + # CUDA_VISIBLE_DEVICES=0 python ./examples/backdoor_defense.py --color --verbose 1 --attack badnet --defense neural_cleanse --pretrained --validate_interval 1 --epochs 50 --lr 1e-2 + + import trojanvision + import argparse + + if __name__ == '__main__': + parser = argparse.ArgumentParser() + trojanvision.environ.add_argument(parser) + trojanvision.datasets.add_argument(parser) + trojanvision.models.add_argument(parser) + trojanvision.trainer.add_argument(parser) + trojanvision.marks.add_argument(parser) + trojanvision.attacks.add_argument(parser) + trojanvision.defenses.add_argument(parser) + kwargs = parser.parse_args().__dict__ + + env = trojanvision.environ.create(**kwargs) + dataset = trojanvision.datasets.create(**kwargs) + model = trojanvision.models.create(dataset=dataset, **kwargs) + trainer = trojanvision.trainer.create(dataset=dataset, model=model, **kwargs) + mark = trojanvision.marks.create(dataset=dataset, **kwargs) + attack = trojanvision.attacks.create(dataset=dataset, model=model, mark=mark, **kwargs) + defense = trojanvision.defenses.create(dataset=dataset, model=model, attack=attack, **kwargs) + + if env['verbose']: + trojanvision.summary(env=env, dataset=dataset, model=model, mark=mark, trainer=trainer, attack=attack, defense=defense) + defense.detect(**trainer) diff --git a/_static/_sphinx_javascript_frameworks_compat.js b/_static/_sphinx_javascript_frameworks_compat.js new file mode 100644 index 00000000..81415803 --- /dev/null +++ b/_static/_sphinx_javascript_frameworks_compat.js @@ -0,0 +1,123 @@ +/* Compatability shim for jQuery and underscores.js. + * + * Copyright Sphinx contributors + * Released under the two clause BSD licence + */ + +/** + * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL + */ +jQuery.urldecode = function(x) { + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s === 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node, addItems) { + if (node.nodeType === 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && + !jQuery(node.parentNode).hasClass(className) && + !jQuery(node.parentNode).hasClass("nohighlight")) { + var span; + var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.className = className; + } + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + if (isInSVG) { + var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + var bbox = node.parentElement.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute('class', className); + addItems.push({ + "parent": node.parentNode, + "target": rect}); + } + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this, addItems); + }); + } + } + var addItems = []; + var result = this.each(function() { + highlight(this, addItems); + }); + for (var i = 0; i < addItems.length; ++i) { + jQuery(addItems[i].parent).before(addItems[i].target); + } + return result; +}; + +/* + * backward compatibility for jQuery.browser + * This will be supported until firefox bug is fixed. + */ +if (!jQuery.browser) { + jQuery.uaMatch = function(ua) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(webkit)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + jQuery.browser = {}; + jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; +} diff --git a/_static/basic.css b/_static/basic.css new file mode 100644 index 00000000..30fee9d0 --- /dev/null +++ b/_static/basic.css @@ -0,0 +1,925 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/_static/check-solid.svg b/_static/check-solid.svg new file mode 100644 index 00000000..92fad4b5 --- /dev/null +++ b/_static/check-solid.svg @@ -0,0 +1,4 @@ + + + + diff --git a/_static/clipboard.min.js b/_static/clipboard.min.js new file mode 100644 index 00000000..54b3c463 --- /dev/null +++ b/_static/clipboard.min.js @@ -0,0 +1,7 @@ +/*! + * clipboard.js v2.0.8 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return o}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),c=n.n(e);function a(t){try{return document.execCommand(t)}catch(t){return}}var f=function(t){t=c()(t);return a("cut"),t};var l=function(t){var e,n,o,r=1 + + + + diff --git a/_static/copybutton.css b/_static/copybutton.css new file mode 100644 index 00000000..f1916ec7 --- /dev/null +++ b/_static/copybutton.css @@ -0,0 +1,94 @@ +/* Copy buttons */ +button.copybtn { + position: absolute; + display: flex; + top: .3em; + right: .3em; + width: 1.7em; + height: 1.7em; + opacity: 0; + transition: opacity 0.3s, border .3s, background-color .3s; + user-select: none; + padding: 0; + border: none; + outline: none; + border-radius: 0.4em; + /* The colors that GitHub uses */ + border: #1b1f2426 1px solid; + background-color: #f6f8fa; + color: #57606a; +} + +button.copybtn.success { + border-color: #22863a; + color: #22863a; +} + +button.copybtn svg { + stroke: currentColor; + width: 1.5em; + height: 1.5em; + padding: 0.1em; +} + +div.highlight { + position: relative; +} + +/* Show the copybutton */ +.highlight:hover button.copybtn, button.copybtn.success { + opacity: 1; +} + +.highlight button.copybtn:hover { + background-color: rgb(235, 235, 235); +} + +.highlight button.copybtn:active { + background-color: rgb(187, 187, 187); +} + +/** + * A minimal CSS-only tooltip copied from: + * https://codepen.io/mildrenben/pen/rVBrpK + * + * To use, write HTML like the following: + * + *

Short

+ */ + .o-tooltip--left { + position: relative; + } + + .o-tooltip--left:after { + opacity: 0; + visibility: hidden; + position: absolute; + content: attr(data-tooltip); + padding: .2em; + font-size: .8em; + left: -.2em; + background: grey; + color: white; + white-space: nowrap; + z-index: 2; + border-radius: 2px; + transform: translateX(-102%) translateY(0); + transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); +} + +.o-tooltip--left:hover:after { + display: block; + opacity: 1; + visibility: visible; + transform: translateX(-100%) translateY(0); + transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); + transition-delay: .5s; +} + +/* By default the copy button shouldn't show up when printing a page */ +@media print { + button.copybtn { + display: none; + } +} diff --git a/_static/copybutton.js b/_static/copybutton.js new file mode 100644 index 00000000..2ea7ff3e --- /dev/null +++ b/_static/copybutton.js @@ -0,0 +1,248 @@ +// Localization support +const messages = { + 'en': { + 'copy': 'Copy', + 'copy_to_clipboard': 'Copy to clipboard', + 'copy_success': 'Copied!', + 'copy_failure': 'Failed to copy', + }, + 'es' : { + 'copy': 'Copiar', + 'copy_to_clipboard': 'Copiar al portapapeles', + 'copy_success': '¡Copiado!', + 'copy_failure': 'Error al copiar', + }, + 'de' : { + 'copy': 'Kopieren', + 'copy_to_clipboard': 'In die Zwischenablage kopieren', + 'copy_success': 'Kopiert!', + 'copy_failure': 'Fehler beim Kopieren', + }, + 'fr' : { + 'copy': 'Copier', + 'copy_to_clipboard': 'Copier dans le presse-papier', + 'copy_success': 'Copié !', + 'copy_failure': 'Échec de la copie', + }, + 'ru': { + 'copy': 'Скопировать', + 'copy_to_clipboard': 'Скопировать в буфер', + 'copy_success': 'Скопировано!', + 'copy_failure': 'Не удалось скопировать', + }, + 'zh-CN': { + 'copy': '复制', + 'copy_to_clipboard': '复制到剪贴板', + 'copy_success': '复制成功!', + 'copy_failure': '复制失败', + }, + 'it' : { + 'copy': 'Copiare', + 'copy_to_clipboard': 'Copiato negli appunti', + 'copy_success': 'Copiato!', + 'copy_failure': 'Errore durante la copia', + } +} + +let locale = 'en' +if( document.documentElement.lang !== undefined + && messages[document.documentElement.lang] !== undefined ) { + locale = document.documentElement.lang +} + +let doc_url_root = DOCUMENTATION_OPTIONS.URL_ROOT; +if (doc_url_root == '#') { + doc_url_root = ''; +} + +/** + * SVG files for our copy buttons + */ +let iconCheck = ` + ${messages[locale]['copy_success']} + + +` + +// If the user specified their own SVG use that, otherwise use the default +let iconCopy = ``; +if (!iconCopy) { + iconCopy = ` + ${messages[locale]['copy_to_clipboard']} + + + +` +} + +/** + * Set up copy/paste for code blocks + */ + +const runWhenDOMLoaded = cb => { + if (document.readyState != 'loading') { + cb() + } else if (document.addEventListener) { + document.addEventListener('DOMContentLoaded', cb) + } else { + document.attachEvent('onreadystatechange', function() { + if (document.readyState == 'complete') cb() + }) + } +} + +const codeCellId = index => `codecell${index}` + +// Clears selected text since ClipboardJS will select the text when copying +const clearSelection = () => { + if (window.getSelection) { + window.getSelection().removeAllRanges() + } else if (document.selection) { + document.selection.empty() + } +} + +// Changes tooltip text for a moment, then changes it back +// We want the timeout of our `success` class to be a bit shorter than the +// tooltip and icon change, so that we can hide the icon before changing back. +var timeoutIcon = 2000; +var timeoutSuccessClass = 1500; + +const temporarilyChangeTooltip = (el, oldText, newText) => { + el.setAttribute('data-tooltip', newText) + el.classList.add('success') + // Remove success a little bit sooner than we change the tooltip + // So that we can use CSS to hide the copybutton first + setTimeout(() => el.classList.remove('success'), timeoutSuccessClass) + setTimeout(() => el.setAttribute('data-tooltip', oldText), timeoutIcon) +} + +// Changes the copy button icon for two seconds, then changes it back +const temporarilyChangeIcon = (el) => { + el.innerHTML = iconCheck; + setTimeout(() => {el.innerHTML = iconCopy}, timeoutIcon) +} + +const addCopyButtonToCodeCells = () => { + // If ClipboardJS hasn't loaded, wait a bit and try again. This + // happens because we load ClipboardJS asynchronously. + if (window.ClipboardJS === undefined) { + setTimeout(addCopyButtonToCodeCells, 250) + return + } + + // Add copybuttons to all of our code cells + const COPYBUTTON_SELECTOR = 'div.highlight pre'; + const codeCells = document.querySelectorAll(COPYBUTTON_SELECTOR) + codeCells.forEach((codeCell, index) => { + const id = codeCellId(index) + codeCell.setAttribute('id', id) + + const clipboardButton = id => + `` + codeCell.insertAdjacentHTML('afterend', clipboardButton(id)) + }) + +function escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string +} + +/** + * Removes excluded text from a Node. + * + * @param {Node} target Node to filter. + * @param {string} exclude CSS selector of nodes to exclude. + * @returns {DOMString} Text from `target` with text removed. + */ +function filterText(target, exclude) { + const clone = target.cloneNode(true); // clone as to not modify the live DOM + if (exclude) { + // remove excluded nodes + clone.querySelectorAll(exclude).forEach(node => node.remove()); + } + return clone.innerText; +} + +// Callback when a copy button is clicked. Will be passed the node that was clicked +// should then grab the text and replace pieces of text that shouldn't be used in output +function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") { + var regexp; + var match; + + // Do we check for line continuation characters and "HERE-documents"? + var useLineCont = !!lineContinuationChar + var useHereDoc = !!hereDocDelim + + // create regexp to capture prompt and remaining line + if (isRegexp) { + regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)') + } else { + regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)') + } + + const outputLines = []; + var promptFound = false; + var gotLineCont = false; + var gotHereDoc = false; + const lineGotPrompt = []; + for (const line of textContent.split('\n')) { + match = line.match(regexp) + if (match || gotLineCont || gotHereDoc) { + promptFound = regexp.test(line) + lineGotPrompt.push(promptFound) + if (removePrompts && promptFound) { + outputLines.push(match[2]) + } else { + outputLines.push(line) + } + gotLineCont = line.endsWith(lineContinuationChar) & useLineCont + if (line.includes(hereDocDelim) & useHereDoc) + gotHereDoc = !gotHereDoc + } else if (!onlyCopyPromptLines) { + outputLines.push(line) + } else if (copyEmptyLines && line.trim() === '') { + outputLines.push(line) + } + } + + // If no lines with the prompt were found then just use original lines + if (lineGotPrompt.some(v => v === true)) { + textContent = outputLines.join('\n'); + } + + // Remove a trailing newline to avoid auto-running when pasting + if (textContent.endsWith("\n")) { + textContent = textContent.slice(0, -1) + } + return textContent +} + + +var copyTargetText = (trigger) => { + var target = document.querySelector(trigger.attributes['data-clipboard-target'].value); + + // get filtered text + let exclude = '.linenos'; + + let text = filterText(target, exclude); + return formatCopyText(text, '', false, true, true, true, '', '') +} + + // Initialize with a callback so we can modify the text before copy + const clipboard = new ClipboardJS('.copybtn', {text: copyTargetText}) + + // Update UI with error/success messages + clipboard.on('success', event => { + clearSelection() + temporarilyChangeTooltip(event.trigger, messages[locale]['copy'], messages[locale]['copy_success']) + temporarilyChangeIcon(event.trigger) + }) + + clipboard.on('error', event => { + temporarilyChangeTooltip(event.trigger, messages[locale]['copy'], messages[locale]['copy_failure']) + }) +} + +runWhenDOMLoaded(addCopyButtonToCodeCells) \ No newline at end of file diff --git a/_static/copybutton_funcs.js b/_static/copybutton_funcs.js new file mode 100644 index 00000000..dbe1aaad --- /dev/null +++ b/_static/copybutton_funcs.js @@ -0,0 +1,73 @@ +function escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string +} + +/** + * Removes excluded text from a Node. + * + * @param {Node} target Node to filter. + * @param {string} exclude CSS selector of nodes to exclude. + * @returns {DOMString} Text from `target` with text removed. + */ +export function filterText(target, exclude) { + const clone = target.cloneNode(true); // clone as to not modify the live DOM + if (exclude) { + // remove excluded nodes + clone.querySelectorAll(exclude).forEach(node => node.remove()); + } + return clone.innerText; +} + +// Callback when a copy button is clicked. Will be passed the node that was clicked +// should then grab the text and replace pieces of text that shouldn't be used in output +export function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") { + var regexp; + var match; + + // Do we check for line continuation characters and "HERE-documents"? + var useLineCont = !!lineContinuationChar + var useHereDoc = !!hereDocDelim + + // create regexp to capture prompt and remaining line + if (isRegexp) { + regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)') + } else { + regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)') + } + + const outputLines = []; + var promptFound = false; + var gotLineCont = false; + var gotHereDoc = false; + const lineGotPrompt = []; + for (const line of textContent.split('\n')) { + match = line.match(regexp) + if (match || gotLineCont || gotHereDoc) { + promptFound = regexp.test(line) + lineGotPrompt.push(promptFound) + if (removePrompts && promptFound) { + outputLines.push(match[2]) + } else { + outputLines.push(line) + } + gotLineCont = line.endsWith(lineContinuationChar) & useLineCont + if (line.includes(hereDocDelim) & useHereDoc) + gotHereDoc = !gotHereDoc + } else if (!onlyCopyPromptLines) { + outputLines.push(line) + } else if (copyEmptyLines && line.trim() === '') { + outputLines.push(line) + } + } + + // If no lines with the prompt were found then just use original lines + if (lineGotPrompt.some(v => v === true)) { + textContent = outputLines.join('\n'); + } + + // Remove a trailing newline to avoid auto-running when pasting + if (textContent.endsWith("\n")) { + textContent = textContent.slice(0, -1) + } + return textContent +} diff --git a/_static/css/theme.css b/_static/css/theme.css new file mode 100644 index 00000000..9fdabdf8 --- /dev/null +++ b/_static/css/theme.css @@ -0,0 +1,12380 @@ +@charset "UTF-8"; +/*! + * Bootstrap v4.0.0 (https://getbootstrap.com) + * Copyright 2011-2018 The Bootstrap Authors + * Copyright 2011-2018 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +:root { + --blue: #007bff; + --indigo: #6610f2; + --purple: #6f42c1; + --pink: #e83e8c; + --red: #dc3545; + --orange: #fd7e14; + --yellow: #ffc107; + --green: #28a745; + --teal: #20c997; + --cyan: #17a2b8; + --white: #fff; + --gray: #6c757d; + --gray-dark: #343a40; + --primary: #007bff; + --secondary: #6c757d; + --success: #28a745; + --info: #17a2b8; + --warning: #ffc107; + --danger: #dc3545; + --light: #f8f9fa; + --dark: #343a40; + --breakpoint-xs: 0; + --breakpoint-sm: 576px; + --breakpoint-md: 768px; + --breakpoint-lg: 992px; + --breakpoint-xl: 1200px; + --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; +} + +*, +*::before, +*::after { + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +html { + font-family: sans-serif; + line-height: 1.15; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; + -ms-overflow-style: scrollbar; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +@-ms-viewport { + width: device-width; +} +article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section { + display: block; +} + +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #212529; + text-align: left; + background-color: #fff; + + --lightning: #792ee5; + --pytorch: #e44c2c; + --pytorch-red: #ee4c2c; + --readthedoc: #2980b9; + --google-blue: #4285f4; + --google-red: #db4437; + --google-yellow: #f4b400; + --google-green: #0f9d58; +} + +[tabindex="-1"]:focus { + outline: 0 !important; +} + +hr { + -webkit-box-sizing: content-box; + box-sizing: content-box; + height: 0; + overflow: visible; +} + +h1, h2, h3, h4, h5, h6 { + margin-top: 0; + margin-bottom: 0.5rem; +} + +p { + margin-top: 0; + margin-bottom: 1rem; +} + +abbr[title], +abbr[data-original-title] { + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + cursor: help; + border-bottom: 0; +} + +address { + margin-bottom: 1rem; + font-style: normal; + line-height: inherit; +} + +ol, +ul, +dl { + margin-top: 0; + margin-bottom: 1rem; +} + +ol ol, +ul ul, +ol ul, +ul ol { + margin-bottom: 0; +} + +dt { + font-weight: 700; +} + +dd { + margin-bottom: .5rem; + margin-left: 0; +} + +blockquote { + margin: 0 0 1rem; +} + +dfn { + font-style: italic; +} + +b, +strong { + font-weight: bolder; +} + +small { + font-size: 80%; +} + +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} + +sub { + bottom: -.25em; +} + +sup { + top: -.5em; +} + +a { + color: #007bff; + text-decoration: none; + background-color: transparent; + -webkit-text-decoration-skip: objects; +} +a:hover { + color: #0056b3; + text-decoration: underline; +} + +a:not([href]):not([tabindex]) { + color: inherit; + text-decoration: none; +} +a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus { + color: inherit; + text-decoration: none; +} +a:not([href]):not([tabindex]):focus { + outline: 0; +} + +pre, +code, +kbd, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +pre { + margin-top: 0; + margin-bottom: 1rem; + overflow: auto; + -ms-overflow-style: scrollbar; +} + +figure { + margin: 0 0 1rem; +} + +img { + vertical-align: middle; + border-style: none; +} + +svg:not(:root) { + overflow: hidden; +} + +table { + border-collapse: collapse; +} + +caption { + padding-top: 0.75rem; + padding-bottom: 0.75rem; + color: #6c757d; + text-align: left; + caption-side: bottom; +} + +th { + text-align: inherit; +} + +label { + display: inline-block; + margin-bottom: .5rem; +} + +button { + border-radius: 0; +} + +button:focus { + outline: 1px dotted; + outline: 5px auto -webkit-focus-ring-color; +} + +input, +button, +select, +optgroup, +textarea { + margin: 0; + font-family: inherit; + font-size: inherit; + line-height: inherit; +} + +button, +input { + overflow: visible; +} + +button, +select { + text-transform: none; +} + +button, +html [type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + padding: 0; + border-style: none; +} + +input[type="radio"], +input[type="checkbox"] { + -webkit-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} + +input[type="date"], +input[type="time"], +input[type="datetime-local"], +input[type="month"] { + -webkit-appearance: listbox; +} + +textarea { + overflow: auto; + resize: vertical; +} + +fieldset { + min-width: 0; + padding: 0; + margin: 0; + border: 0; +} + +legend { + display: block; + width: 100%; + max-width: 100%; + padding: 0; + margin-bottom: .5rem; + font-size: 1.5rem; + line-height: inherit; + color: inherit; + white-space: normal; +} + +progress { + vertical-align: baseline; +} + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +[type="search"] { + outline-offset: -2px; + -webkit-appearance: none; +} + +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +::-webkit-file-upload-button { + font: inherit; + -webkit-appearance: button; +} + +output { + display: inline-block; +} + +summary { + display: list-item; + cursor: pointer; +} + +template { + display: none; +} + +[hidden] { + display: none !important; +} + +h1, h2, h3, h4, h5, h6, +.h1, .h2, .h3, .h4, .h5, .h6 { + margin-bottom: 0.5rem; + font-family: inherit; + font-weight: 500; + line-height: 1.2; + color: inherit; +} + +h1, .h1 { + font-size: 2.5rem; +} + +h2, .h2 { + font-size: 2rem; +} + +h3, .h3 { + font-size: 1.75rem; +} + +h4, .h4 { + font-size: 1.5rem; +} + +h5, .h5 { + font-size: 1.25rem; +} + +h6, .h6 { + font-size: 1rem; +} + +.lead { + font-size: 1.25rem; + font-weight: 300; +} + +.display-1 { + font-size: 6rem; + font-weight: 300; + line-height: 1.2; +} + +.display-2 { + font-size: 5.5rem; + font-weight: 300; + line-height: 1.2; +} + +.display-3 { + font-size: 4.5rem; + font-weight: 300; + line-height: 1.2; +} + +.display-4 { + font-size: 3.5rem; + font-weight: 300; + line-height: 1.2; +} + +hr { + margin-top: 1rem; + margin-bottom: 1rem; + border: 0; + border-top: 1px solid rgba(0, 0, 0, 0.1); +} + +small, +.small { + font-size: 80%; + font-weight: 400; +} + +mark, +.mark { + padding: 0.2em; + background-color: #fcf8e3; +} + +.list-unstyled { + padding-left: 0; + list-style: none; +} + +.list-inline { + padding-left: 0; + list-style: none; +} + +.list-inline-item { + display: inline-block; +} +.list-inline-item:not(:last-child) { + margin-right: 0.5rem; +} + +.initialism { + font-size: 90%; + text-transform: uppercase; +} + +.blockquote { + margin-bottom: 1rem; + font-size: 1.25rem; +} + +.blockquote-footer { + display: block; + font-size: 80%; + color: #6c757d; +} +.blockquote-footer::before { + content: "\2014 \00A0"; +} + +.img-fluid { + max-width: 100%; + height: auto; +} + +.img-thumbnail { + padding: 0.25rem; + background-color: #fff; + border: 1px solid #dee2e6; + border-radius: 0.25rem; + max-width: 100%; + height: auto; +} + +.figure { + display: inline-block; +} + +.figure-img { + margin-bottom: 0.5rem; + line-height: 1; +} + +.figure-caption { + font-size: 90%; + color: #6c757d; +} + +code, +kbd, +pre, +samp { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; +} + +code { + font-size: 87.5%; + color: #e83e8c; + word-break: break-word; +} +a > code { + color: inherit; +} + +kbd { + padding: 0.2rem 0.4rem; + font-size: 87.5%; + color: #fff; + background-color: #212529; + border-radius: 0.2rem; +} +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: 700; +} + +pre { + display: block; + font-size: 87.5%; + color: #212529; +} +pre code { + font-size: inherit; + color: inherit; + word-break: normal; +} + +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} + +.container { + width: 100%; + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +@media (min-width: 576px) { + .container { + max-width: 540px; + } +} +@media (min-width: 768px) { + .container { + max-width: 720px; + } +} +@media (min-width: 992px) { + .container { + max-width: 960px; + } +} +@media (min-width: 1200px) { + .container { + max-width: 1140px; + } +} + +.container-fluid { + width: 100%; + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} + +.row { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + margin-right: -15px; + margin-left: -15px; +} + +.no-gutters { + margin-right: 0; + margin-left: 0; +} +.no-gutters > .col, +.no-gutters > [class*="col-"] { + padding-right: 0; + padding-left: 0; +} + +.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col, +.col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm, +.col-sm-auto, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md, +.col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg, +.col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl, +.col-xl-auto { + position: relative; + width: 100%; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; +} + +.col { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; +} + +.col-auto { + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; +} + +.col-1 { + -webkit-box-flex: 0; + -ms-flex: 0 0 8.3333333333%; + flex: 0 0 8.3333333333%; + max-width: 8.3333333333%; +} + +.col-2 { + -webkit-box-flex: 0; + -ms-flex: 0 0 16.6666666667%; + flex: 0 0 16.6666666667%; + max-width: 16.6666666667%; +} + +.col-3 { + -webkit-box-flex: 0; + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; +} + +.col-4 { + -webkit-box-flex: 0; + -ms-flex: 0 0 33.3333333333%; + flex: 0 0 33.3333333333%; + max-width: 33.3333333333%; +} + +.col-5 { + -webkit-box-flex: 0; + -ms-flex: 0 0 41.6666666667%; + flex: 0 0 41.6666666667%; + max-width: 41.6666666667%; +} + +.col-6 { + -webkit-box-flex: 0; + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; +} + +.col-7 { + -webkit-box-flex: 0; + -ms-flex: 0 0 58.3333333333%; + flex: 0 0 58.3333333333%; + max-width: 58.3333333333%; +} + +.col-8 { + -webkit-box-flex: 0; + -ms-flex: 0 0 66.6666666667%; + flex: 0 0 66.6666666667%; + max-width: 66.6666666667%; +} + +.col-9 { + -webkit-box-flex: 0; + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; +} + +.col-10 { + -webkit-box-flex: 0; + -ms-flex: 0 0 83.3333333333%; + flex: 0 0 83.3333333333%; + max-width: 83.3333333333%; +} + +.col-11 { + -webkit-box-flex: 0; + -ms-flex: 0 0 91.6666666667%; + flex: 0 0 91.6666666667%; + max-width: 91.6666666667%; +} + +.col-12 { + -webkit-box-flex: 0; + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; +} + +.order-first { + -webkit-box-ordinal-group: 0; + -ms-flex-order: -1; + order: -1; +} + +.order-last { + -webkit-box-ordinal-group: 14; + -ms-flex-order: 13; + order: 13; +} + +.order-0 { + -webkit-box-ordinal-group: 1; + -ms-flex-order: 0; + order: 0; +} + +.order-1 { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1; +} + +.order-2 { + -webkit-box-ordinal-group: 3; + -ms-flex-order: 2; + order: 2; +} + +.order-3 { + -webkit-box-ordinal-group: 4; + -ms-flex-order: 3; + order: 3; +} + +.order-4 { + -webkit-box-ordinal-group: 5; + -ms-flex-order: 4; + order: 4; +} + +.order-5 { + -webkit-box-ordinal-group: 6; + -ms-flex-order: 5; + order: 5; +} + +.order-6 { + -webkit-box-ordinal-group: 7; + -ms-flex-order: 6; + order: 6; +} + +.order-7 { + -webkit-box-ordinal-group: 8; + -ms-flex-order: 7; + order: 7; +} + +.order-8 { + -webkit-box-ordinal-group: 9; + -ms-flex-order: 8; + order: 8; +} + +.order-9 { + -webkit-box-ordinal-group: 10; + -ms-flex-order: 9; + order: 9; +} + +.order-10 { + -webkit-box-ordinal-group: 11; + -ms-flex-order: 10; + order: 10; +} + +.order-11 { + -webkit-box-ordinal-group: 12; + -ms-flex-order: 11; + order: 11; +} + +.order-12 { + -webkit-box-ordinal-group: 13; + -ms-flex-order: 12; + order: 12; +} + +.offset-1 { + margin-left: 8.3333333333%; +} + +.offset-2 { + margin-left: 16.6666666667%; +} + +.offset-3 { + margin-left: 25%; +} + +.offset-4 { + margin-left: 33.3333333333%; +} + +.offset-5 { + margin-left: 41.6666666667%; +} + +.offset-6 { + margin-left: 50%; +} + +.offset-7 { + margin-left: 58.3333333333%; +} + +.offset-8 { + margin-left: 66.6666666667%; +} + +.offset-9 { + margin-left: 75%; +} + +.offset-10 { + margin-left: 83.3333333333%; +} + +.offset-11 { + margin-left: 91.6666666667%; +} + +@media (min-width: 576px) { + .col-sm { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + + .col-sm-auto { + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + + .col-sm-1 { + -webkit-box-flex: 0; + -ms-flex: 0 0 8.3333333333%; + flex: 0 0 8.3333333333%; + max-width: 8.3333333333%; + } + + .col-sm-2 { + -webkit-box-flex: 0; + -ms-flex: 0 0 16.6666666667%; + flex: 0 0 16.6666666667%; + max-width: 16.6666666667%; + } + + .col-sm-3 { + -webkit-box-flex: 0; + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + + .col-sm-4 { + -webkit-box-flex: 0; + -ms-flex: 0 0 33.3333333333%; + flex: 0 0 33.3333333333%; + max-width: 33.3333333333%; + } + + .col-sm-5 { + -webkit-box-flex: 0; + -ms-flex: 0 0 41.6666666667%; + flex: 0 0 41.6666666667%; + max-width: 41.6666666667%; + } + + .col-sm-6 { + -webkit-box-flex: 0; + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + + .col-sm-7 { + -webkit-box-flex: 0; + -ms-flex: 0 0 58.3333333333%; + flex: 0 0 58.3333333333%; + max-width: 58.3333333333%; + } + + .col-sm-8 { + -webkit-box-flex: 0; + -ms-flex: 0 0 66.6666666667%; + flex: 0 0 66.6666666667%; + max-width: 66.6666666667%; + } + + .col-sm-9 { + -webkit-box-flex: 0; + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + + .col-sm-10 { + -webkit-box-flex: 0; + -ms-flex: 0 0 83.3333333333%; + flex: 0 0 83.3333333333%; + max-width: 83.3333333333%; + } + + .col-sm-11 { + -webkit-box-flex: 0; + -ms-flex: 0 0 91.6666666667%; + flex: 0 0 91.6666666667%; + max-width: 91.6666666667%; + } + + .col-sm-12 { + -webkit-box-flex: 0; + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + + .order-sm-first { + -webkit-box-ordinal-group: 0; + -ms-flex-order: -1; + order: -1; + } + + .order-sm-last { + -webkit-box-ordinal-group: 14; + -ms-flex-order: 13; + order: 13; + } + + .order-sm-0 { + -webkit-box-ordinal-group: 1; + -ms-flex-order: 0; + order: 0; + } + + .order-sm-1 { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1; + } + + .order-sm-2 { + -webkit-box-ordinal-group: 3; + -ms-flex-order: 2; + order: 2; + } + + .order-sm-3 { + -webkit-box-ordinal-group: 4; + -ms-flex-order: 3; + order: 3; + } + + .order-sm-4 { + -webkit-box-ordinal-group: 5; + -ms-flex-order: 4; + order: 4; + } + + .order-sm-5 { + -webkit-box-ordinal-group: 6; + -ms-flex-order: 5; + order: 5; + } + + .order-sm-6 { + -webkit-box-ordinal-group: 7; + -ms-flex-order: 6; + order: 6; + } + + .order-sm-7 { + -webkit-box-ordinal-group: 8; + -ms-flex-order: 7; + order: 7; + } + + .order-sm-8 { + -webkit-box-ordinal-group: 9; + -ms-flex-order: 8; + order: 8; + } + + .order-sm-9 { + -webkit-box-ordinal-group: 10; + -ms-flex-order: 9; + order: 9; + } + + .order-sm-10 { + -webkit-box-ordinal-group: 11; + -ms-flex-order: 10; + order: 10; + } + + .order-sm-11 { + -webkit-box-ordinal-group: 12; + -ms-flex-order: 11; + order: 11; + } + + .order-sm-12 { + -webkit-box-ordinal-group: 13; + -ms-flex-order: 12; + order: 12; + } + + .offset-sm-0 { + margin-left: 0; + } + + .offset-sm-1 { + margin-left: 8.3333333333%; + } + + .offset-sm-2 { + margin-left: 16.6666666667%; + } + + .offset-sm-3 { + margin-left: 25%; + } + + .offset-sm-4 { + margin-left: 33.3333333333%; + } + + .offset-sm-5 { + margin-left: 41.6666666667%; + } + + .offset-sm-6 { + margin-left: 50%; + } + + .offset-sm-7 { + margin-left: 58.3333333333%; + } + + .offset-sm-8 { + margin-left: 66.6666666667%; + } + + .offset-sm-9 { + margin-left: 75%; + } + + .offset-sm-10 { + margin-left: 83.3333333333%; + } + + .offset-sm-11 { + margin-left: 91.6666666667%; + } +} +@media (min-width: 768px) { + .col-md { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + + .col-md-auto { + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + + .col-md-1 { + -webkit-box-flex: 0; + -ms-flex: 0 0 8.3333333333%; + flex: 0 0 8.3333333333%; + max-width: 8.3333333333%; + } + + .col-md-2 { + -webkit-box-flex: 0; + -ms-flex: 0 0 16.6666666667%; + flex: 0 0 16.6666666667%; + max-width: 16.6666666667%; + } + + .col-md-3 { + -webkit-box-flex: 0; + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + + .col-md-4 { + -webkit-box-flex: 0; + -ms-flex: 0 0 33.3333333333%; + flex: 0 0 33.3333333333%; + max-width: 33.3333333333%; + } + + .col-md-5 { + -webkit-box-flex: 0; + -ms-flex: 0 0 41.6666666667%; + flex: 0 0 41.6666666667%; + max-width: 41.6666666667%; + } + + .col-md-6 { + -webkit-box-flex: 0; + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + + .col-md-7 { + -webkit-box-flex: 0; + -ms-flex: 0 0 58.3333333333%; + flex: 0 0 58.3333333333%; + max-width: 58.3333333333%; + } + + .col-md-8 { + -webkit-box-flex: 0; + -ms-flex: 0 0 66.6666666667%; + flex: 0 0 66.6666666667%; + max-width: 66.6666666667%; + } + + .col-md-9 { + -webkit-box-flex: 0; + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + + .col-md-10 { + -webkit-box-flex: 0; + -ms-flex: 0 0 83.3333333333%; + flex: 0 0 83.3333333333%; + max-width: 83.3333333333%; + } + + .col-md-11 { + -webkit-box-flex: 0; + -ms-flex: 0 0 91.6666666667%; + flex: 0 0 91.6666666667%; + max-width: 91.6666666667%; + } + + .col-md-12 { + -webkit-box-flex: 0; + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + + .order-md-first { + -webkit-box-ordinal-group: 0; + -ms-flex-order: -1; + order: -1; + } + + .order-md-last { + -webkit-box-ordinal-group: 14; + -ms-flex-order: 13; + order: 13; + } + + .order-md-0 { + -webkit-box-ordinal-group: 1; + -ms-flex-order: 0; + order: 0; + } + + .order-md-1 { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1; + } + + .order-md-2 { + -webkit-box-ordinal-group: 3; + -ms-flex-order: 2; + order: 2; + } + + .order-md-3 { + -webkit-box-ordinal-group: 4; + -ms-flex-order: 3; + order: 3; + } + + .order-md-4 { + -webkit-box-ordinal-group: 5; + -ms-flex-order: 4; + order: 4; + } + + .order-md-5 { + -webkit-box-ordinal-group: 6; + -ms-flex-order: 5; + order: 5; + } + + .order-md-6 { + -webkit-box-ordinal-group: 7; + -ms-flex-order: 6; + order: 6; + } + + .order-md-7 { + -webkit-box-ordinal-group: 8; + -ms-flex-order: 7; + order: 7; + } + + .order-md-8 { + -webkit-box-ordinal-group: 9; + -ms-flex-order: 8; + order: 8; + } + + .order-md-9 { + -webkit-box-ordinal-group: 10; + -ms-flex-order: 9; + order: 9; + } + + .order-md-10 { + -webkit-box-ordinal-group: 11; + -ms-flex-order: 10; + order: 10; + } + + .order-md-11 { + -webkit-box-ordinal-group: 12; + -ms-flex-order: 11; + order: 11; + } + + .order-md-12 { + -webkit-box-ordinal-group: 13; + -ms-flex-order: 12; + order: 12; + } + + .offset-md-0 { + margin-left: 0; + } + + .offset-md-1 { + margin-left: 8.3333333333%; + } + + .offset-md-2 { + margin-left: 16.6666666667%; + } + + .offset-md-3 { + margin-left: 25%; + } + + .offset-md-4 { + margin-left: 33.3333333333%; + } + + .offset-md-5 { + margin-left: 41.6666666667%; + } + + .offset-md-6 { + margin-left: 50%; + } + + .offset-md-7 { + margin-left: 58.3333333333%; + } + + .offset-md-8 { + margin-left: 66.6666666667%; + } + + .offset-md-9 { + margin-left: 75%; + } + + .offset-md-10 { + margin-left: 83.3333333333%; + } + + .offset-md-11 { + margin-left: 91.6666666667%; + } +} +@media (min-width: 992px) { + .col-lg { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + + .col-lg-auto { + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + + .col-lg-1 { + -webkit-box-flex: 0; + -ms-flex: 0 0 8.3333333333%; + flex: 0 0 8.3333333333%; + max-width: 8.3333333333%; + } + + .col-lg-2 { + -webkit-box-flex: 0; + -ms-flex: 0 0 16.6666666667%; + flex: 0 0 16.6666666667%; + max-width: 16.6666666667%; + } + + .col-lg-3 { + -webkit-box-flex: 0; + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + + .col-lg-4 { + -webkit-box-flex: 0; + -ms-flex: 0 0 33.3333333333%; + flex: 0 0 33.3333333333%; + max-width: 33.3333333333%; + } + + .col-lg-5 { + -webkit-box-flex: 0; + -ms-flex: 0 0 41.6666666667%; + flex: 0 0 41.6666666667%; + max-width: 41.6666666667%; + } + + .col-lg-6 { + -webkit-box-flex: 0; + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + + .col-lg-7 { + -webkit-box-flex: 0; + -ms-flex: 0 0 58.3333333333%; + flex: 0 0 58.3333333333%; + max-width: 58.3333333333%; + } + + .col-lg-8 { + -webkit-box-flex: 0; + -ms-flex: 0 0 66.6666666667%; + flex: 0 0 66.6666666667%; + max-width: 66.6666666667%; + } + + .col-lg-9 { + -webkit-box-flex: 0; + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + + .col-lg-10 { + -webkit-box-flex: 0; + -ms-flex: 0 0 83.3333333333%; + flex: 0 0 83.3333333333%; + max-width: 83.3333333333%; + } + + .col-lg-11 { + -webkit-box-flex: 0; + -ms-flex: 0 0 91.6666666667%; + flex: 0 0 91.6666666667%; + max-width: 91.6666666667%; + } + + .col-lg-12 { + -webkit-box-flex: 0; + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + + .order-lg-first { + -webkit-box-ordinal-group: 0; + -ms-flex-order: -1; + order: -1; + } + + .order-lg-last { + -webkit-box-ordinal-group: 14; + -ms-flex-order: 13; + order: 13; + } + + .order-lg-0 { + -webkit-box-ordinal-group: 1; + -ms-flex-order: 0; + order: 0; + } + + .order-lg-1 { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1; + } + + .order-lg-2 { + -webkit-box-ordinal-group: 3; + -ms-flex-order: 2; + order: 2; + } + + .order-lg-3 { + -webkit-box-ordinal-group: 4; + -ms-flex-order: 3; + order: 3; + } + + .order-lg-4 { + -webkit-box-ordinal-group: 5; + -ms-flex-order: 4; + order: 4; + } + + .order-lg-5 { + -webkit-box-ordinal-group: 6; + -ms-flex-order: 5; + order: 5; + } + + .order-lg-6 { + -webkit-box-ordinal-group: 7; + -ms-flex-order: 6; + order: 6; + } + + .order-lg-7 { + -webkit-box-ordinal-group: 8; + -ms-flex-order: 7; + order: 7; + } + + .order-lg-8 { + -webkit-box-ordinal-group: 9; + -ms-flex-order: 8; + order: 8; + } + + .order-lg-9 { + -webkit-box-ordinal-group: 10; + -ms-flex-order: 9; + order: 9; + } + + .order-lg-10 { + -webkit-box-ordinal-group: 11; + -ms-flex-order: 10; + order: 10; + } + + .order-lg-11 { + -webkit-box-ordinal-group: 12; + -ms-flex-order: 11; + order: 11; + } + + .order-lg-12 { + -webkit-box-ordinal-group: 13; + -ms-flex-order: 12; + order: 12; + } + + .offset-lg-0 { + margin-left: 0; + } + + .offset-lg-1 { + margin-left: 8.3333333333%; + } + + .offset-lg-2 { + margin-left: 16.6666666667%; + } + + .offset-lg-3 { + margin-left: 25%; + } + + .offset-lg-4 { + margin-left: 33.3333333333%; + } + + .offset-lg-5 { + margin-left: 41.6666666667%; + } + + .offset-lg-6 { + margin-left: 50%; + } + + .offset-lg-7 { + margin-left: 58.3333333333%; + } + + .offset-lg-8 { + margin-left: 66.6666666667%; + } + + .offset-lg-9 { + margin-left: 75%; + } + + .offset-lg-10 { + margin-left: 83.3333333333%; + } + + .offset-lg-11 { + margin-left: 91.6666666667%; + } +} +@media (min-width: 1200px) { + .col-xl { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + + .col-xl-auto { + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + + .col-xl-1 { + -webkit-box-flex: 0; + -ms-flex: 0 0 8.3333333333%; + flex: 0 0 8.3333333333%; + max-width: 8.3333333333%; + } + + .col-xl-2 { + -webkit-box-flex: 0; + -ms-flex: 0 0 16.6666666667%; + flex: 0 0 16.6666666667%; + max-width: 16.6666666667%; + } + + .col-xl-3 { + -webkit-box-flex: 0; + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + + .col-xl-4 { + -webkit-box-flex: 0; + -ms-flex: 0 0 33.3333333333%; + flex: 0 0 33.3333333333%; + max-width: 33.3333333333%; + } + + .col-xl-5 { + -webkit-box-flex: 0; + -ms-flex: 0 0 41.6666666667%; + flex: 0 0 41.6666666667%; + max-width: 41.6666666667%; + } + + .col-xl-6 { + -webkit-box-flex: 0; + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + + .col-xl-7 { + -webkit-box-flex: 0; + -ms-flex: 0 0 58.3333333333%; + flex: 0 0 58.3333333333%; + max-width: 58.3333333333%; + } + + .col-xl-8 { + -webkit-box-flex: 0; + -ms-flex: 0 0 66.6666666667%; + flex: 0 0 66.6666666667%; + max-width: 66.6666666667%; + } + + .col-xl-9 { + -webkit-box-flex: 0; + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + + .col-xl-10 { + -webkit-box-flex: 0; + -ms-flex: 0 0 83.3333333333%; + flex: 0 0 83.3333333333%; + max-width: 83.3333333333%; + } + + .col-xl-11 { + -webkit-box-flex: 0; + -ms-flex: 0 0 91.6666666667%; + flex: 0 0 91.6666666667%; + max-width: 91.6666666667%; + } + + .col-xl-12 { + -webkit-box-flex: 0; + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + + .order-xl-first { + -webkit-box-ordinal-group: 0; + -ms-flex-order: -1; + order: -1; + } + + .order-xl-last { + -webkit-box-ordinal-group: 14; + -ms-flex-order: 13; + order: 13; + } + + .order-xl-0 { + -webkit-box-ordinal-group: 1; + -ms-flex-order: 0; + order: 0; + } + + .order-xl-1 { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1; + } + + .order-xl-2 { + -webkit-box-ordinal-group: 3; + -ms-flex-order: 2; + order: 2; + } + + .order-xl-3 { + -webkit-box-ordinal-group: 4; + -ms-flex-order: 3; + order: 3; + } + + .order-xl-4 { + -webkit-box-ordinal-group: 5; + -ms-flex-order: 4; + order: 4; + } + + .order-xl-5 { + -webkit-box-ordinal-group: 6; + -ms-flex-order: 5; + order: 5; + } + + .order-xl-6 { + -webkit-box-ordinal-group: 7; + -ms-flex-order: 6; + order: 6; + } + + .order-xl-7 { + -webkit-box-ordinal-group: 8; + -ms-flex-order: 7; + order: 7; + } + + .order-xl-8 { + -webkit-box-ordinal-group: 9; + -ms-flex-order: 8; + order: 8; + } + + .order-xl-9 { + -webkit-box-ordinal-group: 10; + -ms-flex-order: 9; + order: 9; + } + + .order-xl-10 { + -webkit-box-ordinal-group: 11; + -ms-flex-order: 10; + order: 10; + } + + .order-xl-11 { + -webkit-box-ordinal-group: 12; + -ms-flex-order: 11; + order: 11; + } + + .order-xl-12 { + -webkit-box-ordinal-group: 13; + -ms-flex-order: 12; + order: 12; + } + + .offset-xl-0 { + margin-left: 0; + } + + .offset-xl-1 { + margin-left: 8.3333333333%; + } + + .offset-xl-2 { + margin-left: 16.6666666667%; + } + + .offset-xl-3 { + margin-left: 25%; + } + + .offset-xl-4 { + margin-left: 33.3333333333%; + } + + .offset-xl-5 { + margin-left: 41.6666666667%; + } + + .offset-xl-6 { + margin-left: 50%; + } + + .offset-xl-7 { + margin-left: 58.3333333333%; + } + + .offset-xl-8 { + margin-left: 66.6666666667%; + } + + .offset-xl-9 { + margin-left: 75%; + } + + .offset-xl-10 { + margin-left: 83.3333333333%; + } + + .offset-xl-11 { + margin-left: 91.6666666667%; + } +} +.table { + width: 100%; + max-width: 100%; + margin-bottom: 1rem; + background-color: transparent; +} +.table th, +.table td { + padding: 0.75rem; + vertical-align: top; + border-top: 1px solid #dee2e6; +} +.table thead th { + vertical-align: bottom; + border-bottom: 2px solid #dee2e6; +} +.table tbody + tbody { + border-top: 2px solid #dee2e6; +} +.table .table { + background-color: #fff; +} + +.table-sm th, +.table-sm td { + padding: 0.3rem; +} + +.table-bordered { + border: 1px solid #dee2e6; +} +.table-bordered th, +.table-bordered td { + border: 1px solid #dee2e6; +} +.table-bordered thead th, +.table-bordered thead td { + border-bottom-width: 2px; +} + +.table-striped tbody tr:nth-of-type(odd) { + background-color: rgba(0, 0, 0, 0.05); +} + +.table-hover tbody tr:hover { + background-color: rgba(0, 0, 0, 0.075); +} + +.table-primary, +.table-primary > th, +.table-primary > td { + background-color: #b8daff; +} + +.table-hover .table-primary:hover { + background-color: #9fcdff; +} +.table-hover .table-primary:hover > td, +.table-hover .table-primary:hover > th { + background-color: #9fcdff; +} + +.table-secondary, +.table-secondary > th, +.table-secondary > td { + background-color: #d6d8db; +} + +.table-hover .table-secondary:hover { + background-color: #c8cbcf; +} +.table-hover .table-secondary:hover > td, +.table-hover .table-secondary:hover > th { + background-color: #c8cbcf; +} + +.table-success, +.table-success > th, +.table-success > td { + background-color: #c3e6cb; +} + +.table-hover .table-success:hover { + background-color: #b1dfbb; +} +.table-hover .table-success:hover > td, +.table-hover .table-success:hover > th { + background-color: #b1dfbb; +} + +.table-info, +.table-info > th, +.table-info > td { + background-color: #bee5eb; +} + +.table-hover .table-info:hover { + background-color: #abdde5; +} +.table-hover .table-info:hover > td, +.table-hover .table-info:hover > th { + background-color: #abdde5; +} + +.table-warning, +.table-warning > th, +.table-warning > td { + background-color: #ffeeba; +} + +.table-hover .table-warning:hover { + background-color: #ffe8a1; +} +.table-hover .table-warning:hover > td, +.table-hover .table-warning:hover > th { + background-color: #ffe8a1; +} + +.table-danger, +.table-danger > th, +.table-danger > td { + background-color: #f5c6cb; +} + +.table-hover .table-danger:hover { + background-color: #f1b0b7; +} +.table-hover .table-danger:hover > td, +.table-hover .table-danger:hover > th { + background-color: #f1b0b7; +} + +.table-light, +.table-light > th, +.table-light > td { + background-color: #fdfdfe; +} + +.table-hover .table-light:hover { + background-color: #ececf6; +} +.table-hover .table-light:hover > td, +.table-hover .table-light:hover > th { + background-color: #ececf6; +} + +.table-dark, +.table-dark > th, +.table-dark > td { + background-color: #c6c8ca; +} + +.table-hover .table-dark:hover { + background-color: #b9bbbe; +} +.table-hover .table-dark:hover > td, +.table-hover .table-dark:hover > th { + background-color: #b9bbbe; +} + +.table-active, +.table-active > th, +.table-active > td { + background-color: rgba(0, 0, 0, 0.075); +} + +.table-hover .table-active:hover { + background-color: rgba(0, 0, 0, 0.075); +} +.table-hover .table-active:hover > td, +.table-hover .table-active:hover > th { + background-color: rgba(0, 0, 0, 0.075); +} + +.table .thead-dark th { + color: #fff; + background-color: #212529; + border-color: #32383e; +} +.table .thead-light th { + color: #495057; + background-color: #e9ecef; + border-color: #dee2e6; +} + +.table-dark { + color: #fff; + background-color: #212529; +} +.table-dark th, +.table-dark td, +.table-dark thead th { + border-color: #32383e; +} +.table-dark.table-bordered { + border: 0; +} +.table-dark.table-striped tbody tr:nth-of-type(odd) { + background-color: rgba(255, 255, 255, 0.05); +} +.table-dark.table-hover tbody tr:hover { + background-color: rgba(255, 255, 255, 0.075); +} + +@media (max-width: 575.98px) { + .table-responsive-sm { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + } + .table-responsive-sm > .table-bordered { + border: 0; + } +} +@media (max-width: 767.98px) { + .table-responsive-md { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + } + .table-responsive-md > .table-bordered { + border: 0; + } +} +@media (max-width: 991.98px) { + .table-responsive-lg { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + } + .table-responsive-lg > .table-bordered { + border: 0; + } +} +@media (max-width: 1199.98px) { + .table-responsive-xl { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + } + .table-responsive-xl > .table-bordered { + border: 0; + } +} +.table-responsive { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; +} +.table-responsive > .table-bordered { + border: 0; +} + +.form-control { + display: block; + width: 100%; + padding: 0.375rem 0.75rem; + font-size: 1rem; + line-height: 1.5; + color: #495057; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #ced4da; + border-radius: 0.25rem; + -webkit-transition: border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out; + transition: border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out; +} +.form-control::-ms-expand { + background-color: transparent; + border: 0; +} +.form-control:focus { + color: #495057; + background-color: #fff; + border-color: #80bdff; + outline: 0; + -webkit-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); +} +.form-control::-webkit-input-placeholder { + color: #6c757d; + opacity: 1; +} +.form-control::-moz-placeholder { + color: #6c757d; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #6c757d; + opacity: 1; +} +.form-control::-ms-input-placeholder { + color: #6c757d; + opacity: 1; +} +.form-control::placeholder { + color: #6c757d; + opacity: 1; +} +.form-control:disabled, .form-control[readonly] { + background-color: #e9ecef; + opacity: 1; +} + +select.form-control:not([size]):not([multiple]) { + height: calc(2.25rem + 2px); +} +select.form-control:focus::-ms-value { + color: #495057; + background-color: #fff; +} + +.form-control-file, +.form-control-range { + display: block; + width: 100%; +} + +.col-form-label { + padding-top: calc(0.375rem + 1px); + padding-bottom: calc(0.375rem + 1px); + margin-bottom: 0; + font-size: inherit; + line-height: 1.5; +} + +.col-form-label-lg { + padding-top: calc(0.5rem + 1px); + padding-bottom: calc(0.5rem + 1px); + font-size: 1.25rem; + line-height: 1.5; +} + +.col-form-label-sm { + padding-top: calc(0.25rem + 1px); + padding-bottom: calc(0.25rem + 1px); + font-size: 0.875rem; + line-height: 1.5; +} + +.form-control-plaintext { + display: block; + width: 100%; + padding-top: 0.375rem; + padding-bottom: 0.375rem; + margin-bottom: 0; + line-height: 1.5; + background-color: transparent; + border: solid transparent; + border-width: 1px 0; +} +.form-control-plaintext.form-control-sm, .input-group-sm > .form-control-plaintext.form-control, +.input-group-sm > .input-group-prepend > .form-control-plaintext.input-group-text, +.input-group-sm > .input-group-append > .form-control-plaintext.input-group-text, +.input-group-sm > .input-group-prepend > .form-control-plaintext.btn, +.input-group-sm > .input-group-append > .form-control-plaintext.btn, .form-control-plaintext.form-control-lg, .input-group-lg > .form-control-plaintext.form-control, +.input-group-lg > .input-group-prepend > .form-control-plaintext.input-group-text, +.input-group-lg > .input-group-append > .form-control-plaintext.input-group-text, +.input-group-lg > .input-group-prepend > .form-control-plaintext.btn, +.input-group-lg > .input-group-append > .form-control-plaintext.btn { + padding-right: 0; + padding-left: 0; +} + +.form-control-sm, .input-group-sm > .form-control, +.input-group-sm > .input-group-prepend > .input-group-text, +.input-group-sm > .input-group-append > .input-group-text, +.input-group-sm > .input-group-prepend > .btn, +.input-group-sm > .input-group-append > .btn { + padding: 0.25rem 0.5rem; + font-size: 0.875rem; + line-height: 1.5; + border-radius: 0.2rem; +} + +select.form-control-sm:not([size]):not([multiple]), .input-group-sm > select.form-control:not([size]):not([multiple]), +.input-group-sm > .input-group-prepend > select.input-group-text:not([size]):not([multiple]), +.input-group-sm > .input-group-append > select.input-group-text:not([size]):not([multiple]), +.input-group-sm > .input-group-prepend > select.btn:not([size]):not([multiple]), +.input-group-sm > .input-group-append > select.btn:not([size]):not([multiple]) { + height: calc(1.8125rem + 2px); +} + +.form-control-lg, .input-group-lg > .form-control, +.input-group-lg > .input-group-prepend > .input-group-text, +.input-group-lg > .input-group-append > .input-group-text, +.input-group-lg > .input-group-prepend > .btn, +.input-group-lg > .input-group-append > .btn { + padding: 0.5rem 1rem; + font-size: 1.25rem; + line-height: 1.5; + border-radius: 0.3rem; +} + +select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.form-control:not([size]):not([multiple]), +.input-group-lg > .input-group-prepend > select.input-group-text:not([size]):not([multiple]), +.input-group-lg > .input-group-append > select.input-group-text:not([size]):not([multiple]), +.input-group-lg > .input-group-prepend > select.btn:not([size]):not([multiple]), +.input-group-lg > .input-group-append > select.btn:not([size]):not([multiple]) { + height: calc(2.875rem + 2px); +} + +.form-group { + margin-bottom: 1rem; +} + +.form-text { + display: block; + margin-top: 0.25rem; +} + +.form-row { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + margin-right: -5px; + margin-left: -5px; +} +.form-row > .col, +.form-row > [class*="col-"] { + padding-right: 5px; + padding-left: 5px; +} + +.form-check { + position: relative; + display: block; + padding-left: 1.25rem; +} + +.form-check-input { + position: absolute; + margin-top: 0.3rem; + margin-left: -1.25rem; +} +.form-check-input:disabled ~ .form-check-label { + color: #6c757d; +} + +.form-check-label { + margin-bottom: 0; +} + +.form-check-inline { + display: -webkit-inline-box; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + padding-left: 0; + margin-right: 0.75rem; +} +.form-check-inline .form-check-input { + position: static; + margin-top: 0; + margin-right: 0.3125rem; + margin-left: 0; +} + +.valid-feedback { + display: none; + width: 100%; + margin-top: 0.25rem; + font-size: 80%; + color: #28a745; +} + +.valid-tooltip { + position: absolute; + top: 100%; + z-index: 5; + display: none; + max-width: 100%; + padding: .5rem; + margin-top: .1rem; + font-size: .875rem; + line-height: 1; + color: #fff; + background-color: rgba(40, 167, 69, 0.8); + border-radius: .2rem; +} + +.was-validated .form-control:valid, .form-control.is-valid, +.was-validated .custom-select:valid, +.custom-select.is-valid { + border-color: #28a745; +} +.was-validated .form-control:valid:focus, .form-control.is-valid:focus, +.was-validated .custom-select:valid:focus, +.custom-select.is-valid:focus { + border-color: #28a745; + -webkit-box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); + box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); +} +.was-validated .form-control:valid ~ .valid-feedback, +.was-validated .form-control:valid ~ .valid-tooltip, .form-control.is-valid ~ .valid-feedback, +.form-control.is-valid ~ .valid-tooltip, +.was-validated .custom-select:valid ~ .valid-feedback, +.was-validated .custom-select:valid ~ .valid-tooltip, +.custom-select.is-valid ~ .valid-feedback, +.custom-select.is-valid ~ .valid-tooltip { + display: block; +} + +.was-validated .form-check-input:valid ~ .form-check-label, .form-check-input.is-valid ~ .form-check-label { + color: #28a745; +} +.was-validated .form-check-input:valid ~ .valid-feedback, +.was-validated .form-check-input:valid ~ .valid-tooltip, .form-check-input.is-valid ~ .valid-feedback, +.form-check-input.is-valid ~ .valid-tooltip { + display: block; +} + +.was-validated .custom-control-input:valid ~ .custom-control-label, .custom-control-input.is-valid ~ .custom-control-label { + color: #28a745; +} +.was-validated .custom-control-input:valid ~ .custom-control-label::before, .custom-control-input.is-valid ~ .custom-control-label::before { + background-color: #71dd8a; +} +.was-validated .custom-control-input:valid ~ .valid-feedback, +.was-validated .custom-control-input:valid ~ .valid-tooltip, .custom-control-input.is-valid ~ .valid-feedback, +.custom-control-input.is-valid ~ .valid-tooltip { + display: block; +} +.was-validated .custom-control-input:valid:checked ~ .custom-control-label::before, .custom-control-input.is-valid:checked ~ .custom-control-label::before { + background-color: #34ce57; +} +.was-validated .custom-control-input:valid:focus ~ .custom-control-label::before, .custom-control-input.is-valid:focus ~ .custom-control-label::before { + -webkit-box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(40, 167, 69, 0.25); + box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(40, 167, 69, 0.25); +} + +.was-validated .custom-file-input:valid ~ .custom-file-label, .custom-file-input.is-valid ~ .custom-file-label { + border-color: #28a745; +} +.was-validated .custom-file-input:valid ~ .custom-file-label::before, .custom-file-input.is-valid ~ .custom-file-label::before { + border-color: inherit; +} +.was-validated .custom-file-input:valid ~ .valid-feedback, +.was-validated .custom-file-input:valid ~ .valid-tooltip, .custom-file-input.is-valid ~ .valid-feedback, +.custom-file-input.is-valid ~ .valid-tooltip { + display: block; +} +.was-validated .custom-file-input:valid:focus ~ .custom-file-label, .custom-file-input.is-valid:focus ~ .custom-file-label { + -webkit-box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); + box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); +} + +.invalid-feedback { + display: none; + width: 100%; + margin-top: 0.25rem; + font-size: 80%; + color: #dc3545; +} + +.invalid-tooltip { + position: absolute; + top: 100%; + z-index: 5; + display: none; + max-width: 100%; + padding: .5rem; + margin-top: .1rem; + font-size: .875rem; + line-height: 1; + color: #fff; + background-color: rgba(220, 53, 69, 0.8); + border-radius: .2rem; +} + +.was-validated .form-control:invalid, .form-control.is-invalid, +.was-validated .custom-select:invalid, +.custom-select.is-invalid { + border-color: #dc3545; +} +.was-validated .form-control:invalid:focus, .form-control.is-invalid:focus, +.was-validated .custom-select:invalid:focus, +.custom-select.is-invalid:focus { + border-color: #dc3545; + -webkit-box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); + box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); +} +.was-validated .form-control:invalid ~ .invalid-feedback, +.was-validated .form-control:invalid ~ .invalid-tooltip, .form-control.is-invalid ~ .invalid-feedback, +.form-control.is-invalid ~ .invalid-tooltip, +.was-validated .custom-select:invalid ~ .invalid-feedback, +.was-validated .custom-select:invalid ~ .invalid-tooltip, +.custom-select.is-invalid ~ .invalid-feedback, +.custom-select.is-invalid ~ .invalid-tooltip { + display: block; +} + +.was-validated .form-check-input:invalid ~ .form-check-label, .form-check-input.is-invalid ~ .form-check-label { + color: #dc3545; +} +.was-validated .form-check-input:invalid ~ .invalid-feedback, +.was-validated .form-check-input:invalid ~ .invalid-tooltip, .form-check-input.is-invalid ~ .invalid-feedback, +.form-check-input.is-invalid ~ .invalid-tooltip { + display: block; +} + +.was-validated .custom-control-input:invalid ~ .custom-control-label, .custom-control-input.is-invalid ~ .custom-control-label { + color: #dc3545; +} +.was-validated .custom-control-input:invalid ~ .custom-control-label::before, .custom-control-input.is-invalid ~ .custom-control-label::before { + background-color: #efa2a9; +} +.was-validated .custom-control-input:invalid ~ .invalid-feedback, +.was-validated .custom-control-input:invalid ~ .invalid-tooltip, .custom-control-input.is-invalid ~ .invalid-feedback, +.custom-control-input.is-invalid ~ .invalid-tooltip { + display: block; +} +.was-validated .custom-control-input:invalid:checked ~ .custom-control-label::before, .custom-control-input.is-invalid:checked ~ .custom-control-label::before { + background-color: #e4606d; +} +.was-validated .custom-control-input:invalid:focus ~ .custom-control-label::before, .custom-control-input.is-invalid:focus ~ .custom-control-label::before { + -webkit-box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(220, 53, 69, 0.25); + box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(220, 53, 69, 0.25); +} + +.was-validated .custom-file-input:invalid ~ .custom-file-label, .custom-file-input.is-invalid ~ .custom-file-label { + border-color: #dc3545; +} +.was-validated .custom-file-input:invalid ~ .custom-file-label::before, .custom-file-input.is-invalid ~ .custom-file-label::before { + border-color: inherit; +} +.was-validated .custom-file-input:invalid ~ .invalid-feedback, +.was-validated .custom-file-input:invalid ~ .invalid-tooltip, .custom-file-input.is-invalid ~ .invalid-feedback, +.custom-file-input.is-invalid ~ .invalid-tooltip { + display: block; +} +.was-validated .custom-file-input:invalid:focus ~ .custom-file-label, .custom-file-input.is-invalid:focus ~ .custom-file-label { + -webkit-box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); + box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); +} + +.form-inline { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} +.form-inline .form-check { + width: 100%; +} +@media (min-width: 576px) { + .form-inline label { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + margin-bottom: 0; + } + .form-inline .form-group { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + margin-bottom: 0; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .form-control-plaintext { + display: inline-block; + } + .form-inline .input-group { + width: auto; + } + .form-inline .form-check { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + width: auto; + padding-left: 0; + } + .form-inline .form-check-input { + position: relative; + margin-top: 0; + margin-right: 0.25rem; + margin-left: 0; + } + .form-inline .custom-control { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + } + .form-inline .custom-control-label { + margin-bottom: 0; + } +} + +.btn { + display: inline-block; + font-weight: 400; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border: 1px solid transparent; + padding: 0.375rem 0.75rem; + font-size: 1rem; + line-height: 1.5; + border-radius: 0.25rem; + -webkit-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out; + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out; + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out; +} +.btn:hover, .btn:focus { + text-decoration: none; +} +.btn:focus, .btn.focus { + outline: 0; + -webkit-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); +} +.btn.disabled, .btn:disabled { + opacity: 0.65; +} +.btn:not(:disabled):not(.disabled) { + cursor: pointer; +} +.btn:not(:disabled):not(.disabled):active, .btn:not(:disabled):not(.disabled).active { + background-image: none; +} + +a.btn.disabled, +fieldset:disabled a.btn { + pointer-events: none; +} + +.btn-primary { + color: #fff; + background-color: #007bff; + border-color: #007bff; +} +.btn-primary:hover { + color: #fff; + background-color: #0069d9; + border-color: #0062cc; +} +.btn-primary:focus, .btn-primary.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); +} +.btn-primary.disabled, .btn-primary:disabled { + color: #fff; + background-color: #007bff; + border-color: #007bff; +} +.btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, .show > .btn-primary.dropdown-toggle { + color: #fff; + background-color: #0062cc; + border-color: #005cbf; +} +.btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); +} + +.btn-secondary { + color: #fff; + background-color: #6c757d; + border-color: #6c757d; +} +.btn-secondary:hover { + color: #fff; + background-color: #5a6268; + border-color: #545b62; +} +.btn-secondary:focus, .btn-secondary.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); + box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); +} +.btn-secondary.disabled, .btn-secondary:disabled { + color: #fff; + background-color: #6c757d; + border-color: #6c757d; +} +.btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active, .show > .btn-secondary.dropdown-toggle { + color: #fff; + background-color: #545b62; + border-color: #4e555b; +} +.btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-secondary.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); + box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); +} + +.btn-success { + color: #fff; + background-color: #28a745; + border-color: #28a745; +} +.btn-success:hover { + color: #fff; + background-color: #218838; + border-color: #1e7e34; +} +.btn-success:focus, .btn-success.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); + box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); +} +.btn-success.disabled, .btn-success:disabled { + color: #fff; + background-color: #28a745; + border-color: #28a745; +} +.btn-success:not(:disabled):not(.disabled):active, .btn-success:not(:disabled):not(.disabled).active, .show > .btn-success.dropdown-toggle { + color: #fff; + background-color: #1e7e34; + border-color: #1c7430; +} +.btn-success:not(:disabled):not(.disabled):active:focus, .btn-success:not(:disabled):not(.disabled).active:focus, .show > .btn-success.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); + box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); +} + +.btn-info { + color: #fff; + background-color: #17a2b8; + border-color: #17a2b8; +} +.btn-info:hover { + color: #fff; + background-color: #138496; + border-color: #117a8b; +} +.btn-info:focus, .btn-info.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); + box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); +} +.btn-info.disabled, .btn-info:disabled { + color: #fff; + background-color: #17a2b8; + border-color: #17a2b8; +} +.btn-info:not(:disabled):not(.disabled):active, .btn-info:not(:disabled):not(.disabled).active, .show > .btn-info.dropdown-toggle { + color: #fff; + background-color: #117a8b; + border-color: #10707f; +} +.btn-info:not(:disabled):not(.disabled):active:focus, .btn-info:not(:disabled):not(.disabled).active:focus, .show > .btn-info.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); + box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); +} + +.btn-warning { + color: #212529; + background-color: #ffc107; + border-color: #ffc107; +} +.btn-warning:hover { + color: #212529; + background-color: #e0a800; + border-color: #d39e00; +} +.btn-warning:focus, .btn-warning.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); + box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); +} +.btn-warning.disabled, .btn-warning:disabled { + color: #212529; + background-color: #ffc107; + border-color: #ffc107; +} +.btn-warning:not(:disabled):not(.disabled):active, .btn-warning:not(:disabled):not(.disabled).active, .show > .btn-warning.dropdown-toggle { + color: #212529; + background-color: #d39e00; + border-color: #c69500; +} +.btn-warning:not(:disabled):not(.disabled):active:focus, .btn-warning:not(:disabled):not(.disabled).active:focus, .show > .btn-warning.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); + box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); +} + +.btn-danger { + color: #fff; + background-color: #dc3545; + border-color: #dc3545; +} +.btn-danger:hover { + color: #fff; + background-color: #c82333; + border-color: #bd2130; +} +.btn-danger:focus, .btn-danger.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); + box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); +} +.btn-danger.disabled, .btn-danger:disabled { + color: #fff; + background-color: #dc3545; + border-color: #dc3545; +} +.btn-danger:not(:disabled):not(.disabled):active, .btn-danger:not(:disabled):not(.disabled).active, .show > .btn-danger.dropdown-toggle { + color: #fff; + background-color: #bd2130; + border-color: #b21f2d; +} +.btn-danger:not(:disabled):not(.disabled):active:focus, .btn-danger:not(:disabled):not(.disabled).active:focus, .show > .btn-danger.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); + box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); +} + +.btn-light { + color: #212529; + background-color: #f8f9fa; + border-color: #f8f9fa; +} +.btn-light:hover { + color: #212529; + background-color: #e2e6ea; + border-color: #dae0e5; +} +.btn-light:focus, .btn-light.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); + box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); +} +.btn-light.disabled, .btn-light:disabled { + color: #212529; + background-color: #f8f9fa; + border-color: #f8f9fa; +} +.btn-light:not(:disabled):not(.disabled):active, .btn-light:not(:disabled):not(.disabled).active, .show > .btn-light.dropdown-toggle { + color: #212529; + background-color: #dae0e5; + border-color: #d3d9df; +} +.btn-light:not(:disabled):not(.disabled):active:focus, .btn-light:not(:disabled):not(.disabled).active:focus, .show > .btn-light.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); + box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); +} + +.btn-dark { + color: #fff; + background-color: #343a40; + border-color: #343a40; +} +.btn-dark:hover { + color: #fff; + background-color: #23272b; + border-color: #1d2124; +} +.btn-dark:focus, .btn-dark.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); + box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); +} +.btn-dark.disabled, .btn-dark:disabled { + color: #fff; + background-color: #343a40; + border-color: #343a40; +} +.btn-dark:not(:disabled):not(.disabled):active, .btn-dark:not(:disabled):not(.disabled).active, .show > .btn-dark.dropdown-toggle { + color: #fff; + background-color: #1d2124; + border-color: #171a1d; +} +.btn-dark:not(:disabled):not(.disabled):active:focus, .btn-dark:not(:disabled):not(.disabled).active:focus, .show > .btn-dark.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); + box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); +} + +.btn-outline-primary { + color: #007bff; + background-color: transparent; + background-image: none; + border-color: #007bff; +} +.btn-outline-primary:hover { + color: #fff; + background-color: #007bff; + border-color: #007bff; +} +.btn-outline-primary:focus, .btn-outline-primary.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); +} +.btn-outline-primary.disabled, .btn-outline-primary:disabled { + color: #007bff; + background-color: transparent; +} +.btn-outline-primary:not(:disabled):not(.disabled):active, .btn-outline-primary:not(:disabled):not(.disabled).active, .show > .btn-outline-primary.dropdown-toggle { + color: #fff; + background-color: #007bff; + border-color: #007bff; +} +.btn-outline-primary:not(:disabled):not(.disabled):active:focus, .btn-outline-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-primary.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); +} + +.btn-outline-secondary { + color: #6c757d; + background-color: transparent; + background-image: none; + border-color: #6c757d; +} +.btn-outline-secondary:hover { + color: #fff; + background-color: #6c757d; + border-color: #6c757d; +} +.btn-outline-secondary:focus, .btn-outline-secondary.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); + box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); +} +.btn-outline-secondary.disabled, .btn-outline-secondary:disabled { + color: #6c757d; + background-color: transparent; +} +.btn-outline-secondary:not(:disabled):not(.disabled):active, .btn-outline-secondary:not(:disabled):not(.disabled).active, .show > .btn-outline-secondary.dropdown-toggle { + color: #fff; + background-color: #6c757d; + border-color: #6c757d; +} +.btn-outline-secondary:not(:disabled):not(.disabled):active:focus, .btn-outline-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-secondary.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); + box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); +} + +.btn-outline-success { + color: #28a745; + background-color: transparent; + background-image: none; + border-color: #28a745; +} +.btn-outline-success:hover { + color: #fff; + background-color: #28a745; + border-color: #28a745; +} +.btn-outline-success:focus, .btn-outline-success.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); + box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); +} +.btn-outline-success.disabled, .btn-outline-success:disabled { + color: #28a745; + background-color: transparent; +} +.btn-outline-success:not(:disabled):not(.disabled):active, .btn-outline-success:not(:disabled):not(.disabled).active, .show > .btn-outline-success.dropdown-toggle { + color: #fff; + background-color: #28a745; + border-color: #28a745; +} +.btn-outline-success:not(:disabled):not(.disabled):active:focus, .btn-outline-success:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-success.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); + box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); +} + +.btn-outline-info { + color: #17a2b8; + background-color: transparent; + background-image: none; + border-color: #17a2b8; +} +.btn-outline-info:hover { + color: #fff; + background-color: #17a2b8; + border-color: #17a2b8; +} +.btn-outline-info:focus, .btn-outline-info.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); + box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); +} +.btn-outline-info.disabled, .btn-outline-info:disabled { + color: #17a2b8; + background-color: transparent; +} +.btn-outline-info:not(:disabled):not(.disabled):active, .btn-outline-info:not(:disabled):not(.disabled).active, .show > .btn-outline-info.dropdown-toggle { + color: #fff; + background-color: #17a2b8; + border-color: #17a2b8; +} +.btn-outline-info:not(:disabled):not(.disabled):active:focus, .btn-outline-info:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-info.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); + box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); +} + +.btn-outline-warning { + color: #ffc107; + background-color: transparent; + background-image: none; + border-color: #ffc107; +} +.btn-outline-warning:hover { + color: #212529; + background-color: #ffc107; + border-color: #ffc107; +} +.btn-outline-warning:focus, .btn-outline-warning.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); + box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); +} +.btn-outline-warning.disabled, .btn-outline-warning:disabled { + color: #ffc107; + background-color: transparent; +} +.btn-outline-warning:not(:disabled):not(.disabled):active, .btn-outline-warning:not(:disabled):not(.disabled).active, .show > .btn-outline-warning.dropdown-toggle { + color: #212529; + background-color: #ffc107; + border-color: #ffc107; +} +.btn-outline-warning:not(:disabled):not(.disabled):active:focus, .btn-outline-warning:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-warning.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); + box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); +} + +.btn-outline-danger { + color: #dc3545; + background-color: transparent; + background-image: none; + border-color: #dc3545; +} +.btn-outline-danger:hover { + color: #fff; + background-color: #dc3545; + border-color: #dc3545; +} +.btn-outline-danger:focus, .btn-outline-danger.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); + box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); +} +.btn-outline-danger.disabled, .btn-outline-danger:disabled { + color: #dc3545; + background-color: transparent; +} +.btn-outline-danger:not(:disabled):not(.disabled):active, .btn-outline-danger:not(:disabled):not(.disabled).active, .show > .btn-outline-danger.dropdown-toggle { + color: #fff; + background-color: #dc3545; + border-color: #dc3545; +} +.btn-outline-danger:not(:disabled):not(.disabled):active:focus, .btn-outline-danger:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-danger.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); + box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); +} + +.btn-outline-light { + color: #f8f9fa; + background-color: transparent; + background-image: none; + border-color: #f8f9fa; +} +.btn-outline-light:hover { + color: #212529; + background-color: #f8f9fa; + border-color: #f8f9fa; +} +.btn-outline-light:focus, .btn-outline-light.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); + box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); +} +.btn-outline-light.disabled, .btn-outline-light:disabled { + color: #f8f9fa; + background-color: transparent; +} +.btn-outline-light:not(:disabled):not(.disabled):active, .btn-outline-light:not(:disabled):not(.disabled).active, .show > .btn-outline-light.dropdown-toggle { + color: #212529; + background-color: #f8f9fa; + border-color: #f8f9fa; +} +.btn-outline-light:not(:disabled):not(.disabled):active:focus, .btn-outline-light:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-light.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); + box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); +} + +.btn-outline-dark { + color: #343a40; + background-color: transparent; + background-image: none; + border-color: #343a40; +} +.btn-outline-dark:hover { + color: #fff; + background-color: #343a40; + border-color: #343a40; +} +.btn-outline-dark:focus, .btn-outline-dark.focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); + box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); +} +.btn-outline-dark.disabled, .btn-outline-dark:disabled { + color: #343a40; + background-color: transparent; +} +.btn-outline-dark:not(:disabled):not(.disabled):active, .btn-outline-dark:not(:disabled):not(.disabled).active, .show > .btn-outline-dark.dropdown-toggle { + color: #fff; + background-color: #343a40; + border-color: #343a40; +} +.btn-outline-dark:not(:disabled):not(.disabled):active:focus, .btn-outline-dark:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-dark.dropdown-toggle:focus { + -webkit-box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); + box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); +} + +.btn-link { + font-weight: 400; + color: #007bff; + background-color: transparent; +} +.btn-link:hover { + color: #0056b3; + text-decoration: underline; + background-color: transparent; + border-color: transparent; +} +.btn-link:focus, .btn-link.focus { + text-decoration: underline; + border-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link:disabled, .btn-link.disabled { + color: #6c757d; +} + +.btn-lg, .btn-group-lg > .btn { + padding: 0.5rem 1rem; + font-size: 1.25rem; + line-height: 1.5; + border-radius: 0.3rem; +} + +.btn-sm, .btn-group-sm > .btn { + padding: 0.25rem 0.5rem; + font-size: 0.875rem; + line-height: 1.5; + border-radius: 0.2rem; +} + +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 0.5rem; +} + +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} + +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.show { + opacity: 1; +} + +.collapse { + display: none; +} +.collapse.show { + display: block; +} + +tr.collapse.show { + display: table-row; +} + +tbody.collapse.show { + display: table-row-group; +} + +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + transition: height 0.35s ease; +} + +.dropup, +.dropdown { + position: relative; +} + +.dropdown-toggle::after { + display: inline-block; + width: 0; + height: 0; + margin-left: 0.255em; + vertical-align: 0.255em; + content: ""; + border-top: 0.3em solid; + border-right: 0.3em solid transparent; + border-bottom: 0; + border-left: 0.3em solid transparent; +} +.dropdown-toggle:empty::after { + margin-left: 0; +} + +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 10rem; + padding: 0.5rem 0; + margin: 0.125rem 0 0; + font-size: 1rem; + color: #212529; + text-align: left; + list-style: none; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0.25rem; +} + +.dropup .dropdown-menu { + margin-top: 0; + margin-bottom: 0.125rem; +} +.dropup .dropdown-toggle::after { + display: inline-block; + width: 0; + height: 0; + margin-left: 0.255em; + vertical-align: 0.255em; + content: ""; + border-top: 0; + border-right: 0.3em solid transparent; + border-bottom: 0.3em solid; + border-left: 0.3em solid transparent; +} +.dropup .dropdown-toggle:empty::after { + margin-left: 0; +} + +.dropright .dropdown-menu { + margin-top: 0; + margin-left: 0.125rem; +} +.dropright .dropdown-toggle::after { + display: inline-block; + width: 0; + height: 0; + margin-left: 0.255em; + vertical-align: 0.255em; + content: ""; + border-top: 0.3em solid transparent; + border-bottom: 0.3em solid transparent; + border-left: 0.3em solid; +} +.dropright .dropdown-toggle:empty::after { + margin-left: 0; +} +.dropright .dropdown-toggle::after { + vertical-align: 0; +} + +.dropleft .dropdown-menu { + margin-top: 0; + margin-right: 0.125rem; +} +.dropleft .dropdown-toggle::after { + display: inline-block; + width: 0; + height: 0; + margin-left: 0.255em; + vertical-align: 0.255em; + content: ""; +} +.dropleft .dropdown-toggle::after { + display: none; +} +.dropleft .dropdown-toggle::before { + display: inline-block; + width: 0; + height: 0; + margin-right: 0.255em; + vertical-align: 0.255em; + content: ""; + border-top: 0.3em solid transparent; + border-right: 0.3em solid; + border-bottom: 0.3em solid transparent; +} +.dropleft .dropdown-toggle:empty::after { + margin-left: 0; +} +.dropleft .dropdown-toggle::before { + vertical-align: 0; +} + +.dropdown-divider { + height: 0; + margin: 0.5rem 0; + overflow: hidden; + border-top: 1px solid #e9ecef; +} + +.dropdown-item { + display: block; + width: 100%; + padding: 0.25rem 1.5rem; + clear: both; + font-weight: 400; + color: #212529; + text-align: inherit; + white-space: nowrap; + background-color: transparent; + border: 0; +} +.dropdown-item:hover, .dropdown-item:focus { + color: #16181b; + text-decoration: none; + background-color: #f8f9fa; +} +.dropdown-item.active, .dropdown-item:active { + color: #fff; + text-decoration: none; + background-color: #007bff; +} +.dropdown-item.disabled, .dropdown-item:disabled { + color: #6c757d; + background-color: transparent; +} + +.dropdown-menu.show { + display: block; +} + +.dropdown-header { + display: block; + padding: 0.5rem 1.5rem; + margin-bottom: 0; + font-size: 0.875rem; + color: #6c757d; + white-space: nowrap; +} + +.btn-group, +.btn-group-vertical { + position: relative; + display: -webkit-inline-box; + display: -ms-inline-flexbox; + display: inline-flex; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + -webkit-box-flex: 0; + -ms-flex: 0 1 auto; + flex: 0 1 auto; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover { + z-index: 1; +} +.btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active, +.btn-group-vertical > .btn:focus, +.btn-group-vertical > .btn:active, +.btn-group-vertical > .btn.active { + z-index: 1; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group, +.btn-group-vertical .btn + .btn, +.btn-group-vertical .btn + .btn-group, +.btn-group-vertical .btn-group + .btn, +.btn-group-vertical .btn-group + .btn-group { + margin-left: -1px; +} + +.btn-toolbar { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; +} +.btn-toolbar .input-group { + width: auto; +} + +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:not(:last-child):not(.dropdown-toggle), +.btn-group > .btn-group:not(:last-child) > .btn { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn:not(:first-child), +.btn-group > .btn-group:not(:first-child) > .btn { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.dropdown-toggle-split { + padding-right: 0.5625rem; + padding-left: 0.5625rem; +} +.dropdown-toggle-split::after { + margin-left: 0; +} + +.btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split { + padding-right: 0.375rem; + padding-left: 0.375rem; +} + +.btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split { + padding-right: 0.75rem; + padding-left: 0.75rem; +} + +.btn-group-vertical { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: start; + -ms-flex-align: start; + align-items: flex-start; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; +} +.btn-group-vertical .btn, +.btn-group-vertical .btn-group { + width: 100%; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:last-child):not(.dropdown-toggle), +.btn-group-vertical > .btn-group:not(:last-child) > .btn { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:not(:first-child), +.btn-group-vertical > .btn-group:not(:first-child) > .btn { + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.btn-group-toggle > .btn, +.btn-group-toggle > .btn-group > .btn { + margin-bottom: 0; +} +.btn-group-toggle > .btn input[type="radio"], +.btn-group-toggle > .btn input[type="checkbox"], +.btn-group-toggle > .btn-group > .btn input[type="radio"], +.btn-group-toggle > .btn-group > .btn input[type="checkbox"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; +} + +.input-group { + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + width: 100%; +} +.input-group > .form-control, +.input-group > .custom-select, +.input-group > .custom-file { + position: relative; + -webkit-box-flex: 1; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + width: 1%; + margin-bottom: 0; +} +.input-group > .form-control:focus, +.input-group > .custom-select:focus, +.input-group > .custom-file:focus { + z-index: 3; +} +.input-group > .form-control + .form-control, +.input-group > .form-control + .custom-select, +.input-group > .form-control + .custom-file, +.input-group > .custom-select + .form-control, +.input-group > .custom-select + .custom-select, +.input-group > .custom-select + .custom-file, +.input-group > .custom-file + .form-control, +.input-group > .custom-file + .custom-select, +.input-group > .custom-file + .custom-file { + margin-left: -1px; +} +.input-group > .form-control:not(:last-child), +.input-group > .custom-select:not(:last-child) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.input-group > .form-control:not(:first-child), +.input-group > .custom-select:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.input-group > .custom-file { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} +.input-group > .custom-file:not(:last-child) .custom-file-label, .input-group > .custom-file:not(:last-child) .custom-file-label::before { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.input-group > .custom-file:not(:first-child) .custom-file-label, .input-group > .custom-file:not(:first-child) .custom-file-label::before { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.input-group-prepend, +.input-group-append { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} +.input-group-prepend .btn, +.input-group-append .btn { + position: relative; + z-index: 2; +} +.input-group-prepend .btn + .btn, +.input-group-prepend .btn + .input-group-text, +.input-group-prepend .input-group-text + .input-group-text, +.input-group-prepend .input-group-text + .btn, +.input-group-append .btn + .btn, +.input-group-append .btn + .input-group-text, +.input-group-append .input-group-text + .input-group-text, +.input-group-append .input-group-text + .btn { + margin-left: -1px; +} + +.input-group-prepend { + margin-right: -1px; +} + +.input-group-append { + margin-left: -1px; +} + +.input-group-text { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + padding: 0.375rem 0.75rem; + margin-bottom: 0; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #495057; + text-align: center; + white-space: nowrap; + background-color: #e9ecef; + border: 1px solid #ced4da; + border-radius: 0.25rem; +} +.input-group-text input[type="radio"], +.input-group-text input[type="checkbox"] { + margin-top: 0; +} + +.input-group > .input-group-prepend > .btn, +.input-group > .input-group-prepend > .input-group-text, +.input-group > .input-group-append:not(:last-child) > .btn, +.input-group > .input-group-append:not(:last-child) > .input-group-text, +.input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group > .input-group-append:last-child > .input-group-text:not(:last-child) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.input-group > .input-group-append > .btn, +.input-group > .input-group-append > .input-group-text, +.input-group > .input-group-prepend:not(:first-child) > .btn, +.input-group > .input-group-prepend:not(:first-child) > .input-group-text, +.input-group > .input-group-prepend:first-child > .btn:not(:first-child), +.input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.custom-control { + position: relative; + display: block; + min-height: 1.5rem; + padding-left: 1.5rem; +} + +.custom-control-inline { + display: -webkit-inline-box; + display: -ms-inline-flexbox; + display: inline-flex; + margin-right: 1rem; +} + +.custom-control-input { + position: absolute; + z-index: -1; + opacity: 0; +} +.custom-control-input:checked ~ .custom-control-label::before { + color: #fff; + background-color: #007bff; +} +.custom-control-input:focus ~ .custom-control-label::before { + -webkit-box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25); + box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25); +} +.custom-control-input:active ~ .custom-control-label::before { + color: #fff; + background-color: #b3d7ff; +} +.custom-control-input:disabled ~ .custom-control-label { + color: #6c757d; +} +.custom-control-input:disabled ~ .custom-control-label::before { + background-color: #e9ecef; +} + +.custom-control-label { + margin-bottom: 0; +} +.custom-control-label::before { + position: absolute; + top: 0.25rem; + left: 0; + display: block; + width: 1rem; + height: 1rem; + pointer-events: none; + content: ""; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-color: #dee2e6; +} +.custom-control-label::after { + position: absolute; + top: 0.25rem; + left: 0; + display: block; + width: 1rem; + height: 1rem; + content: ""; + background-repeat: no-repeat; + background-position: center center; + background-size: 50% 50%; +} + +.custom-checkbox .custom-control-label::before { + border-radius: 0.25rem; +} +.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before { + background-color: #007bff; +} +.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E"); +} +.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before { + background-color: #007bff; +} +.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::after { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E"); +} +.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before { + background-color: rgba(0, 123, 255, 0.5); +} +.custom-checkbox .custom-control-input:disabled:indeterminate ~ .custom-control-label::before { + background-color: rgba(0, 123, 255, 0.5); +} + +.custom-radio .custom-control-label::before { + border-radius: 50%; +} +.custom-radio .custom-control-input:checked ~ .custom-control-label::before { + background-color: #007bff; +} +.custom-radio .custom-control-input:checked ~ .custom-control-label::after { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E"); +} +.custom-radio .custom-control-input:disabled:checked ~ .custom-control-label::before { + background-color: rgba(0, 123, 255, 0.5); +} + +.custom-select { + display: inline-block; + width: 100%; + height: calc(2.25rem + 2px); + padding: 0.375rem 1.75rem 0.375rem 0.75rem; + line-height: 1.5; + color: #495057; + vertical-align: middle; + background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right 0.75rem center; + background-size: 8px 10px; + border: 1px solid #ced4da; + border-radius: 0.25rem; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} +.custom-select:focus { + border-color: #80bdff; + outline: 0; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075), 0 0 5px rgba(128, 189, 255, 0.5); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075), 0 0 5px rgba(128, 189, 255, 0.5); +} +.custom-select:focus::-ms-value { + color: #495057; + background-color: #fff; +} +.custom-select[multiple], .custom-select[size]:not([size="1"]) { + height: auto; + padding-right: 0.75rem; + background-image: none; +} +.custom-select:disabled { + color: #6c757d; + background-color: #e9ecef; +} +.custom-select::-ms-expand { + opacity: 0; +} + +.custom-select-sm { + height: calc(1.8125rem + 2px); + padding-top: 0.375rem; + padding-bottom: 0.375rem; + font-size: 75%; +} + +.custom-select-lg { + height: calc(2.875rem + 2px); + padding-top: 0.375rem; + padding-bottom: 0.375rem; + font-size: 125%; +} + +.custom-file { + position: relative; + display: inline-block; + width: 100%; + height: calc(2.25rem + 2px); + margin-bottom: 0; +} + +.custom-file-input { + position: relative; + z-index: 2; + width: 100%; + height: calc(2.25rem + 2px); + margin: 0; + opacity: 0; +} +.custom-file-input:focus ~ .custom-file-control { + border-color: #80bdff; + -webkit-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); +} +.custom-file-input:focus ~ .custom-file-control::before { + border-color: #80bdff; +} +.custom-file-input:lang(en) ~ .custom-file-label::after { + content: "Browse"; +} + +.custom-file-label { + position: absolute; + top: 0; + right: 0; + left: 0; + z-index: 1; + height: calc(2.25rem + 2px); + padding: 0.375rem 0.75rem; + line-height: 1.5; + color: #495057; + background-color: #fff; + border: 1px solid #ced4da; + border-radius: 0.25rem; +} +.custom-file-label::after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + z-index: 3; + display: block; + height: calc(calc(2.25rem + 2px) - 1px * 2); + padding: 0.375rem 0.75rem; + line-height: 1.5; + color: #495057; + content: "Browse"; + background-color: #e9ecef; + border-left: 1px solid #ced4da; + border-radius: 0 0.25rem 0.25rem 0; +} + +.nav { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + padding-left: 0; + margin-bottom: 0; + list-style: none; +} + +.nav-link { + display: block; + padding: 0.5rem 1rem; +} +.nav-link:hover, .nav-link:focus { + text-decoration: none; +} +.nav-link.disabled { + color: #6c757d; +} + +.nav-tabs { + border-bottom: 1px solid #dee2e6; +} +.nav-tabs .nav-item { + margin-bottom: -1px; +} +.nav-tabs .nav-link { + border: 1px solid transparent; + border-top-left-radius: 0.25rem; + border-top-right-radius: 0.25rem; +} +.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus { + border-color: #e9ecef #e9ecef #dee2e6; +} +.nav-tabs .nav-link.disabled { + color: #6c757d; + background-color: transparent; + border-color: transparent; +} +.nav-tabs .nav-link.active, +.nav-tabs .nav-item.show .nav-link { + color: #495057; + background-color: #fff; + border-color: #dee2e6 #dee2e6 #fff; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.nav-pills .nav-link { + border-radius: 0.25rem; +} +.nav-pills .nav-link.active, +.nav-pills .show > .nav-link { + color: #fff; + background-color: #007bff; +} + +.nav-fill .nav-item { + -webkit-box-flex: 1; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + text-align: center; +} + +.nav-justified .nav-item { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + text-align: center; +} + +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} + +.navbar { + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + padding: 0.5rem 1rem; +} +.navbar > .container, +.navbar > .container-fluid { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.navbar-brand { + display: inline-block; + padding-top: 0.3125rem; + padding-bottom: 0.3125rem; + margin-right: 1rem; + font-size: 1.25rem; + line-height: inherit; + white-space: nowrap; +} +.navbar-brand:hover, .navbar-brand:focus { + text-decoration: none; +} + +.navbar-nav { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + padding-left: 0; + margin-bottom: 0; + list-style: none; +} +.navbar-nav .nav-link { + padding-right: 0; + padding-left: 0; +} +.navbar-nav .dropdown-menu { + position: static; + float: none; +} + +.navbar-text { + display: inline-block; + padding-top: 0.5rem; + padding-bottom: 0.5rem; +} + +.navbar-collapse { + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.navbar-toggler { + padding: 0.25rem 0.75rem; + font-size: 1.25rem; + line-height: 1; + background-color: transparent; + border: 1px solid transparent; + border-radius: 0.25rem; +} +.navbar-toggler:hover, .navbar-toggler:focus { + text-decoration: none; +} +.navbar-toggler:not(:disabled):not(.disabled) { + cursor: pointer; +} + +.navbar-toggler-icon { + display: inline-block; + width: 1.5em; + height: 1.5em; + vertical-align: middle; + content: ""; + background: no-repeat center center; + background-size: 100% 100%; +} + +@media (max-width: 575.98px) { + .navbar-expand-sm > .container, + .navbar-expand-sm > .container-fluid { + padding-right: 0; + padding-left: 0; + } +} +@media (min-width: 576px) { + .navbar-expand-sm { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row nowrap; + flex-flow: row nowrap; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + } + .navbar-expand-sm .navbar-nav { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + } + .navbar-expand-sm .navbar-nav .dropdown-menu { + position: absolute; + } + .navbar-expand-sm .navbar-nav .dropdown-menu-right { + right: 0; + left: auto; + } + .navbar-expand-sm .navbar-nav .nav-link { + padding-right: 0.5rem; + padding-left: 0.5rem; + } + .navbar-expand-sm > .container, + .navbar-expand-sm > .container-fluid { + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + } + .navbar-expand-sm .navbar-collapse { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + -ms-flex-preferred-size: auto; + flex-basis: auto; + } + .navbar-expand-sm .navbar-toggler { + display: none; + } + .navbar-expand-sm .dropup .dropdown-menu { + top: auto; + bottom: 100%; + } +} +@media (max-width: 767.98px) { + .navbar-expand-md > .container, + .navbar-expand-md > .container-fluid { + padding-right: 0; + padding-left: 0; + } +} +@media (min-width: 768px) { + .navbar-expand-md { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row nowrap; + flex-flow: row nowrap; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + } + .navbar-expand-md .navbar-nav { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + } + .navbar-expand-md .navbar-nav .dropdown-menu { + position: absolute; + } + .navbar-expand-md .navbar-nav .dropdown-menu-right { + right: 0; + left: auto; + } + .navbar-expand-md .navbar-nav .nav-link { + padding-right: 0.5rem; + padding-left: 0.5rem; + } + .navbar-expand-md > .container, + .navbar-expand-md > .container-fluid { + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + } + .navbar-expand-md .navbar-collapse { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + -ms-flex-preferred-size: auto; + flex-basis: auto; + } + .navbar-expand-md .navbar-toggler { + display: none; + } + .navbar-expand-md .dropup .dropdown-menu { + top: auto; + bottom: 100%; + } +} +@media (max-width: 991.98px) { + .navbar-expand-lg > .container, + .navbar-expand-lg > .container-fluid { + padding-right: 0; + padding-left: 0; + } +} +@media (min-width: 992px) { + .navbar-expand-lg { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row nowrap; + flex-flow: row nowrap; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + } + .navbar-expand-lg .navbar-nav { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + } + .navbar-expand-lg .navbar-nav .dropdown-menu { + position: absolute; + } + .navbar-expand-lg .navbar-nav .dropdown-menu-right { + right: 0; + left: auto; + } + .navbar-expand-lg .navbar-nav .nav-link { + padding-right: 0.5rem; + padding-left: 0.5rem; + } + .navbar-expand-lg > .container, + .navbar-expand-lg > .container-fluid { + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + } + .navbar-expand-lg .navbar-collapse { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + -ms-flex-preferred-size: auto; + flex-basis: auto; + } + .navbar-expand-lg .navbar-toggler { + display: none; + } + .navbar-expand-lg .dropup .dropdown-menu { + top: auto; + bottom: 100%; + } +} +@media (max-width: 1199.98px) { + .navbar-expand-xl > .container, + .navbar-expand-xl > .container-fluid { + padding-right: 0; + padding-left: 0; + } +} +@media (min-width: 1200px) { + .navbar-expand-xl { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row nowrap; + flex-flow: row nowrap; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + } + .navbar-expand-xl .navbar-nav { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + } + .navbar-expand-xl .navbar-nav .dropdown-menu { + position: absolute; + } + .navbar-expand-xl .navbar-nav .dropdown-menu-right { + right: 0; + left: auto; + } + .navbar-expand-xl .navbar-nav .nav-link { + padding-right: 0.5rem; + padding-left: 0.5rem; + } + .navbar-expand-xl > .container, + .navbar-expand-xl > .container-fluid { + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + } + .navbar-expand-xl .navbar-collapse { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + -ms-flex-preferred-size: auto; + flex-basis: auto; + } + .navbar-expand-xl .navbar-toggler { + display: none; + } + .navbar-expand-xl .dropup .dropdown-menu { + top: auto; + bottom: 100%; + } +} +.navbar-expand { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row nowrap; + flex-flow: row nowrap; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; +} +.navbar-expand > .container, +.navbar-expand > .container-fluid { + padding-right: 0; + padding-left: 0; +} +.navbar-expand .navbar-nav { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; +} +.navbar-expand .navbar-nav .dropdown-menu { + position: absolute; +} +.navbar-expand .navbar-nav .dropdown-menu-right { + right: 0; + left: auto; +} +.navbar-expand .navbar-nav .nav-link { + padding-right: 0.5rem; + padding-left: 0.5rem; +} +.navbar-expand > .container, +.navbar-expand > .container-fluid { + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; +} +.navbar-expand .navbar-collapse { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + -ms-flex-preferred-size: auto; + flex-basis: auto; +} +.navbar-expand .navbar-toggler { + display: none; +} +.navbar-expand .dropup .dropdown-menu { + top: auto; + bottom: 100%; +} + +.navbar-light .navbar-brand { + color: rgba(0, 0, 0, 0.9); +} +.navbar-light .navbar-brand:hover, .navbar-light .navbar-brand:focus { + color: rgba(0, 0, 0, 0.9); +} +.navbar-light .navbar-nav .nav-link { + color: rgba(0, 0, 0, 0.5); +} +.navbar-light .navbar-nav .nav-link:hover, .navbar-light .navbar-nav .nav-link:focus { + color: rgba(0, 0, 0, 0.7); +} +.navbar-light .navbar-nav .nav-link.disabled { + color: rgba(0, 0, 0, 0.3); +} +.navbar-light .navbar-nav .show > .nav-link, +.navbar-light .navbar-nav .active > .nav-link, +.navbar-light .navbar-nav .nav-link.show, +.navbar-light .navbar-nav .nav-link.active { + color: rgba(0, 0, 0, 0.9); +} +.navbar-light .navbar-toggler { + color: rgba(0, 0, 0, 0.5); + border-color: rgba(0, 0, 0, 0.1); +} +.navbar-light .navbar-toggler-icon { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); +} +.navbar-light .navbar-text { + color: rgba(0, 0, 0, 0.5); +} +.navbar-light .navbar-text a { + color: rgba(0, 0, 0, 0.9); +} +.navbar-light .navbar-text a:hover, .navbar-light .navbar-text a:focus { + color: rgba(0, 0, 0, 0.9); +} + +.navbar-dark .navbar-brand { + color: #fff; +} +.navbar-dark .navbar-brand:hover, .navbar-dark .navbar-brand:focus { + color: #fff; +} +.navbar-dark .navbar-nav .nav-link { + color: rgba(255, 255, 255, 0.5); +} +.navbar-dark .navbar-nav .nav-link:hover, .navbar-dark .navbar-nav .nav-link:focus { + color: rgba(255, 255, 255, 0.75); +} +.navbar-dark .navbar-nav .nav-link.disabled { + color: rgba(255, 255, 255, 0.25); +} +.navbar-dark .navbar-nav .show > .nav-link, +.navbar-dark .navbar-nav .active > .nav-link, +.navbar-dark .navbar-nav .nav-link.show, +.navbar-dark .navbar-nav .nav-link.active { + color: #fff; +} +.navbar-dark .navbar-toggler { + color: rgba(255, 255, 255, 0.5); + border-color: rgba(255, 255, 255, 0.1); +} +.navbar-dark .navbar-toggler-icon { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); +} +.navbar-dark .navbar-text { + color: rgba(255, 255, 255, 0.5); +} +.navbar-dark .navbar-text a { + color: #fff; +} +.navbar-dark .navbar-text a:hover, .navbar-dark .navbar-text a:focus { + color: #fff; +} + +.card { + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + min-width: 0; + word-wrap: break-word; + background-color: #fff; + background-clip: border-box; + border: 1px solid rgba(0, 0, 0, 0.125); + border-radius: 0.25rem; +} +.card > hr { + margin-right: 0; + margin-left: 0; +} +.card > .list-group:first-child .list-group-item:first-child { + border-top-left-radius: 0.25rem; + border-top-right-radius: 0.25rem; +} +.card > .list-group:last-child .list-group-item:last-child { + border-bottom-right-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} + +.card-body { + -webkit-box-flex: 1; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + padding: 1.25rem; +} + +.card-title { + margin-bottom: 0.75rem; +} + +.card-subtitle { + margin-top: -0.375rem; + margin-bottom: 0; +} + +.card-text:last-child { + margin-bottom: 0; +} + +.card-link:hover { + text-decoration: none; +} +.card-link + .card-link { + margin-left: 1.25rem; +} + +.card-header { + padding: 0.75rem 1.25rem; + margin-bottom: 0; + background-color: rgba(0, 0, 0, 0.03); + border-bottom: 1px solid rgba(0, 0, 0, 0.125); +} +.card-header:first-child { + border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0; +} +.card-header + .list-group .list-group-item:first-child { + border-top: 0; +} + +.card-footer { + padding: 0.75rem 1.25rem; + background-color: rgba(0, 0, 0, 0.03); + border-top: 1px solid rgba(0, 0, 0, 0.125); +} +.card-footer:last-child { + border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px); +} + +.card-header-tabs { + margin-right: -0.625rem; + margin-bottom: -0.75rem; + margin-left: -0.625rem; + border-bottom: 0; +} + +.card-header-pills { + margin-right: -0.625rem; + margin-left: -0.625rem; +} + +.card-img-overlay { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: 1.25rem; +} + +.card-img { + width: 100%; + border-radius: calc(0.25rem - 1px); +} + +.card-img-top { + width: 100%; + border-top-left-radius: calc(0.25rem - 1px); + border-top-right-radius: calc(0.25rem - 1px); +} + +.card-img-bottom { + width: 100%; + border-bottom-right-radius: calc(0.25rem - 1px); + border-bottom-left-radius: calc(0.25rem - 1px); +} + +.card-deck { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; +} +.card-deck .card { + margin-bottom: 15px; +} +@media (min-width: 576px) { + .card-deck { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + margin-right: -15px; + margin-left: -15px; + } + .card-deck .card { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 1; + -ms-flex: 1 0 0%; + flex: 1 0 0%; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + margin-right: 15px; + margin-bottom: 0; + margin-left: 15px; + } +} + +.card-group { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; +} +.card-group > .card { + margin-bottom: 15px; +} +@media (min-width: 576px) { + .card-group { + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + } + .card-group > .card { + -webkit-box-flex: 1; + -ms-flex: 1 0 0%; + flex: 1 0 0%; + margin-bottom: 0; + } + .card-group > .card + .card { + margin-left: 0; + border-left: 0; + } + .card-group > .card:first-child { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + .card-group > .card:first-child .card-img-top, + .card-group > .card:first-child .card-header { + border-top-right-radius: 0; + } + .card-group > .card:first-child .card-img-bottom, + .card-group > .card:first-child .card-footer { + border-bottom-right-radius: 0; + } + .card-group > .card:last-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + .card-group > .card:last-child .card-img-top, + .card-group > .card:last-child .card-header { + border-top-left-radius: 0; + } + .card-group > .card:last-child .card-img-bottom, + .card-group > .card:last-child .card-footer { + border-bottom-left-radius: 0; + } + .card-group > .card:only-child { + border-radius: 0.25rem; + } + .card-group > .card:only-child .card-img-top, + .card-group > .card:only-child .card-header { + border-top-left-radius: 0.25rem; + border-top-right-radius: 0.25rem; + } + .card-group > .card:only-child .card-img-bottom, + .card-group > .card:only-child .card-footer { + border-bottom-right-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; + } + .card-group > .card:not(:first-child):not(:last-child):not(:only-child) { + border-radius: 0; + } + .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-img-top, + .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom, + .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-header, + .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-footer { + border-radius: 0; + } +} + +.card-columns .card { + margin-bottom: 0.75rem; +} +@media (min-width: 576px) { + .card-columns { + -webkit-column-count: 3; + -moz-column-count: 3; + column-count: 3; + -webkit-column-gap: 1.25rem; + -moz-column-gap: 1.25rem; + column-gap: 1.25rem; + } + .card-columns .card { + display: inline-block; + width: 100%; + } +} + +.breadcrumb { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + padding: 0.75rem 1rem; + margin-bottom: 1rem; + list-style: none; + background-color: #e9ecef; + border-radius: 0.25rem; +} + +.breadcrumb-item + .breadcrumb-item::before { + display: inline-block; + padding-right: 0.5rem; + padding-left: 0.5rem; + color: #6c757d; + content: "/"; +} +.breadcrumb-item + .breadcrumb-item:hover::before { + text-decoration: underline; +} +.breadcrumb-item + .breadcrumb-item:hover::before { + text-decoration: none; +} +.breadcrumb-item.active { + color: #6c757d; +} + +.pagination { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + padding-left: 0; + list-style: none; + border-radius: 0.25rem; +} + +.page-link { + position: relative; + display: block; + padding: 0.5rem 0.75rem; + margin-left: -1px; + line-height: 1.25; + color: #007bff; + background-color: #fff; + border: 1px solid #dee2e6; +} +.page-link:hover { + color: #0056b3; + text-decoration: none; + background-color: #e9ecef; + border-color: #dee2e6; +} +.page-link:focus { + z-index: 2; + outline: 0; + -webkit-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); +} +.page-link:not(:disabled):not(.disabled) { + cursor: pointer; +} + +.page-item:first-child .page-link { + margin-left: 0; + border-top-left-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} +.page-item:last-child .page-link { + border-top-right-radius: 0.25rem; + border-bottom-right-radius: 0.25rem; +} +.page-item.active .page-link { + z-index: 1; + color: #fff; + background-color: #007bff; + border-color: #007bff; +} +.page-item.disabled .page-link { + color: #6c757d; + pointer-events: none; + cursor: auto; + background-color: #fff; + border-color: #dee2e6; +} + +.pagination-lg .page-link { + padding: 0.75rem 1.5rem; + font-size: 1.25rem; + line-height: 1.5; +} +.pagination-lg .page-item:first-child .page-link { + border-top-left-radius: 0.3rem; + border-bottom-left-radius: 0.3rem; +} +.pagination-lg .page-item:last-child .page-link { + border-top-right-radius: 0.3rem; + border-bottom-right-radius: 0.3rem; +} + +.pagination-sm .page-link { + padding: 0.25rem 0.5rem; + font-size: 0.875rem; + line-height: 1.5; +} +.pagination-sm .page-item:first-child .page-link { + border-top-left-radius: 0.2rem; + border-bottom-left-radius: 0.2rem; +} +.pagination-sm .page-item:last-child .page-link { + border-top-right-radius: 0.2rem; + border-bottom-right-radius: 0.2rem; +} + +.badge { + display: inline-block; + padding: 0.25em 0.4em; + font-size: 75%; + font-weight: 700; + line-height: 1; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: 0.25rem; +} +.badge:empty { + display: none; +} + +.btn .badge { + position: relative; + top: -1px; +} + +.badge-pill { + padding-right: 0.6em; + padding-left: 0.6em; + border-radius: 10rem; +} + +.badge-primary { + color: #fff; + background-color: #007bff; +} +.badge-primary[href]:hover, .badge-primary[href]:focus { + color: #fff; + text-decoration: none; + background-color: #0062cc; +} + +.badge-secondary { + color: #fff; + background-color: #6c757d; +} +.badge-secondary[href]:hover, .badge-secondary[href]:focus { + color: #fff; + text-decoration: none; + background-color: #545b62; +} + +.badge-success { + color: #fff; + background-color: #28a745; +} +.badge-success[href]:hover, .badge-success[href]:focus { + color: #fff; + text-decoration: none; + background-color: #1e7e34; +} + +.badge-info { + color: #fff; + background-color: #17a2b8; +} +.badge-info[href]:hover, .badge-info[href]:focus { + color: #fff; + text-decoration: none; + background-color: #117a8b; +} + +.badge-warning { + color: #212529; + background-color: #ffc107; +} +.badge-warning[href]:hover, .badge-warning[href]:focus { + color: #212529; + text-decoration: none; + background-color: #d39e00; +} + +.badge-danger { + color: #fff; + background-color: #dc3545; +} +.badge-danger[href]:hover, .badge-danger[href]:focus { + color: #fff; + text-decoration: none; + background-color: #bd2130; +} + +.badge-light { + color: #212529; + background-color: #f8f9fa; +} +.badge-light[href]:hover, .badge-light[href]:focus { + color: #212529; + text-decoration: none; + background-color: #dae0e5; +} + +.badge-dark { + color: #fff; + background-color: #343a40; +} +.badge-dark[href]:hover, .badge-dark[href]:focus { + color: #fff; + text-decoration: none; + background-color: #1d2124; +} + +.jumbotron { + padding: 2rem 1rem; + margin-bottom: 2rem; + background-color: #e9ecef; + border-radius: 0.3rem; +} +@media (min-width: 576px) { + .jumbotron { + padding: 4rem 2rem; + } +} + +.jumbotron-fluid { + padding-right: 0; + padding-left: 0; + border-radius: 0; +} + +.alert { + position: relative; + padding: 0.75rem 1.25rem; + margin-bottom: 1rem; + border: 1px solid transparent; + border-radius: 0.25rem; +} + +.alert-heading { + color: inherit; +} + +.alert-link { + font-weight: 700; +} + +.alert-dismissible { + padding-right: 4rem; +} +.alert-dismissible .close { + position: absolute; + top: 0; + right: 0; + padding: 0.75rem 1.25rem; + color: inherit; +} + +.alert-primary { + color: #004085; + background-color: #cce5ff; + border-color: #b8daff; +} +.alert-primary hr { + border-top-color: #9fcdff; +} +.alert-primary .alert-link { + color: #002752; +} + +.alert-secondary { + color: #383d41; + background-color: #e2e3e5; + border-color: #d6d8db; +} +.alert-secondary hr { + border-top-color: #c8cbcf; +} +.alert-secondary .alert-link { + color: #202326; +} + +.alert-success { + color: #155724; + background-color: #d4edda; + border-color: #c3e6cb; +} +.alert-success hr { + border-top-color: #b1dfbb; +} +.alert-success .alert-link { + color: #0b2e13; +} + +.alert-info { + color: #0c5460; + background-color: #d1ecf1; + border-color: #bee5eb; +} +.alert-info hr { + border-top-color: #abdde5; +} +.alert-info .alert-link { + color: #062c33; +} + +.alert-warning { + color: #856404; + background-color: #fff3cd; + border-color: #ffeeba; +} +.alert-warning hr { + border-top-color: #ffe8a1; +} +.alert-warning .alert-link { + color: #533f03; +} + +.alert-danger { + color: #721c24; + background-color: #f8d7da; + border-color: #f5c6cb; +} +.alert-danger hr { + border-top-color: #f1b0b7; +} +.alert-danger .alert-link { + color: #491217; +} + +.alert-light { + color: #818182; + background-color: #fefefe; + border-color: #fdfdfe; +} +.alert-light hr { + border-top-color: #ececf6; +} +.alert-light .alert-link { + color: #686868; +} + +.alert-dark { + color: #1b1e21; + background-color: #d6d8d9; + border-color: #c6c8ca; +} +.alert-dark hr { + border-top-color: #b9bbbe; +} +.alert-dark .alert-link { + color: #040505; +} + +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 1rem 0; + } + to { + background-position: 0 0; + } +} + +@keyframes progress-bar-stripes { + from { + background-position: 1rem 0; + } + to { + background-position: 0 0; + } +} +.progress { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + height: 1rem; + overflow: hidden; + font-size: 0.75rem; + background-color: #e9ecef; + border-radius: 0.25rem; +} + +.progress-bar { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + color: #fff; + text-align: center; + background-color: #007bff; + -webkit-transition: width 0.6s ease; + transition: width 0.6s ease; +} + +.progress-bar-striped { + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-size: 1rem 1rem; +} + +.progress-bar-animated { + -webkit-animation: progress-bar-stripes 1s linear infinite; + animation: progress-bar-stripes 1s linear infinite; +} + +.media { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: start; + -ms-flex-align: start; + align-items: flex-start; +} + +.media-body { + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1; +} + +.list-group { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + padding-left: 0; + margin-bottom: 0; +} + +.list-group-item-action { + width: 100%; + color: #495057; + text-align: inherit; +} +.list-group-item-action:hover, .list-group-item-action:focus { + color: #495057; + text-decoration: none; + background-color: #f8f9fa; +} +.list-group-item-action:active { + color: #212529; + background-color: #e9ecef; +} + +.list-group-item { + position: relative; + display: block; + padding: 0.75rem 1.25rem; + margin-bottom: -1px; + background-color: #fff; + border: 1px solid rgba(0, 0, 0, 0.125); +} +.list-group-item:first-child { + border-top-left-radius: 0.25rem; + border-top-right-radius: 0.25rem; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} +.list-group-item:hover, .list-group-item:focus { + z-index: 1; + text-decoration: none; +} +.list-group-item.disabled, .list-group-item:disabled { + color: #6c757d; + background-color: #fff; +} +.list-group-item.active { + z-index: 2; + color: #fff; + background-color: #007bff; + border-color: #007bff; +} + +.list-group-flush .list-group-item { + border-right: 0; + border-left: 0; + border-radius: 0; +} +.list-group-flush:first-child .list-group-item:first-child { + border-top: 0; +} +.list-group-flush:last-child .list-group-item:last-child { + border-bottom: 0; +} + +.list-group-item-primary { + color: #004085; + background-color: #b8daff; +} +.list-group-item-primary.list-group-item-action:hover, .list-group-item-primary.list-group-item-action:focus { + color: #004085; + background-color: #9fcdff; +} +.list-group-item-primary.list-group-item-action.active { + color: #fff; + background-color: #004085; + border-color: #004085; +} + +.list-group-item-secondary { + color: #383d41; + background-color: #d6d8db; +} +.list-group-item-secondary.list-group-item-action:hover, .list-group-item-secondary.list-group-item-action:focus { + color: #383d41; + background-color: #c8cbcf; +} +.list-group-item-secondary.list-group-item-action.active { + color: #fff; + background-color: #383d41; + border-color: #383d41; +} + +.list-group-item-success { + color: #155724; + background-color: #c3e6cb; +} +.list-group-item-success.list-group-item-action:hover, .list-group-item-success.list-group-item-action:focus { + color: #155724; + background-color: #b1dfbb; +} +.list-group-item-success.list-group-item-action.active { + color: #fff; + background-color: #155724; + border-color: #155724; +} + +.list-group-item-info { + color: #0c5460; + background-color: #bee5eb; +} +.list-group-item-info.list-group-item-action:hover, .list-group-item-info.list-group-item-action:focus { + color: #0c5460; + background-color: #abdde5; +} +.list-group-item-info.list-group-item-action.active { + color: #fff; + background-color: #0c5460; + border-color: #0c5460; +} + +.list-group-item-warning { + color: #856404; + background-color: #ffeeba; +} +.list-group-item-warning.list-group-item-action:hover, .list-group-item-warning.list-group-item-action:focus { + color: #856404; + background-color: #ffe8a1; +} +.list-group-item-warning.list-group-item-action.active { + color: #fff; + background-color: #856404; + border-color: #856404; +} + +.list-group-item-danger { + color: #721c24; + background-color: #f5c6cb; +} +.list-group-item-danger.list-group-item-action:hover, .list-group-item-danger.list-group-item-action:focus { + color: #721c24; + background-color: #f1b0b7; +} +.list-group-item-danger.list-group-item-action.active { + color: #fff; + background-color: #721c24; + border-color: #721c24; +} + +.list-group-item-light { + color: #818182; + background-color: #fdfdfe; +} +.list-group-item-light.list-group-item-action:hover, .list-group-item-light.list-group-item-action:focus { + color: #818182; + background-color: #ececf6; +} +.list-group-item-light.list-group-item-action.active { + color: #fff; + background-color: #818182; + border-color: #818182; +} + +.list-group-item-dark { + color: #1b1e21; + background-color: #c6c8ca; +} +.list-group-item-dark.list-group-item-action:hover, .list-group-item-dark.list-group-item-action:focus { + color: #1b1e21; + background-color: #b9bbbe; +} +.list-group-item-dark.list-group-item-action.active { + color: #fff; + background-color: #1b1e21; + border-color: #1b1e21; +} + +.close { + float: right; + font-size: 1.5rem; + font-weight: 700; + line-height: 1; + color: #000; + text-shadow: 0 1px 0 #fff; + opacity: .5; +} +.close:hover, .close:focus { + color: #000; + text-decoration: none; + opacity: .75; +} +.close:not(:disabled):not(.disabled) { + cursor: pointer; +} + +button.close { + padding: 0; + background-color: transparent; + border: 0; + -webkit-appearance: none; +} + +.modal-open { + overflow: hidden; +} + +.modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + display: none; + overflow: hidden; + outline: 0; +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} + +.modal-dialog { + position: relative; + width: auto; + margin: 0.5rem; + pointer-events: none; +} +.modal.fade .modal-dialog { + -webkit-transition: -webkit-transform 0.3s ease-out; + transition: -webkit-transform 0.3s ease-out; + transition: transform 0.3s ease-out; + transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out; + -webkit-transform: translate(0, -25%); + transform: translate(0, -25%); +} +.modal.show .modal-dialog { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); +} + +.modal-dialog-centered { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + min-height: calc(100% - (0.5rem * 2)); +} + +.modal-content { + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + width: 100%; + pointer-events: auto; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 0.3rem; + outline: 0; +} + +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000; +} +.modal-backdrop.fade { + opacity: 0; +} +.modal-backdrop.show { + opacity: 0.5; +} + +.modal-header { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: start; + -ms-flex-align: start; + align-items: flex-start; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + padding: 1rem; + border-bottom: 1px solid #e9ecef; + border-top-left-radius: 0.3rem; + border-top-right-radius: 0.3rem; +} +.modal-header .close { + padding: 1rem; + margin: -1rem -1rem -1rem auto; +} + +.modal-title { + margin-bottom: 0; + line-height: 1.5; +} + +.modal-body { + position: relative; + -webkit-box-flex: 1; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + padding: 1rem; +} + +.modal-footer { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + padding: 1rem; + border-top: 1px solid #e9ecef; +} +.modal-footer > :not(:first-child) { + margin-left: .25rem; +} +.modal-footer > :not(:last-child) { + margin-right: .25rem; +} + +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} + +@media (min-width: 576px) { + .modal-dialog { + max-width: 500px; + margin: 1.75rem auto; + } + + .modal-dialog-centered { + min-height: calc(100% - (1.75rem * 2)); + } + + .modal-sm { + max-width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + max-width: 800px; + } +} +.tooltip { + position: absolute; + z-index: 1070; + display: block; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-style: normal; + font-weight: 400; + line-height: 1.5; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + white-space: normal; + line-break: auto; + font-size: 0.875rem; + word-wrap: break-word; + opacity: 0; +} +.tooltip.show { + opacity: 0.9; +} +.tooltip .arrow { + position: absolute; + display: block; + width: 0.8rem; + height: 0.4rem; +} +.tooltip .arrow::before { + position: absolute; + content: ""; + border-color: transparent; + border-style: solid; +} + +.bs-tooltip-top, .bs-tooltip-auto[x-placement^="top"] { + padding: 0.4rem 0; +} +.bs-tooltip-top .arrow, .bs-tooltip-auto[x-placement^="top"] .arrow { + bottom: 0; +} +.bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^="top"] .arrow::before { + top: 0; + border-width: 0.4rem 0.4rem 0; + border-top-color: #000; +} + +.bs-tooltip-right, .bs-tooltip-auto[x-placement^="right"] { + padding: 0 0.4rem; +} +.bs-tooltip-right .arrow, .bs-tooltip-auto[x-placement^="right"] .arrow { + left: 0; + width: 0.4rem; + height: 0.8rem; +} +.bs-tooltip-right .arrow::before, .bs-tooltip-auto[x-placement^="right"] .arrow::before { + right: 0; + border-width: 0.4rem 0.4rem 0.4rem 0; + border-right-color: #000; +} + +.bs-tooltip-bottom, .bs-tooltip-auto[x-placement^="bottom"] { + padding: 0.4rem 0; +} +.bs-tooltip-bottom .arrow, .bs-tooltip-auto[x-placement^="bottom"] .arrow { + top: 0; +} +.bs-tooltip-bottom .arrow::before, .bs-tooltip-auto[x-placement^="bottom"] .arrow::before { + bottom: 0; + border-width: 0 0.4rem 0.4rem; + border-bottom-color: #000; +} + +.bs-tooltip-left, .bs-tooltip-auto[x-placement^="left"] { + padding: 0 0.4rem; +} +.bs-tooltip-left .arrow, .bs-tooltip-auto[x-placement^="left"] .arrow { + right: 0; + width: 0.4rem; + height: 0.8rem; +} +.bs-tooltip-left .arrow::before, .bs-tooltip-auto[x-placement^="left"] .arrow::before { + left: 0; + border-width: 0.4rem 0 0.4rem 0.4rem; + border-left-color: #000; +} + +.tooltip-inner { + max-width: 200px; + padding: 0.25rem 0.5rem; + color: #fff; + text-align: center; + background-color: #000; + border-radius: 0.25rem; +} + +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: block; + max-width: 276px; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-style: normal; + font-weight: 400; + line-height: 1.5; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + white-space: normal; + line-break: auto; + font-size: 0.875rem; + word-wrap: break-word; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 0.3rem; +} +.popover .arrow { + position: absolute; + display: block; + width: 1rem; + height: 0.5rem; + margin: 0 0.3rem; +} +.popover .arrow::before, .popover .arrow::after { + position: absolute; + display: block; + content: ""; + border-color: transparent; + border-style: solid; +} + +.bs-popover-top, .bs-popover-auto[x-placement^="top"] { + margin-bottom: 0.5rem; +} +.bs-popover-top .arrow, .bs-popover-auto[x-placement^="top"] .arrow { + bottom: calc((0.5rem + 1px) * -1); +} +.bs-popover-top .arrow::before, .bs-popover-auto[x-placement^="top"] .arrow::before, +.bs-popover-top .arrow::after, +.bs-popover-auto[x-placement^="top"] .arrow::after { + border-width: 0.5rem 0.5rem 0; +} +.bs-popover-top .arrow::before, .bs-popover-auto[x-placement^="top"] .arrow::before { + bottom: 0; + border-top-color: rgba(0, 0, 0, 0.25); +} +.bs-popover-top .arrow::after, .bs-popover-auto[x-placement^="top"] .arrow::after { + bottom: 1px; + border-top-color: #fff; +} + +.bs-popover-right, .bs-popover-auto[x-placement^="right"] { + margin-left: 0.5rem; +} +.bs-popover-right .arrow, .bs-popover-auto[x-placement^="right"] .arrow { + left: calc((0.5rem + 1px) * -1); + width: 0.5rem; + height: 1rem; + margin: 0.3rem 0; +} +.bs-popover-right .arrow::before, .bs-popover-auto[x-placement^="right"] .arrow::before, +.bs-popover-right .arrow::after, +.bs-popover-auto[x-placement^="right"] .arrow::after { + border-width: 0.5rem 0.5rem 0.5rem 0; +} +.bs-popover-right .arrow::before, .bs-popover-auto[x-placement^="right"] .arrow::before { + left: 0; + border-right-color: rgba(0, 0, 0, 0.25); +} +.bs-popover-right .arrow::after, .bs-popover-auto[x-placement^="right"] .arrow::after { + left: 1px; + border-right-color: #fff; +} + +.bs-popover-bottom, .bs-popover-auto[x-placement^="bottom"] { + margin-top: 0.5rem; +} +.bs-popover-bottom .arrow, .bs-popover-auto[x-placement^="bottom"] .arrow { + top: calc((0.5rem + 1px) * -1); +} +.bs-popover-bottom .arrow::before, .bs-popover-auto[x-placement^="bottom"] .arrow::before, +.bs-popover-bottom .arrow::after, +.bs-popover-auto[x-placement^="bottom"] .arrow::after { + border-width: 0 0.5rem 0.5rem 0.5rem; +} +.bs-popover-bottom .arrow::before, .bs-popover-auto[x-placement^="bottom"] .arrow::before { + top: 0; + border-bottom-color: rgba(0, 0, 0, 0.25); +} +.bs-popover-bottom .arrow::after, .bs-popover-auto[x-placement^="bottom"] .arrow::after { + top: 1px; + border-bottom-color: #fff; +} +.bs-popover-bottom .popover-header::before, .bs-popover-auto[x-placement^="bottom"] .popover-header::before { + position: absolute; + top: 0; + left: 50%; + display: block; + width: 1rem; + margin-left: -0.5rem; + content: ""; + border-bottom: 1px solid #f7f7f7; +} + +.bs-popover-left, .bs-popover-auto[x-placement^="left"] { + margin-right: 0.5rem; +} +.bs-popover-left .arrow, .bs-popover-auto[x-placement^="left"] .arrow { + right: calc((0.5rem + 1px) * -1); + width: 0.5rem; + height: 1rem; + margin: 0.3rem 0; +} +.bs-popover-left .arrow::before, .bs-popover-auto[x-placement^="left"] .arrow::before, +.bs-popover-left .arrow::after, +.bs-popover-auto[x-placement^="left"] .arrow::after { + border-width: 0.5rem 0 0.5rem 0.5rem; +} +.bs-popover-left .arrow::before, .bs-popover-auto[x-placement^="left"] .arrow::before { + right: 0; + border-left-color: rgba(0, 0, 0, 0.25); +} +.bs-popover-left .arrow::after, .bs-popover-auto[x-placement^="left"] .arrow::after { + right: 1px; + border-left-color: #fff; +} + +.popover-header { + padding: 0.5rem 0.75rem; + margin-bottom: 0; + font-size: 1rem; + color: inherit; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-top-left-radius: calc(0.3rem - 1px); + border-top-right-radius: calc(0.3rem - 1px); +} +.popover-header:empty { + display: none; +} + +.popover-body { + padding: 0.5rem 0.75rem; + color: #212529; +} + +.carousel { + position: relative; +} + +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; +} + +.carousel-item { + position: relative; + display: none; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: 100%; + -webkit-transition: -webkit-transform 0.6s ease; + transition: -webkit-transform 0.6s ease; + transition: transform 0.6s ease; + transition: transform 0.6s ease, -webkit-transform 0.6s ease; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000px; + perspective: 1000px; +} + +.carousel-item.active, +.carousel-item-next, +.carousel-item-prev { + display: block; +} + +.carousel-item-next, +.carousel-item-prev { + position: absolute; + top: 0; +} + +.carousel-item-next.carousel-item-left, +.carousel-item-prev.carousel-item-right { + -webkit-transform: translateX(0); + transform: translateX(0); +} +@supports (transform-style: preserve-3d) { + .carousel-item-next.carousel-item-left, + .carousel-item-prev.carousel-item-right { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +.carousel-item-next, +.active.carousel-item-right { + -webkit-transform: translateX(100%); + transform: translateX(100%); +} +@supports (transform-style: preserve-3d) { + .carousel-item-next, + .active.carousel-item-right { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } +} + +.carousel-item-prev, +.active.carousel-item-left { + -webkit-transform: translateX(-100%); + transform: translateX(-100%); +} +@supports (transform-style: preserve-3d) { + .carousel-item-prev, + .active.carousel-item-left { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } +} + +.carousel-control-prev, +.carousel-control-next { + position: absolute; + top: 0; + bottom: 0; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + width: 15%; + color: #fff; + text-align: center; + opacity: 0.5; +} +.carousel-control-prev:hover, .carousel-control-prev:focus, +.carousel-control-next:hover, +.carousel-control-next:focus { + color: #fff; + text-decoration: none; + outline: 0; + opacity: .9; +} + +.carousel-control-prev { + left: 0; +} + +.carousel-control-next { + right: 0; +} + +.carousel-control-prev-icon, +.carousel-control-next-icon { + display: inline-block; + width: 20px; + height: 20px; + background: transparent no-repeat center center; + background-size: 100% 100%; +} + +.carousel-control-prev-icon { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E"); +} + +.carousel-control-next-icon { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E"); +} + +.carousel-indicators { + position: absolute; + right: 0; + bottom: 10px; + left: 0; + z-index: 15; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + padding-left: 0; + margin-right: 15%; + margin-left: 15%; + list-style: none; +} +.carousel-indicators li { + position: relative; + -webkit-box-flex: 0; + -ms-flex: 0 1 auto; + flex: 0 1 auto; + width: 30px; + height: 3px; + margin-right: 3px; + margin-left: 3px; + text-indent: -999px; + background-color: rgba(255, 255, 255, 0.5); +} +.carousel-indicators li::before { + position: absolute; + top: -10px; + left: 0; + display: inline-block; + width: 100%; + height: 10px; + content: ""; +} +.carousel-indicators li::after { + position: absolute; + bottom: -10px; + left: 0; + display: inline-block; + width: 100%; + height: 10px; + content: ""; +} +.carousel-indicators .active { + background-color: #fff; +} + +.carousel-caption { + position: absolute; + right: 15%; + bottom: 20px; + left: 15%; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #fff; + text-align: center; +} + +.align-baseline { + vertical-align: baseline !important; +} + +.align-top { + vertical-align: top !important; +} + +.align-middle { + vertical-align: middle !important; +} + +.align-bottom { + vertical-align: bottom !important; +} + +.align-text-bottom { + vertical-align: text-bottom !important; +} + +.align-text-top { + vertical-align: text-top !important; +} + +.bg-primary { + background-color: #007bff !important; +} + +a.bg-primary:hover, a.bg-primary:focus, +button.bg-primary:hover, +button.bg-primary:focus { + background-color: #0062cc !important; +} + +.bg-secondary { + background-color: #6c757d !important; +} + +a.bg-secondary:hover, a.bg-secondary:focus, +button.bg-secondary:hover, +button.bg-secondary:focus { + background-color: #545b62 !important; +} + +.bg-success { + background-color: #28a745 !important; +} + +a.bg-success:hover, a.bg-success:focus, +button.bg-success:hover, +button.bg-success:focus { + background-color: #1e7e34 !important; +} + +.bg-info { + background-color: #17a2b8 !important; +} + +a.bg-info:hover, a.bg-info:focus, +button.bg-info:hover, +button.bg-info:focus { + background-color: #117a8b !important; +} + +.bg-warning { + background-color: #ffc107 !important; +} + +a.bg-warning:hover, a.bg-warning:focus, +button.bg-warning:hover, +button.bg-warning:focus { + background-color: #d39e00 !important; +} + +.bg-danger { + background-color: #dc3545 !important; +} + +a.bg-danger:hover, a.bg-danger:focus, +button.bg-danger:hover, +button.bg-danger:focus { + background-color: #bd2130 !important; +} + +.bg-light { + background-color: #f8f9fa !important; +} + +a.bg-light:hover, a.bg-light:focus, +button.bg-light:hover, +button.bg-light:focus { + background-color: #dae0e5 !important; +} + +.bg-dark { + background-color: #343a40 !important; +} + +a.bg-dark:hover, a.bg-dark:focus, +button.bg-dark:hover, +button.bg-dark:focus { + background-color: #1d2124 !important; +} + +.bg-white { + background-color: #fff !important; +} + +.bg-transparent { + background-color: transparent !important; +} + +.border { + border: 1px solid #dee2e6 !important; +} + +.border-top { + border-top: 1px solid #dee2e6 !important; +} + +.border-right { + border-right: 1px solid #dee2e6 !important; +} + +.border-bottom { + border-bottom: 1px solid #dee2e6 !important; +} + +.border-left { + border-left: 1px solid #dee2e6 !important; +} + +.border-0 { + border: 0 !important; +} + +.border-top-0 { + border-top: 0 !important; +} + +.border-right-0 { + border-right: 0 !important; +} + +.border-bottom-0 { + border-bottom: 0 !important; +} + +.border-left-0 { + border-left: 0 !important; +} + +.border-primary { + border-color: #007bff !important; +} + +.border-secondary { + border-color: #6c757d !important; +} + +.border-success { + border-color: #28a745 !important; +} + +.border-info { + border-color: #17a2b8 !important; +} + +.border-warning { + border-color: #ffc107 !important; +} + +.border-danger { + border-color: #dc3545 !important; +} + +.border-light { + border-color: #f8f9fa !important; +} + +.border-dark { + border-color: #343a40 !important; +} + +.border-white { + border-color: #fff !important; +} + +.rounded { + border-radius: 0.25rem !important; +} + +.rounded-top { + border-top-left-radius: 0.25rem !important; + border-top-right-radius: 0.25rem !important; +} + +.rounded-right { + border-top-right-radius: 0.25rem !important; + border-bottom-right-radius: 0.25rem !important; +} + +.rounded-bottom { + border-bottom-right-radius: 0.25rem !important; + border-bottom-left-radius: 0.25rem !important; +} + +.rounded-left { + border-top-left-radius: 0.25rem !important; + border-bottom-left-radius: 0.25rem !important; +} + +.rounded-circle { + border-radius: 50% !important; +} + +.rounded-0 { + border-radius: 0 !important; +} + +.clearfix::after { + display: block; + clear: both; + content: ""; +} + +.d-none { + display: none !important; +} + +.d-inline { + display: inline !important; +} + +.d-inline-block { + display: inline-block !important; +} + +.d-block { + display: block !important; +} + +.d-table { + display: table !important; +} + +.d-table-row { + display: table-row !important; +} + +.d-table-cell { + display: table-cell !important; +} + +.d-flex { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; +} + +.d-inline-flex { + display: -webkit-inline-box !important; + display: -ms-inline-flexbox !important; + display: inline-flex !important; +} + +@media (min-width: 576px) { + .d-sm-none { + display: none !important; + } + + .d-sm-inline { + display: inline !important; + } + + .d-sm-inline-block { + display: inline-block !important; + } + + .d-sm-block { + display: block !important; + } + + .d-sm-table { + display: table !important; + } + + .d-sm-table-row { + display: table-row !important; + } + + .d-sm-table-cell { + display: table-cell !important; + } + + .d-sm-flex { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + } + + .d-sm-inline-flex { + display: -webkit-inline-box !important; + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } +} +@media (min-width: 768px) { + .d-md-none { + display: none !important; + } + + .d-md-inline { + display: inline !important; + } + + .d-md-inline-block { + display: inline-block !important; + } + + .d-md-block { + display: block !important; + } + + .d-md-table { + display: table !important; + } + + .d-md-table-row { + display: table-row !important; + } + + .d-md-table-cell { + display: table-cell !important; + } + + .d-md-flex { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + } + + .d-md-inline-flex { + display: -webkit-inline-box !important; + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } +} +@media (min-width: 992px) { + .d-lg-none { + display: none !important; + } + + .d-lg-inline { + display: inline !important; + } + + .d-lg-inline-block { + display: inline-block !important; + } + + .d-lg-block { + display: block !important; + } + + .d-lg-table { + display: table !important; + } + + .d-lg-table-row { + display: table-row !important; + } + + .d-lg-table-cell { + display: table-cell !important; + } + + .d-lg-flex { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + } + + .d-lg-inline-flex { + display: -webkit-inline-box !important; + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } +} +@media (min-width: 1200px) { + .d-xl-none { + display: none !important; + } + + .d-xl-inline { + display: inline !important; + } + + .d-xl-inline-block { + display: inline-block !important; + } + + .d-xl-block { + display: block !important; + } + + .d-xl-table { + display: table !important; + } + + .d-xl-table-row { + display: table-row !important; + } + + .d-xl-table-cell { + display: table-cell !important; + } + + .d-xl-flex { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + } + + .d-xl-inline-flex { + display: -webkit-inline-box !important; + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } +} +@media print { + .d-print-none { + display: none !important; + } + + .d-print-inline { + display: inline !important; + } + + .d-print-inline-block { + display: inline-block !important; + } + + .d-print-block { + display: block !important; + } + + .d-print-table { + display: table !important; + } + + .d-print-table-row { + display: table-row !important; + } + + .d-print-table-cell { + display: table-cell !important; + } + + .d-print-flex { + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + } + + .d-print-inline-flex { + display: -webkit-inline-box !important; + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } +} +.embed-responsive { + position: relative; + display: block; + width: 100%; + padding: 0; + overflow: hidden; +} +.embed-responsive::before { + display: block; + content: ""; +} +.embed-responsive .embed-responsive-item, +.embed-responsive iframe, +.embed-responsive embed, +.embed-responsive object, +.embed-responsive video { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; +} + +.embed-responsive-21by9::before { + padding-top: 42.8571428571%; +} + +.embed-responsive-16by9::before { + padding-top: 56.25%; +} + +.embed-responsive-4by3::before { + padding-top: 75%; +} + +.embed-responsive-1by1::before { + padding-top: 100%; +} + +.flex-row { + -webkit-box-orient: horizontal !important; + -webkit-box-direction: normal !important; + -ms-flex-direction: row !important; + flex-direction: row !important; +} + +.flex-column { + -webkit-box-orient: vertical !important; + -webkit-box-direction: normal !important; + -ms-flex-direction: column !important; + flex-direction: column !important; +} + +.flex-row-reverse { + -webkit-box-orient: horizontal !important; + -webkit-box-direction: reverse !important; + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; +} + +.flex-column-reverse { + -webkit-box-orient: vertical !important; + -webkit-box-direction: reverse !important; + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; +} + +.flex-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; +} + +.flex-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; +} + +.flex-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; +} + +.justify-content-start { + -webkit-box-pack: start !important; + -ms-flex-pack: start !important; + justify-content: flex-start !important; +} + +.justify-content-end { + -webkit-box-pack: end !important; + -ms-flex-pack: end !important; + justify-content: flex-end !important; +} + +.justify-content-center { + -webkit-box-pack: center !important; + -ms-flex-pack: center !important; + justify-content: center !important; +} + +.justify-content-between { + -webkit-box-pack: justify !important; + -ms-flex-pack: justify !important; + justify-content: space-between !important; +} + +.justify-content-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; +} + +.align-items-start { + -webkit-box-align: start !important; + -ms-flex-align: start !important; + align-items: flex-start !important; +} + +.align-items-end { + -webkit-box-align: end !important; + -ms-flex-align: end !important; + align-items: flex-end !important; +} + +.align-items-center { + -webkit-box-align: center !important; + -ms-flex-align: center !important; + align-items: center !important; +} + +.align-items-baseline { + -webkit-box-align: baseline !important; + -ms-flex-align: baseline !important; + align-items: baseline !important; +} + +.align-items-stretch { + -webkit-box-align: stretch !important; + -ms-flex-align: stretch !important; + align-items: stretch !important; +} + +.align-content-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; +} + +.align-content-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; +} + +.align-content-center { + -ms-flex-line-pack: center !important; + align-content: center !important; +} + +.align-content-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; +} + +.align-content-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; +} + +.align-content-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; +} + +.align-self-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; +} + +.align-self-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; +} + +.align-self-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; +} + +.align-self-center { + -ms-flex-item-align: center !important; + align-self: center !important; +} + +.align-self-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; +} + +.align-self-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; +} + +@media (min-width: 576px) { + .flex-sm-row { + -webkit-box-orient: horizontal !important; + -webkit-box-direction: normal !important; + -ms-flex-direction: row !important; + flex-direction: row !important; + } + + .flex-sm-column { + -webkit-box-orient: vertical !important; + -webkit-box-direction: normal !important; + -ms-flex-direction: column !important; + flex-direction: column !important; + } + + .flex-sm-row-reverse { + -webkit-box-orient: horizontal !important; + -webkit-box-direction: reverse !important; + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + + .flex-sm-column-reverse { + -webkit-box-orient: vertical !important; + -webkit-box-direction: reverse !important; + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + + .flex-sm-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + + .flex-sm-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + + .flex-sm-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + + .justify-content-sm-start { + -webkit-box-pack: start !important; + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + + .justify-content-sm-end { + -webkit-box-pack: end !important; + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + + .justify-content-sm-center { + -webkit-box-pack: center !important; + -ms-flex-pack: center !important; + justify-content: center !important; + } + + .justify-content-sm-between { + -webkit-box-pack: justify !important; + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + + .justify-content-sm-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + + .align-items-sm-start { + -webkit-box-align: start !important; + -ms-flex-align: start !important; + align-items: flex-start !important; + } + + .align-items-sm-end { + -webkit-box-align: end !important; + -ms-flex-align: end !important; + align-items: flex-end !important; + } + + .align-items-sm-center { + -webkit-box-align: center !important; + -ms-flex-align: center !important; + align-items: center !important; + } + + .align-items-sm-baseline { + -webkit-box-align: baseline !important; + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + + .align-items-sm-stretch { + -webkit-box-align: stretch !important; + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + + .align-content-sm-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + + .align-content-sm-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + + .align-content-sm-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + + .align-content-sm-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + + .align-content-sm-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + + .align-content-sm-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + + .align-self-sm-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + + .align-self-sm-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + + .align-self-sm-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + + .align-self-sm-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + + .align-self-sm-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + + .align-self-sm-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} +@media (min-width: 768px) { + .flex-md-row { + -webkit-box-orient: horizontal !important; + -webkit-box-direction: normal !important; + -ms-flex-direction: row !important; + flex-direction: row !important; + } + + .flex-md-column { + -webkit-box-orient: vertical !important; + -webkit-box-direction: normal !important; + -ms-flex-direction: column !important; + flex-direction: column !important; + } + + .flex-md-row-reverse { + -webkit-box-orient: horizontal !important; + -webkit-box-direction: reverse !important; + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + + .flex-md-column-reverse { + -webkit-box-orient: vertical !important; + -webkit-box-direction: reverse !important; + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + + .flex-md-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + + .flex-md-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + + .flex-md-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + + .justify-content-md-start { + -webkit-box-pack: start !important; + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + + .justify-content-md-end { + -webkit-box-pack: end !important; + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + + .justify-content-md-center { + -webkit-box-pack: center !important; + -ms-flex-pack: center !important; + justify-content: center !important; + } + + .justify-content-md-between { + -webkit-box-pack: justify !important; + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + + .justify-content-md-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + + .align-items-md-start { + -webkit-box-align: start !important; + -ms-flex-align: start !important; + align-items: flex-start !important; + } + + .align-items-md-end { + -webkit-box-align: end !important; + -ms-flex-align: end !important; + align-items: flex-end !important; + } + + .align-items-md-center { + -webkit-box-align: center !important; + -ms-flex-align: center !important; + align-items: center !important; + } + + .align-items-md-baseline { + -webkit-box-align: baseline !important; + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + + .align-items-md-stretch { + -webkit-box-align: stretch !important; + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + + .align-content-md-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + + .align-content-md-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + + .align-content-md-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + + .align-content-md-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + + .align-content-md-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + + .align-content-md-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + + .align-self-md-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + + .align-self-md-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + + .align-self-md-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + + .align-self-md-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + + .align-self-md-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + + .align-self-md-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} +@media (min-width: 992px) { + .flex-lg-row { + -webkit-box-orient: horizontal !important; + -webkit-box-direction: normal !important; + -ms-flex-direction: row !important; + flex-direction: row !important; + } + + .flex-lg-column { + -webkit-box-orient: vertical !important; + -webkit-box-direction: normal !important; + -ms-flex-direction: column !important; + flex-direction: column !important; + } + + .flex-lg-row-reverse { + -webkit-box-orient: horizontal !important; + -webkit-box-direction: reverse !important; + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + + .flex-lg-column-reverse { + -webkit-box-orient: vertical !important; + -webkit-box-direction: reverse !important; + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + + .flex-lg-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + + .flex-lg-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + + .flex-lg-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + + .justify-content-lg-start { + -webkit-box-pack: start !important; + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + + .justify-content-lg-end { + -webkit-box-pack: end !important; + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + + .justify-content-lg-center { + -webkit-box-pack: center !important; + -ms-flex-pack: center !important; + justify-content: center !important; + } + + .justify-content-lg-between { + -webkit-box-pack: justify !important; + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + + .justify-content-lg-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + + .align-items-lg-start { + -webkit-box-align: start !important; + -ms-flex-align: start !important; + align-items: flex-start !important; + } + + .align-items-lg-end { + -webkit-box-align: end !important; + -ms-flex-align: end !important; + align-items: flex-end !important; + } + + .align-items-lg-center { + -webkit-box-align: center !important; + -ms-flex-align: center !important; + align-items: center !important; + } + + .align-items-lg-baseline { + -webkit-box-align: baseline !important; + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + + .align-items-lg-stretch { + -webkit-box-align: stretch !important; + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + + .align-content-lg-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + + .align-content-lg-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + + .align-content-lg-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + + .align-content-lg-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + + .align-content-lg-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + + .align-content-lg-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + + .align-self-lg-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + + .align-self-lg-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + + .align-self-lg-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + + .align-self-lg-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + + .align-self-lg-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + + .align-self-lg-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} +@media (min-width: 1200px) { + .flex-xl-row { + -webkit-box-orient: horizontal !important; + -webkit-box-direction: normal !important; + -ms-flex-direction: row !important; + flex-direction: row !important; + } + + .flex-xl-column { + -webkit-box-orient: vertical !important; + -webkit-box-direction: normal !important; + -ms-flex-direction: column !important; + flex-direction: column !important; + } + + .flex-xl-row-reverse { + -webkit-box-orient: horizontal !important; + -webkit-box-direction: reverse !important; + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + + .flex-xl-column-reverse { + -webkit-box-orient: vertical !important; + -webkit-box-direction: reverse !important; + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + + .flex-xl-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + + .flex-xl-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + + .flex-xl-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + + .justify-content-xl-start { + -webkit-box-pack: start !important; + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + + .justify-content-xl-end { + -webkit-box-pack: end !important; + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + + .justify-content-xl-center { + -webkit-box-pack: center !important; + -ms-flex-pack: center !important; + justify-content: center !important; + } + + .justify-content-xl-between { + -webkit-box-pack: justify !important; + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + + .justify-content-xl-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + + .align-items-xl-start { + -webkit-box-align: start !important; + -ms-flex-align: start !important; + align-items: flex-start !important; + } + + .align-items-xl-end { + -webkit-box-align: end !important; + -ms-flex-align: end !important; + align-items: flex-end !important; + } + + .align-items-xl-center { + -webkit-box-align: center !important; + -ms-flex-align: center !important; + align-items: center !important; + } + + .align-items-xl-baseline { + -webkit-box-align: baseline !important; + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + + .align-items-xl-stretch { + -webkit-box-align: stretch !important; + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + + .align-content-xl-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + + .align-content-xl-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + + .align-content-xl-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + + .align-content-xl-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + + .align-content-xl-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + + .align-content-xl-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + + .align-self-xl-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + + .align-self-xl-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + + .align-self-xl-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + + .align-self-xl-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + + .align-self-xl-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + + .align-self-xl-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} +.float-left { + float: left !important; +} + +.float-right { + float: right !important; +} + +.float-none { + float: none !important; +} + +@media (min-width: 576px) { + .float-sm-left { + float: left !important; + } + + .float-sm-right { + float: right !important; + } + + .float-sm-none { + float: none !important; + } +} +@media (min-width: 768px) { + .float-md-left { + float: left !important; + } + + .float-md-right { + float: right !important; + } + + .float-md-none { + float: none !important; + } +} +@media (min-width: 992px) { + .float-lg-left { + float: left !important; + } + + .float-lg-right { + float: right !important; + } + + .float-lg-none { + float: none !important; + } +} +@media (min-width: 1200px) { + .float-xl-left { + float: left !important; + } + + .float-xl-right { + float: right !important; + } + + .float-xl-none { + float: none !important; + } +} +.position-static { + position: static !important; +} + +.position-relative { + position: relative !important; +} + +.position-absolute { + position: absolute !important; +} + +.position-fixed { + position: fixed !important; +} + +.position-sticky { + position: sticky !important; +} + +.fixed-top { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: 1030; +} + +.fixed-bottom { + position: fixed; + right: 0; + bottom: 0; + left: 0; + z-index: 1030; +} + +@supports (position: sticky) { + .sticky-top { + position: sticky; + top: 0; + z-index: 1020; + } +} + +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + -webkit-clip-path: inset(50%); + clip-path: inset(50%); + border: 0; +} + +.sr-only-focusable:active, .sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + overflow: visible; + clip: auto; + white-space: normal; + -webkit-clip-path: none; + clip-path: none; +} + +.w-25 { + width: 25% !important; +} + +.w-50 { + width: 50% !important; +} + +.w-75 { + width: 75% !important; +} + +.w-100 { + width: 100% !important; +} + +.h-25 { + height: 25% !important; +} + +.h-50 { + height: 50% !important; +} + +.h-75 { + height: 75% !important; +} + +.h-100 { + height: 100% !important; +} + +.mw-100 { + max-width: 100% !important; +} + +.mh-100 { + max-height: 100% !important; +} + +.m-0 { + margin: 0 !important; +} + +.mt-0, +.my-0 { + margin-top: 0 !important; +} + +.mr-0, +.mx-0 { + margin-right: 0 !important; +} + +.mb-0, +.my-0 { + margin-bottom: 0 !important; +} + +.ml-0, +.mx-0 { + margin-left: 0 !important; +} + +.m-1 { + margin: 0.25rem !important; +} + +.mt-1, +.my-1 { + margin-top: 0.25rem !important; +} + +.mr-1, +.mx-1 { + margin-right: 0.25rem !important; +} + +.mb-1, +.my-1 { + margin-bottom: 0.25rem !important; +} + +.ml-1, +.mx-1 { + margin-left: 0.25rem !important; +} + +.m-2 { + margin: 0.5rem !important; +} + +.mt-2, +.my-2 { + margin-top: 0.5rem !important; +} + +.mr-2, +.mx-2 { + margin-right: 0.5rem !important; +} + +.mb-2, +.my-2 { + margin-bottom: 0.5rem !important; +} + +.ml-2, +.mx-2 { + margin-left: 0.5rem !important; +} + +.m-3 { + margin: 1rem !important; +} + +.mt-3, +.my-3 { + margin-top: 1rem !important; +} + +.mr-3, +.mx-3 { + margin-right: 1rem !important; +} + +.mb-3, +.my-3 { + margin-bottom: 1rem !important; +} + +.ml-3, +.mx-3 { + margin-left: 1rem !important; +} + +.m-4 { + margin: 1.5rem !important; +} + +.mt-4, +.my-4 { + margin-top: 1.5rem !important; +} + +.mr-4, +.mx-4 { + margin-right: 1.5rem !important; +} + +.mb-4, +.my-4 { + margin-bottom: 1.5rem !important; +} + +.ml-4, +.mx-4 { + margin-left: 1.5rem !important; +} + +.m-5 { + margin: 3rem !important; +} + +.mt-5, +.my-5 { + margin-top: 3rem !important; +} + +.mr-5, +.mx-5 { + margin-right: 3rem !important; +} + +.mb-5, +.my-5 { + margin-bottom: 3rem !important; +} + +.ml-5, +.mx-5 { + margin-left: 3rem !important; +} + +.p-0 { + padding: 0 !important; +} + +.pt-0, +.py-0 { + padding-top: 0 !important; +} + +.pr-0, +.px-0 { + padding-right: 0 !important; +} + +.pb-0, +.py-0 { + padding-bottom: 0 !important; +} + +.pl-0, +.px-0 { + padding-left: 0 !important; +} + +.p-1 { + padding: 0.25rem !important; +} + +.pt-1, +.py-1 { + padding-top: 0.25rem !important; +} + +.pr-1, +.px-1 { + padding-right: 0.25rem !important; +} + +.pb-1, +.py-1 { + padding-bottom: 0.25rem !important; +} + +.pl-1, +.px-1 { + padding-left: 0.25rem !important; +} + +.p-2 { + padding: 0.5rem !important; +} + +.pt-2, +.py-2 { + padding-top: 0.5rem !important; +} + +.pr-2, +.px-2 { + padding-right: 0.5rem !important; +} + +.pb-2, +.py-2 { + padding-bottom: 0.5rem !important; +} + +.pl-2, +.px-2 { + padding-left: 0.5rem !important; +} + +.p-3 { + padding: 1rem !important; +} + +.pt-3, +.py-3 { + padding-top: 1rem !important; +} + +.pr-3, +.px-3 { + padding-right: 1rem !important; +} + +.pb-3, +.py-3 { + padding-bottom: 1rem !important; +} + +.pl-3, +.px-3 { + padding-left: 1rem !important; +} + +.p-4 { + padding: 1.5rem !important; +} + +.pt-4, +.py-4 { + padding-top: 1.5rem !important; +} + +.pr-4, +.px-4 { + padding-right: 1.5rem !important; +} + +.pb-4, +.py-4 { + padding-bottom: 1.5rem !important; +} + +.pl-4, +.px-4 { + padding-left: 1.5rem !important; +} + +.p-5 { + padding: 3rem !important; +} + +.pt-5, +.py-5 { + padding-top: 3rem !important; +} + +.pr-5, +.px-5 { + padding-right: 3rem !important; +} + +.pb-5, +.py-5 { + padding-bottom: 3rem !important; +} + +.pl-5, +.px-5 { + padding-left: 3rem !important; +} + +.m-auto { + margin: auto !important; +} + +.mt-auto, +.my-auto { + margin-top: auto !important; +} + +.mr-auto, +.mx-auto { + margin-right: auto !important; +} + +.mb-auto, +.my-auto { + margin-bottom: auto !important; +} + +.ml-auto, +.mx-auto { + margin-left: auto !important; +} + +@media (min-width: 576px) { + .m-sm-0 { + margin: 0 !important; + } + + .mt-sm-0, + .my-sm-0 { + margin-top: 0 !important; + } + + .mr-sm-0, + .mx-sm-0 { + margin-right: 0 !important; + } + + .mb-sm-0, + .my-sm-0 { + margin-bottom: 0 !important; + } + + .ml-sm-0, + .mx-sm-0 { + margin-left: 0 !important; + } + + .m-sm-1 { + margin: 0.25rem !important; + } + + .mt-sm-1, + .my-sm-1 { + margin-top: 0.25rem !important; + } + + .mr-sm-1, + .mx-sm-1 { + margin-right: 0.25rem !important; + } + + .mb-sm-1, + .my-sm-1 { + margin-bottom: 0.25rem !important; + } + + .ml-sm-1, + .mx-sm-1 { + margin-left: 0.25rem !important; + } + + .m-sm-2 { + margin: 0.5rem !important; + } + + .mt-sm-2, + .my-sm-2 { + margin-top: 0.5rem !important; + } + + .mr-sm-2, + .mx-sm-2 { + margin-right: 0.5rem !important; + } + + .mb-sm-2, + .my-sm-2 { + margin-bottom: 0.5rem !important; + } + + .ml-sm-2, + .mx-sm-2 { + margin-left: 0.5rem !important; + } + + .m-sm-3 { + margin: 1rem !important; + } + + .mt-sm-3, + .my-sm-3 { + margin-top: 1rem !important; + } + + .mr-sm-3, + .mx-sm-3 { + margin-right: 1rem !important; + } + + .mb-sm-3, + .my-sm-3 { + margin-bottom: 1rem !important; + } + + .ml-sm-3, + .mx-sm-3 { + margin-left: 1rem !important; + } + + .m-sm-4 { + margin: 1.5rem !important; + } + + .mt-sm-4, + .my-sm-4 { + margin-top: 1.5rem !important; + } + + .mr-sm-4, + .mx-sm-4 { + margin-right: 1.5rem !important; + } + + .mb-sm-4, + .my-sm-4 { + margin-bottom: 1.5rem !important; + } + + .ml-sm-4, + .mx-sm-4 { + margin-left: 1.5rem !important; + } + + .m-sm-5 { + margin: 3rem !important; + } + + .mt-sm-5, + .my-sm-5 { + margin-top: 3rem !important; + } + + .mr-sm-5, + .mx-sm-5 { + margin-right: 3rem !important; + } + + .mb-sm-5, + .my-sm-5 { + margin-bottom: 3rem !important; + } + + .ml-sm-5, + .mx-sm-5 { + margin-left: 3rem !important; + } + + .p-sm-0 { + padding: 0 !important; + } + + .pt-sm-0, + .py-sm-0 { + padding-top: 0 !important; + } + + .pr-sm-0, + .px-sm-0 { + padding-right: 0 !important; + } + + .pb-sm-0, + .py-sm-0 { + padding-bottom: 0 !important; + } + + .pl-sm-0, + .px-sm-0 { + padding-left: 0 !important; + } + + .p-sm-1 { + padding: 0.25rem !important; + } + + .pt-sm-1, + .py-sm-1 { + padding-top: 0.25rem !important; + } + + .pr-sm-1, + .px-sm-1 { + padding-right: 0.25rem !important; + } + + .pb-sm-1, + .py-sm-1 { + padding-bottom: 0.25rem !important; + } + + .pl-sm-1, + .px-sm-1 { + padding-left: 0.25rem !important; + } + + .p-sm-2 { + padding: 0.5rem !important; + } + + .pt-sm-2, + .py-sm-2 { + padding-top: 0.5rem !important; + } + + .pr-sm-2, + .px-sm-2 { + padding-right: 0.5rem !important; + } + + .pb-sm-2, + .py-sm-2 { + padding-bottom: 0.5rem !important; + } + + .pl-sm-2, + .px-sm-2 { + padding-left: 0.5rem !important; + } + + .p-sm-3 { + padding: 1rem !important; + } + + .pt-sm-3, + .py-sm-3 { + padding-top: 1rem !important; + } + + .pr-sm-3, + .px-sm-3 { + padding-right: 1rem !important; + } + + .pb-sm-3, + .py-sm-3 { + padding-bottom: 1rem !important; + } + + .pl-sm-3, + .px-sm-3 { + padding-left: 1rem !important; + } + + .p-sm-4 { + padding: 1.5rem !important; + } + + .pt-sm-4, + .py-sm-4 { + padding-top: 1.5rem !important; + } + + .pr-sm-4, + .px-sm-4 { + padding-right: 1.5rem !important; + } + + .pb-sm-4, + .py-sm-4 { + padding-bottom: 1.5rem !important; + } + + .pl-sm-4, + .px-sm-4 { + padding-left: 1.5rem !important; + } + + .p-sm-5 { + padding: 3rem !important; + } + + .pt-sm-5, + .py-sm-5 { + padding-top: 3rem !important; + } + + .pr-sm-5, + .px-sm-5 { + padding-right: 3rem !important; + } + + .pb-sm-5, + .py-sm-5 { + padding-bottom: 3rem !important; + } + + .pl-sm-5, + .px-sm-5 { + padding-left: 3rem !important; + } + + .m-sm-auto { + margin: auto !important; + } + + .mt-sm-auto, + .my-sm-auto { + margin-top: auto !important; + } + + .mr-sm-auto, + .mx-sm-auto { + margin-right: auto !important; + } + + .mb-sm-auto, + .my-sm-auto { + margin-bottom: auto !important; + } + + .ml-sm-auto, + .mx-sm-auto { + margin-left: auto !important; + } +} +@media (min-width: 768px) { + .m-md-0 { + margin: 0 !important; + } + + .mt-md-0, + .my-md-0 { + margin-top: 0 !important; + } + + .mr-md-0, + .mx-md-0 { + margin-right: 0 !important; + } + + .mb-md-0, + .my-md-0 { + margin-bottom: 0 !important; + } + + .ml-md-0, + .mx-md-0 { + margin-left: 0 !important; + } + + .m-md-1 { + margin: 0.25rem !important; + } + + .mt-md-1, + .my-md-1 { + margin-top: 0.25rem !important; + } + + .mr-md-1, + .mx-md-1 { + margin-right: 0.25rem !important; + } + + .mb-md-1, + .my-md-1 { + margin-bottom: 0.25rem !important; + } + + .ml-md-1, + .mx-md-1 { + margin-left: 0.25rem !important; + } + + .m-md-2 { + margin: 0.5rem !important; + } + + .mt-md-2, + .my-md-2 { + margin-top: 0.5rem !important; + } + + .mr-md-2, + .mx-md-2 { + margin-right: 0.5rem !important; + } + + .mb-md-2, + .my-md-2 { + margin-bottom: 0.5rem !important; + } + + .ml-md-2, + .mx-md-2 { + margin-left: 0.5rem !important; + } + + .m-md-3 { + margin: 1rem !important; + } + + .mt-md-3, + .my-md-3 { + margin-top: 1rem !important; + } + + .mr-md-3, + .mx-md-3 { + margin-right: 1rem !important; + } + + .mb-md-3, + .my-md-3 { + margin-bottom: 1rem !important; + } + + .ml-md-3, + .mx-md-3 { + margin-left: 1rem !important; + } + + .m-md-4 { + margin: 1.5rem !important; + } + + .mt-md-4, + .my-md-4 { + margin-top: 1.5rem !important; + } + + .mr-md-4, + .mx-md-4 { + margin-right: 1.5rem !important; + } + + .mb-md-4, + .my-md-4 { + margin-bottom: 1.5rem !important; + } + + .ml-md-4, + .mx-md-4 { + margin-left: 1.5rem !important; + } + + .m-md-5 { + margin: 3rem !important; + } + + .mt-md-5, + .my-md-5 { + margin-top: 3rem !important; + } + + .mr-md-5, + .mx-md-5 { + margin-right: 3rem !important; + } + + .mb-md-5, + .my-md-5 { + margin-bottom: 3rem !important; + } + + .ml-md-5, + .mx-md-5 { + margin-left: 3rem !important; + } + + .p-md-0 { + padding: 0 !important; + } + + .pt-md-0, + .py-md-0 { + padding-top: 0 !important; + } + + .pr-md-0, + .px-md-0 { + padding-right: 0 !important; + } + + .pb-md-0, + .py-md-0 { + padding-bottom: 0 !important; + } + + .pl-md-0, + .px-md-0 { + padding-left: 0 !important; + } + + .p-md-1 { + padding: 0.25rem !important; + } + + .pt-md-1, + .py-md-1 { + padding-top: 0.25rem !important; + } + + .pr-md-1, + .px-md-1 { + padding-right: 0.25rem !important; + } + + .pb-md-1, + .py-md-1 { + padding-bottom: 0.25rem !important; + } + + .pl-md-1, + .px-md-1 { + padding-left: 0.25rem !important; + } + + .p-md-2 { + padding: 0.5rem !important; + } + + .pt-md-2, + .py-md-2 { + padding-top: 0.5rem !important; + } + + .pr-md-2, + .px-md-2 { + padding-right: 0.5rem !important; + } + + .pb-md-2, + .py-md-2 { + padding-bottom: 0.5rem !important; + } + + .pl-md-2, + .px-md-2 { + padding-left: 0.5rem !important; + } + + .p-md-3 { + padding: 1rem !important; + } + + .pt-md-3, + .py-md-3 { + padding-top: 1rem !important; + } + + .pr-md-3, + .px-md-3 { + padding-right: 1rem !important; + } + + .pb-md-3, + .py-md-3 { + padding-bottom: 1rem !important; + } + + .pl-md-3, + .px-md-3 { + padding-left: 1rem !important; + } + + .p-md-4 { + padding: 1.5rem !important; + } + + .pt-md-4, + .py-md-4 { + padding-top: 1.5rem !important; + } + + .pr-md-4, + .px-md-4 { + padding-right: 1.5rem !important; + } + + .pb-md-4, + .py-md-4 { + padding-bottom: 1.5rem !important; + } + + .pl-md-4, + .px-md-4 { + padding-left: 1.5rem !important; + } + + .p-md-5 { + padding: 3rem !important; + } + + .pt-md-5, + .py-md-5 { + padding-top: 3rem !important; + } + + .pr-md-5, + .px-md-5 { + padding-right: 3rem !important; + } + + .pb-md-5, + .py-md-5 { + padding-bottom: 3rem !important; + } + + .pl-md-5, + .px-md-5 { + padding-left: 3rem !important; + } + + .m-md-auto { + margin: auto !important; + } + + .mt-md-auto, + .my-md-auto { + margin-top: auto !important; + } + + .mr-md-auto, + .mx-md-auto { + margin-right: auto !important; + } + + .mb-md-auto, + .my-md-auto { + margin-bottom: auto !important; + } + + .ml-md-auto, + .mx-md-auto { + margin-left: auto !important; + } +} +@media (min-width: 992px) { + .m-lg-0 { + margin: 0 !important; + } + + .mt-lg-0, + .my-lg-0 { + margin-top: 0 !important; + } + + .mr-lg-0, + .mx-lg-0 { + margin-right: 0 !important; + } + + .mb-lg-0, + .my-lg-0 { + margin-bottom: 0 !important; + } + + .ml-lg-0, + .mx-lg-0 { + margin-left: 0 !important; + } + + .m-lg-1 { + margin: 0.25rem !important; + } + + .mt-lg-1, + .my-lg-1 { + margin-top: 0.25rem !important; + } + + .mr-lg-1, + .mx-lg-1 { + margin-right: 0.25rem !important; + } + + .mb-lg-1, + .my-lg-1 { + margin-bottom: 0.25rem !important; + } + + .ml-lg-1, + .mx-lg-1 { + margin-left: 0.25rem !important; + } + + .m-lg-2 { + margin: 0.5rem !important; + } + + .mt-lg-2, + .my-lg-2 { + margin-top: 0.5rem !important; + } + + .mr-lg-2, + .mx-lg-2 { + margin-right: 0.5rem !important; + } + + .mb-lg-2, + .my-lg-2 { + margin-bottom: 0.5rem !important; + } + + .ml-lg-2, + .mx-lg-2 { + margin-left: 0.5rem !important; + } + + .m-lg-3 { + margin: 1rem !important; + } + + .mt-lg-3, + .my-lg-3 { + margin-top: 1rem !important; + } + + .mr-lg-3, + .mx-lg-3 { + margin-right: 1rem !important; + } + + .mb-lg-3, + .my-lg-3 { + margin-bottom: 1rem !important; + } + + .ml-lg-3, + .mx-lg-3 { + margin-left: 1rem !important; + } + + .m-lg-4 { + margin: 1.5rem !important; + } + + .mt-lg-4, + .my-lg-4 { + margin-top: 1.5rem !important; + } + + .mr-lg-4, + .mx-lg-4 { + margin-right: 1.5rem !important; + } + + .mb-lg-4, + .my-lg-4 { + margin-bottom: 1.5rem !important; + } + + .ml-lg-4, + .mx-lg-4 { + margin-left: 1.5rem !important; + } + + .m-lg-5 { + margin: 3rem !important; + } + + .mt-lg-5, + .my-lg-5 { + margin-top: 3rem !important; + } + + .mr-lg-5, + .mx-lg-5 { + margin-right: 3rem !important; + } + + .mb-lg-5, + .my-lg-5 { + margin-bottom: 3rem !important; + } + + .ml-lg-5, + .mx-lg-5 { + margin-left: 3rem !important; + } + + .p-lg-0 { + padding: 0 !important; + } + + .pt-lg-0, + .py-lg-0 { + padding-top: 0 !important; + } + + .pr-lg-0, + .px-lg-0 { + padding-right: 0 !important; + } + + .pb-lg-0, + .py-lg-0 { + padding-bottom: 0 !important; + } + + .pl-lg-0, + .px-lg-0 { + padding-left: 0 !important; + } + + .p-lg-1 { + padding: 0.25rem !important; + } + + .pt-lg-1, + .py-lg-1 { + padding-top: 0.25rem !important; + } + + .pr-lg-1, + .px-lg-1 { + padding-right: 0.25rem !important; + } + + .pb-lg-1, + .py-lg-1 { + padding-bottom: 0.25rem !important; + } + + .pl-lg-1, + .px-lg-1 { + padding-left: 0.25rem !important; + } + + .p-lg-2 { + padding: 0.5rem !important; + } + + .pt-lg-2, + .py-lg-2 { + padding-top: 0.5rem !important; + } + + .pr-lg-2, + .px-lg-2 { + padding-right: 0.5rem !important; + } + + .pb-lg-2, + .py-lg-2 { + padding-bottom: 0.5rem !important; + } + + .pl-lg-2, + .px-lg-2 { + padding-left: 0.5rem !important; + } + + .p-lg-3 { + padding: 1rem !important; + } + + .pt-lg-3, + .py-lg-3 { + padding-top: 1rem !important; + } + + .pr-lg-3, + .px-lg-3 { + padding-right: 1rem !important; + } + + .pb-lg-3, + .py-lg-3 { + padding-bottom: 1rem !important; + } + + .pl-lg-3, + .px-lg-3 { + padding-left: 1rem !important; + } + + .p-lg-4 { + padding: 1.5rem !important; + } + + .pt-lg-4, + .py-lg-4 { + padding-top: 1.5rem !important; + } + + .pr-lg-4, + .px-lg-4 { + padding-right: 1.5rem !important; + } + + .pb-lg-4, + .py-lg-4 { + padding-bottom: 1.5rem !important; + } + + .pl-lg-4, + .px-lg-4 { + padding-left: 1.5rem !important; + } + + .p-lg-5 { + padding: 3rem !important; + } + + .pt-lg-5, + .py-lg-5 { + padding-top: 3rem !important; + } + + .pr-lg-5, + .px-lg-5 { + padding-right: 3rem !important; + } + + .pb-lg-5, + .py-lg-5 { + padding-bottom: 3rem !important; + } + + .pl-lg-5, + .px-lg-5 { + padding-left: 3rem !important; + } + + .m-lg-auto { + margin: auto !important; + } + + .mt-lg-auto, + .my-lg-auto { + margin-top: auto !important; + } + + .mr-lg-auto, + .mx-lg-auto { + margin-right: auto !important; + } + + .mb-lg-auto, + .my-lg-auto { + margin-bottom: auto !important; + } + + .ml-lg-auto, + .mx-lg-auto { + margin-left: auto !important; + } +} +@media (min-width: 1200px) { + .m-xl-0 { + margin: 0 !important; + } + + .mt-xl-0, + .my-xl-0 { + margin-top: 0 !important; + } + + .mr-xl-0, + .mx-xl-0 { + margin-right: 0 !important; + } + + .mb-xl-0, + .my-xl-0 { + margin-bottom: 0 !important; + } + + .ml-xl-0, + .mx-xl-0 { + margin-left: 0 !important; + } + + .m-xl-1 { + margin: 0.25rem !important; + } + + .mt-xl-1, + .my-xl-1 { + margin-top: 0.25rem !important; + } + + .mr-xl-1, + .mx-xl-1 { + margin-right: 0.25rem !important; + } + + .mb-xl-1, + .my-xl-1 { + margin-bottom: 0.25rem !important; + } + + .ml-xl-1, + .mx-xl-1 { + margin-left: 0.25rem !important; + } + + .m-xl-2 { + margin: 0.5rem !important; + } + + .mt-xl-2, + .my-xl-2 { + margin-top: 0.5rem !important; + } + + .mr-xl-2, + .mx-xl-2 { + margin-right: 0.5rem !important; + } + + .mb-xl-2, + .my-xl-2 { + margin-bottom: 0.5rem !important; + } + + .ml-xl-2, + .mx-xl-2 { + margin-left: 0.5rem !important; + } + + .m-xl-3 { + margin: 1rem !important; + } + + .mt-xl-3, + .my-xl-3 { + margin-top: 1rem !important; + } + + .mr-xl-3, + .mx-xl-3 { + margin-right: 1rem !important; + } + + .mb-xl-3, + .my-xl-3 { + margin-bottom: 1rem !important; + } + + .ml-xl-3, + .mx-xl-3 { + margin-left: 1rem !important; + } + + .m-xl-4 { + margin: 1.5rem !important; + } + + .mt-xl-4, + .my-xl-4 { + margin-top: 1.5rem !important; + } + + .mr-xl-4, + .mx-xl-4 { + margin-right: 1.5rem !important; + } + + .mb-xl-4, + .my-xl-4 { + margin-bottom: 1.5rem !important; + } + + .ml-xl-4, + .mx-xl-4 { + margin-left: 1.5rem !important; + } + + .m-xl-5 { + margin: 3rem !important; + } + + .mt-xl-5, + .my-xl-5 { + margin-top: 3rem !important; + } + + .mr-xl-5, + .mx-xl-5 { + margin-right: 3rem !important; + } + + .mb-xl-5, + .my-xl-5 { + margin-bottom: 3rem !important; + } + + .ml-xl-5, + .mx-xl-5 { + margin-left: 3rem !important; + } + + .p-xl-0 { + padding: 0 !important; + } + + .pt-xl-0, + .py-xl-0 { + padding-top: 0 !important; + } + + .pr-xl-0, + .px-xl-0 { + padding-right: 0 !important; + } + + .pb-xl-0, + .py-xl-0 { + padding-bottom: 0 !important; + } + + .pl-xl-0, + .px-xl-0 { + padding-left: 0 !important; + } + + .p-xl-1 { + padding: 0.25rem !important; + } + + .pt-xl-1, + .py-xl-1 { + padding-top: 0.25rem !important; + } + + .pr-xl-1, + .px-xl-1 { + padding-right: 0.25rem !important; + } + + .pb-xl-1, + .py-xl-1 { + padding-bottom: 0.25rem !important; + } + + .pl-xl-1, + .px-xl-1 { + padding-left: 0.25rem !important; + } + + .p-xl-2 { + padding: 0.5rem !important; + } + + .pt-xl-2, + .py-xl-2 { + padding-top: 0.5rem !important; + } + + .pr-xl-2, + .px-xl-2 { + padding-right: 0.5rem !important; + } + + .pb-xl-2, + .py-xl-2 { + padding-bottom: 0.5rem !important; + } + + .pl-xl-2, + .px-xl-2 { + padding-left: 0.5rem !important; + } + + .p-xl-3 { + padding: 1rem !important; + } + + .pt-xl-3, + .py-xl-3 { + padding-top: 1rem !important; + } + + .pr-xl-3, + .px-xl-3 { + padding-right: 1rem !important; + } + + .pb-xl-3, + .py-xl-3 { + padding-bottom: 1rem !important; + } + + .pl-xl-3, + .px-xl-3 { + padding-left: 1rem !important; + } + + .p-xl-4 { + padding: 1.5rem !important; + } + + .pt-xl-4, + .py-xl-4 { + padding-top: 1.5rem !important; + } + + .pr-xl-4, + .px-xl-4 { + padding-right: 1.5rem !important; + } + + .pb-xl-4, + .py-xl-4 { + padding-bottom: 1.5rem !important; + } + + .pl-xl-4, + .px-xl-4 { + padding-left: 1.5rem !important; + } + + .p-xl-5 { + padding: 3rem !important; + } + + .pt-xl-5, + .py-xl-5 { + padding-top: 3rem !important; + } + + .pr-xl-5, + .px-xl-5 { + padding-right: 3rem !important; + } + + .pb-xl-5, + .py-xl-5 { + padding-bottom: 3rem !important; + } + + .pl-xl-5, + .px-xl-5 { + padding-left: 3rem !important; + } + + .m-xl-auto { + margin: auto !important; + } + + .mt-xl-auto, + .my-xl-auto { + margin-top: auto !important; + } + + .mr-xl-auto, + .mx-xl-auto { + margin-right: auto !important; + } + + .mb-xl-auto, + .my-xl-auto { + margin-bottom: auto !important; + } + + .ml-xl-auto, + .mx-xl-auto { + margin-left: auto !important; + } +} +.text-justify { + text-align: justify !important; +} + +.text-nowrap { + white-space: nowrap !important; +} + +.text-truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.text-left { + text-align: left !important; +} + +.text-right { + text-align: right !important; +} + +.text-center { + text-align: center !important; +} + +@media (min-width: 576px) { + .text-sm-left { + text-align: left !important; + } + + .text-sm-right { + text-align: right !important; + } + + .text-sm-center { + text-align: center !important; + } +} +@media (min-width: 768px) { + .text-md-left { + text-align: left !important; + } + + .text-md-right { + text-align: right !important; + } + + .text-md-center { + text-align: center !important; + } +} +@media (min-width: 992px) { + .text-lg-left { + text-align: left !important; + } + + .text-lg-right { + text-align: right !important; + } + + .text-lg-center { + text-align: center !important; + } +} +@media (min-width: 1200px) { + .text-xl-left { + text-align: left !important; + } + + .text-xl-right { + text-align: right !important; + } + + .text-xl-center { + text-align: center !important; + } +} +.text-lowercase { + text-transform: lowercase !important; +} + +.text-uppercase { + text-transform: uppercase !important; +} + +.text-capitalize { + text-transform: capitalize !important; +} + +.font-weight-light { + font-weight: 300 !important; +} + +.font-weight-normal { + font-weight: 400 !important; +} + +.font-weight-bold { + font-weight: 700 !important; +} + +.font-italic { + font-style: italic !important; +} + +.text-white { + color: #fff !important; +} + +.text-primary { + color: #007bff !important; +} + +a.text-primary:hover, a.text-primary:focus { + color: #0062cc !important; +} + +.text-secondary { + color: #6c757d !important; +} + +a.text-secondary:hover, a.text-secondary:focus { + color: #545b62 !important; +} + +.text-success { + color: #28a745 !important; +} + +a.text-success:hover, a.text-success:focus { + color: #1e7e34 !important; +} + +.text-info { + color: #17a2b8 !important; +} + +a.text-info:hover, a.text-info:focus { + color: #117a8b !important; +} + +.text-warning { + color: #ffc107 !important; +} + +a.text-warning:hover, a.text-warning:focus { + color: #d39e00 !important; +} + +.text-danger { + color: #dc3545 !important; +} + +a.text-danger:hover, a.text-danger:focus { + color: #bd2130 !important; +} + +.text-light { + color: #f8f9fa !important; +} + +a.text-light:hover, a.text-light:focus { + color: #dae0e5 !important; +} + +.text-dark { + color: #343a40 !important; +} + +a.text-dark:hover, a.text-dark:focus { + color: #1d2124 !important; +} + +.text-muted { + color: #6c757d !important; +} + +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} + +.visible { + visibility: visible !important; +} + +.invisible { + visibility: hidden !important; +} + +@media print { + *, + *::before, + *::after { + text-shadow: none !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + } + + a:not(.btn) { + text-decoration: underline; + } + + abbr[title]::after { + content: " (" attr(title) ")"; + } + + pre { + white-space: pre-wrap !important; + } + + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + + thead { + display: table-header-group; + } + + tr, + img { + page-break-inside: avoid; + } + + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + + h2, + h3 { + page-break-after: avoid; + } + + @page { + size: a3; + } + body { + min-width: 992px !important; + } + + .container { + min-width: 992px !important; + } + + .navbar { + display: none; + } + + .badge { + border: 1px solid #000; + } + + .table { + border-collapse: collapse !important; + } + .table td, + .table th { + background-color: #fff !important; + } + + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +/*Github syntax highlighting theme via Rouge*/ +.highlight table td { + padding: 5px; +} + +.highlight table pre { + margin: 0; +} + +.highlight .cm { + color: #999988; + font-style: italic; +} + +.highlight .cp { + color: #999999; + font-weight: bold; +} + +.highlight .c1 { + color: #999988; + font-style: italic; +} + +.highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; +} + +.highlight .c, .highlight .cd { + color: #999988; + font-style: italic; +} + +.highlight .err { + color: #a61717; + background-color: #e3d2d2; +} + +.highlight .gd { + color: #000000; + background-color: #ffdddd; +} + +.highlight .ge { + color: #000000; + font-style: italic; +} + +.highlight .gr { + color: #aa0000; +} + +.highlight .gh { + color: #999999; +} + +.highlight .gi { + color: #000000; + background-color: #ddffdd; +} + +.highlight .go { + color: #888888; +} + +.highlight .gp { + color: #555555; +} + +.highlight .gs { + font-weight: bold; +} + +.highlight .gu { + color: #aaaaaa; +} + +.highlight .gt { + color: #aa0000; +} + +.highlight .kc { + color: #000000; + font-weight: bold; +} + +.highlight .kd { + color: #000000; + font-weight: bold; +} + +.highlight .kn { + color: #000000; + font-weight: bold; +} + +.highlight .kp { + color: #000000; + font-weight: bold; +} + +.highlight .kr { + color: #000000; + font-weight: bold; +} + +.highlight .kt { + color: #445588; + font-weight: bold; +} + +.highlight .k, .highlight .kv { + color: #000000; + font-weight: bold; +} + +.highlight .mf { + color: #009999; +} + +.highlight .mh { + color: #009999; +} + +.highlight .il { + color: #009999; +} + +.highlight .mi { + color: #009999; +} + +.highlight .mo { + color: #009999; +} + +.highlight .m, .highlight .mb, .highlight .mx { + color: #009999; +} + +.highlight .sb { + color: #d14; +} + +.highlight .sc { + color: #d14; +} + +.highlight .sd { + color: #d14; +} + +.highlight .s2 { + color: #d14; +} + +.highlight .se { + color: #d14; +} + +.highlight .sh { + color: #d14; +} + +.highlight .si { + color: #d14; +} + +.highlight .sx { + color: #d14; +} + +.highlight .sr { + color: #009926; +} + +.highlight .s1 { + color: #d14; +} + +.highlight .ss { + color: #990073; +} + +.highlight .s { + color: #d14; +} + +.highlight .na { + color: #008080; +} + +.highlight .bp { + color: #525252; +} + +.highlight .nb { + color: #0086B3; +} + +.highlight .nc { + color: #445588; + font-weight: bold; +} + +.highlight .no { + color: #008080; +} + +.highlight .nd { + color: #3c5d5d; + font-weight: bold; +} + +.highlight .ni { + color: #800080; +} + +.highlight .ne { + color: #990000; + font-weight: bold; +} + +.highlight .nf { + color: #990000; + font-weight: bold; +} + +.highlight .nl { + color: #990000; + font-weight: bold; +} + +.highlight .nn { + color: #555555; +} + +.highlight .nt { + color: #000080; +} + +.highlight .vc { + color: #008080; +} + +.highlight .vg { + color: #008080; +} + +.highlight .vi { + color: #008080; +} + +.highlight .nv { + color: #008080; +} + +.highlight .ow { + color: #000000; + font-weight: bold; +} + +.highlight .o { + color: #000000; + font-weight: bold; +} + +.highlight .n { + color: #000000; + font-weight: bold; +} + +.highlight .p { + color: #000000; + font-weight: bold; +} + +.highlight .w { + color: #bbbbbb; +} + +.highlight { + background-color: #f8f8f8; +} + +@font-face { + font-family: FreightSans; + font-weight: 700; + font-style: normal; + src: url("../fonts/FreightSans/freight-sans-bold.woff2") format("woff2"), url("../fonts/FreightSans/freight-sans-bold.woff") format("woff"); +} +@font-face { + font-family: FreightSans; + font-weight: 700; + font-style: italic; + src: url("../fonts/FreightSans/freight-sans-bold-italic.woff2") format("woff2"), url("../fonts/FreightSans/freight-sans-bold-italic.woff") format("woff"); +} +@font-face { + font-family: FreightSans; + font-weight: 500; + font-style: normal; + src: url("../fonts/FreightSans/freight-sans-medium.woff2") format("woff2"), url("../fonts/FreightSans/freight-sans-medium.woff") format("woff"); +} +@font-face { + font-family: FreightSans; + font-weight: 500; + font-style: italic; + src: url("../fonts/FreightSans/freight-sans-medium-italic.woff2") format("woff2"), url("../fonts/FreightSans/freight-sans-medium-italic.woff") format("woff"); +} +@font-face { + font-family: FreightSans; + font-weight: 100; + font-style: normal; + src: url("../fonts/FreightSans/freight-sans-light.woff2") format("woff2"), url("../fonts/FreightSans/freight-sans-light.woff") format("woff"); +} +@font-face { + font-family: FreightSans; + font-weight: 100; + font-style: italic; + src: url("../fonts/FreightSans/freight-sans-light-italic.woff2") format("woff2"), url("../fonts/FreightSans/freight-sans-light-italic.woff") format("woff"); +} +@font-face { + font-family: FreightSans; + font-weight: 400; + font-style: italic; + src: url("../fonts/FreightSans/freight-sans-book-italic.woff2") format("woff2"), url("../fonts/FreightSans/freight-sans-book-italic.woff") format("woff"); +} +@font-face { + font-family: FreightSans; + font-weight: 400; + font-style: normal; + src: url("../fonts/FreightSans/freight-sans-book.woff2") format("woff2"), url("../fonts/FreightSans/freight-sans-book.woff") format("woff"); +} +@font-face { + font-family: IBMPlexMono; + font-weight: 600; + font-style: normal; + unicode-range: u+0020-007f; + src: local("IBMPlexMono-SemiBold"), url("../fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2") format("woff2"), url("../fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff") format("woff"); +} +@font-face { + font-family: IBMPlexMono; + font-weight: 500; + font-style: normal; + unicode-range: u+0020-007f; + src: local("IBMPlexMono-Medium"), url("../fonts/IBMPlexMono/IBMPlexMono-Medium.woff2") format("woff2"), url("../fonts/IBMPlexMono/IBMPlexMono-Medium.woff") format("woff"); +} +@font-face { + font-family: IBMPlexMono; + font-weight: 400; + font-style: normal; + unicode-range: u+0020-007f; + src: local("IBMPlexMono-Regular"), url("../fonts/IBMPlexMono/IBMPlexMono-Regular.woff2") format("woff2"), url("../fonts/IBMPlexMono/IBMPlexMono-Regular.woff") format("woff"); +} +@font-face { + font-family: IBMPlexMono; + font-weight: 300; + font-style: normal; + unicode-range: u+0020-007f; + src: local("IBMPlexMono-Light"), url("../fonts/IBMPlexMono/IBMPlexMono-Light.woff2") format("woff2"), url("../fonts/IBMPlexMono/IBMPlexMono-Light.woff") format("woff"); +} +@font-face { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + src: url("../fonts/FontAwesome/fontawesome-webfont.eot?v=4.7.0"); + src: url("../fonts/FontAwesome/fontawesome-webfont.eot?#iefix&v=4.7.0") format("embedded-opentype"), url("../fonts/FontAwesome/fontawesome-webfont.woff2?v=4.7.0") format("woff2"), url("../fonts/FontAwesome/fontawesome-webfont.woff?v=4.7.0") format("woff"), url("../fonts/FontAwesome/fontawesome-webfont.ttf?v=4.7.0") format("truetype"), url("../fonts/FontAwesome/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular") format("svg") +} +html { + position: relative; + min-height: 100%; + font-size: 12px; +} +@media screen and (min-width: 768px) { + html { + font-size: 16px; + } +} + +* { + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +body { + font-family: FreightSans, Helvetica Neue, Helvetica, Arial, sans-serif; +} + +a:link, +a:visited, +a:hover { + text-decoration: none; + color: var(--pytorch); +} + +a.with-right-arrow, .btn.with-right-arrow { + padding-right: 1.375rem; + position: relative; + background-image: url("../images/chevron-right-orange.svg"); + background-size: 6px 13px; + background-position: center right 5px; + background-repeat: no-repeat; +} +@media screen and (min-width: 768px) { + a.with-right-arrow, .btn.with-right-arrow { + background-size: 8px 14px; + background-position: center right 12px; + padding-right: 2rem; + } +} + +::-webkit-input-placeholder { + color: var(--pytorch); +} + +::-moz-placeholder { + color: var(--pytorch); +} + +:-ms-input-placeholder { + color: var(--pytorch); +} + +:-moz-placeholder { + color: var(--pytorch); +} + +.email-subscribe-form input.email { + color: var(--pytorch); + border: none; + border-bottom: 1px solid #939393; + width: 100%; + background-color: transparent; + outline: none; + font-size: 1.125rem; + letter-spacing: 0.25px; + line-height: 2.25rem; +} +.email-subscribe-form input[type="submit"] { + position: absolute; + right: 0; + top: 10px; + height: 15px; + width: 15px; + background-image: url("../images/arrow-right-with-tail.svg"); + background-color: transparent; + background-repeat: no-repeat; + background-size: 15px 15px; + background-position: center center; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border: 0; +} + +.email-subscribe-form-fields-wrapper { + position: relative; +} + +.anchorjs-link { + color: #6c6c6d !important; +} +@media screen and (min-width: 768px) { + .anchorjs-link:hover { + color: inherit; + text-decoration: none !important; + } +} + +.sphinx-template-article #table-of-contents { + display: none; +} + +code, kbd, pre, samp { + font-family: IBMPlexMono,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; +} + +pre { + padding: 1.125rem; +} +pre code { + font-size: 0.875rem; +} +pre.highlight { + background-color: #f3f4f7; + line-height: 1.3125rem; +} + +code.highlighter-rouge { + color: #6c6c6d; + background-color: #f3f4f7; + padding: 2px 6px; +} + +a:link code.highlighter-rouge, +a:visited code.highlighter-rouge, +a:hover code.highlighter-rouge { + color: #4974D1; +} + +p code, +h1 code, +h2 code, +h3 code, +h4 code, +h5 code, +h6 code { + font-size: 78.5%; +} + +pre { + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; +} + +.header-holder { + height: 68px; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + left: 0; + margin-left: auto; + margin-right: auto; + position: fixed; + right: 0; + top: 0; + width: 100%; + z-index: 9999; + background-color: #ffffff; + border-bottom: 1px solid #e2e2e2; +} +@media screen and (min-width: 1100px) { + .header-holder { + height: 90px; + } +} + +.header-container { + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} +.header-container:before, .header-container:after { + content: ""; + display: table; +} +.header-container:after { + clear: both; +} +.header-container { + *zoom: 1; +} +@media screen and (min-width: 1100px) { + .header-container { + display: block; + } +} + +.header-logo { + height: 23px; + width: 93px; + background-repeat: no-repeat; + background-size: 93px 23px; + display: block; + float: left; + z-index: 10; +} +@media screen and (min-width: 1100px) { + .header-logo { + background-size: 108px 27px; + position: absolute; + height: 27px; + width: 108px; + top: 4px; + float: none; + } +} + +.main-menu-open-button { + background-image: url("../images/icon-menu-dots.svg"); + background-position: center center; + background-size: 25px 7px; + background-repeat: no-repeat; + width: 25px; + height: 17px; + position: absolute; + right: 0; + top: 4px; +} +@media screen and (min-width: 1100px) { + .main-menu-open-button { + display: none; + } +} + +.header-holder .main-menu { + display: none; +} +@media screen and (min-width: 1100px) { + .header-holder .main-menu { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + } +} +.header-holder .main-menu ul { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + margin: 0; +} +.header-holder .main-menu ul li { + display: inline-block; + margin-right: 40px; + position: relative; +} +.header-holder .main-menu ul li.active:after { + content: "•"; + bottom: -24px; + color: var(--pytorch); + font-size: 1.375rem; + left: 0; + position: absolute; + right: 0; + text-align: center; +} +.header-holder .main-menu ul li.active a { + color: var(--pytorch); +} +.header-holder .main-menu ul li.docs-active:after { + content: "•"; + bottom: -24px; + color: var(--pytorch); + font-size: 1.375rem; + left: -24px; + position: absolute; + right: 0; + text-align: center; +} +.header-holder .main-menu ul li:last-of-type { + margin-right: 0; +} +.header-holder .main-menu ul li a { + color: #ffffff; + font-size: 1.3rem; + letter-spacing: 0; + line-height: 2.125rem; + text-align: center; + text-decoration: none; +} +@media screen and (min-width: 1100px) { + .header-holder .main-menu ul li a:hover { + color: var(--pytorch); + } +} + +.mobile-main-menu { + display: none; +} +.mobile-main-menu.open { + background-color: #262626; + display: block; + height: 100%; + left: 0; + margin-left: auto; + margin-right: auto; + min-height: 100%; + position: fixed; + right: 0; + top: 0; + width: 100%; + z-index: 99999; +} + +.mobile-main-menu .container-fluid { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + height: 68px; + position: relative; +} +.mobile-main-menu .container-fluid:before, .mobile-main-menu .container-fluid:after { + content: ""; + display: table; +} +.mobile-main-menu .container-fluid:after { + clear: both; +} +.mobile-main-menu .container-fluid { + *zoom: 1; +} + +.mobile-main-menu.open ul { + list-style-type: none; + padding: 0; +} +.mobile-main-menu.open ul li a, .mobile-main-menu.open .resources-mobile-menu-title { + font-size: 2rem; + color: #ffffff; + letter-spacing: 0; + line-height: 4rem; + text-decoration: none; +} +.mobile-main-menu.open ul li.active a { + color: var(--pytorch); +} + +.main-menu-close-button { + background-image: url("../images/icon-close.svg"); + background-position: center center; + background-repeat: no-repeat; + background-size: 24px 24px; + height: 24px; + position: absolute; + right: 0; + width: 24px; + top: -4px; +} + +.mobile-main-menu-header-container { + position: relative; +} + +.mobile-main-menu-links-container { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + padding-left: 2.8125rem; + height: 90vh; + margin-top: -25px; + padding-top: 50%; + overflow-y: scroll; +} +.mobile-main-menu-links-container .main-menu { + height: 100vh; +} + +.mobile-main-menu-links-container ul.resources-mobile-menu-items li { + padding-left: 30px; +} +.mobile-main-menu-links-container ul.resources-mobile-menu-items li { + padding-left: 30px; +} +.mobile-main-menu-links-container ul.resources-mobile-menu-items li.active { + padding-left: 15px; +} +.mobile-main-menu-links-container ul.resources-mobile-menu-items li.active a { + color: var(--google-green); +} +.mobile-main-menu-links-container ul.resources-mobile-menu-items li.active:before { + content: "•"; + color: var(--google-green); + font-size: 1.375rem; + text-align: left; + display: inline-block; + width: 13px; +} + +.site-footer { + padding: 2.5rem 0; + width: 100%; + background: #000000; + background-size: 100%; + margin-left: 0; + margin-right: 0; + position: relative; + z-index: 201; +} +@media screen and (min-width: 768px) { + .site-footer { + padding: 5rem 0; + } +} +.site-footer p { + color: #ffffff; +} +.site-footer ul { + list-style-type: none; + padding-left: 0; + margin-bottom: 0; +} +.site-footer ul li { + font-size: 1.125rem; + line-height: 2rem; + color: #A0A0A1; + padding-bottom: 0.375rem; +} +.site-footer ul li.list-title { + padding-bottom: 0.75rem; + color: #ffffff; +} +.site-footer a:link, +.site-footer a:visited { + color: inherit; +} +@media screen and (min-width: 768px) { + .site-footer a:hover { + color: var(--pytorch); + } +} + +.docs-resources { + background-color: #262626; + color: #ffffff; + padding-top: 2.5rem; + padding-bottom: 2.5rem; + position: relative; + z-index: 201; +} +@media screen and (min-width: 768px) { + .docs-resources { + padding-top: 5rem; + padding-bottom: 5rem; + } +} +.docs-resources p { + color: #929292; + font-size: 1.125rem; +} +.docs-resources h2 { + font-size: 1.5rem; + letter-spacing: -0.25px; + text-transform: none; + margin-bottom: 0.25rem; +} +@media screen and (min-width: 768px) { + .docs-resources h2 { + margin-bottom: 1.25rem; + } +} +.docs-resources .col-md-4 { + margin-bottom: 2rem; + text-align: center; +} +@media screen and (min-width: 768px) { + .docs-resources .col-md-4 { + margin-bottom: 0; + } +} +.docs-resources .with-right-arrow { + margin-left: 12px; +} +.docs-resources .with-right-arrow:hover { + background-image: url("../images/chevron-right-white.svg"); +} +.docs-resources p { + font-size: 1rem; + line-height: 1.5rem; + letter-spacing: 0.22px; + color: #939393; + margin-bottom: 0; +} +@media screen and (min-width: 768px) { + .docs-resources p { + margin-bottom: 1.25rem; + } +} +.docs-resources a { + font-size: 1.125rem; + color: var(--pytorch); +} +.docs-resources a:hover { + color: #ffffff; +} + +.footer-container { + position: relative; +} + +@media screen and (min-width: 768px) { + .footer-logo-wrapper { + position: absolute; + top: 0; + left: 30px; + } +} + +.footer-logo { + background-position: center; + background-repeat: no-repeat; + background-size: 20px 24px; + display: block; + height: 24px; + margin-bottom: 2.8125rem; + width: 20px; +} +@media screen and (min-width: 768px) { + .footer-logo { + background-size: 29px 36px; + height: 36px; + margin-bottom: 0; + margin-bottom: 0; + width: 29px; + } +} + +.footer-links-wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} +@media screen and (min-width: 768px) { + .footer-links-wrapper { + -ms-flex-wrap: initial; + flex-wrap: initial; + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + } +} + +.footer-links-col { + margin-bottom: 3.75rem; + width: 50%; +} +@media screen and (min-width: 768px) { + .footer-links-col { + margin-bottom: 0; + width: 14%; + margin-right: 23px; + } + .footer-links-col.follow-us-col { + width: 18%; + margin-right: 0; + } +} +@media (min-width: 768px) and (max-width: 1239px) { + .footer-links-col { + width: 18%; + margin-right: 30px; + } +} + +.footer-social-icons { + margin: 8.5625rem 0 2.5rem 0; +} +.footer-social-icons a { + height: 32px; + width: 32px; + display: inline-block; + background-color: #CCCDD1; + border-radius: 50%; + margin-right: 5px; +} +.footer-social-icons a.facebook { + background-image: url("../images/logo-facebook-dark.svg"); + background-position: center center; + background-size: 9px 18px; + background-repeat: no-repeat; +} +.footer-social-icons a.twitter { + background-image: url("../images/logo-twitter-dark.svg"); + background-position: center center; + background-size: 17px 17px; + background-repeat: no-repeat; +} +.footer-social-icons a.youtube { + background-image: url("../images/logo-youtube-dark.svg"); + background-position: center center; + background-repeat: no-repeat; +} + +.site-footer .mc-field-group { + margin-top: -2px; +} + +article.sphinx-template-article { + max-width: 920px; + margin: 0 auto; +} +article.sphinx-template-article h2, +article.sphinx-template-article h3, +article.sphinx-template-article h4, +article.sphinx-template-article h5, +article.sphinx-template-article h6 { + margin: 1.375rem 0; + color: #262626; +} +article.sphinx-template-article h2 { + font-size: 1.625rem; + letter-spacing: 1.33px; + line-height: 2rem; + text-transform: none; +} +article.sphinx-template-article h3 { + font-size: 1.5rem; + letter-spacing: -0.25px; + line-height: 1.875rem; + text-transform: none; +} +article.sphinx-template-article h4, +article.sphinx-template-article h5, +article.sphinx-template-article h6 { + font-size: 1.125rem; + letter-spacing: -0.19px; + line-height: 1.875rem; +} +article.sphinx-template-article p { + margin-bottom: 1.125rem; +} +article.sphinx-template-article p, +article.sphinx-template-article ul li, +article.sphinx-template-article ol li, +article.sphinx-template-article dl dt, +article.sphinx-template-article dl dd, +article.sphinx-template-article blockquote { + font-size: 1rem; + line-height: 1.375rem; + color: #262626; + letter-spacing: 0.01px; + font-weight: 500; +} +article.sphinx-template-article table { + margin-bottom: 2.5rem; + width: 100%; +} +article.sphinx-template-article table thead { + border-bottom: 1px solid #cacaca; +} +article.sphinx-template-article table th { + padding: 0.625rem; + color: #262626; +} +article.sphinx-template-article table td { + padding: 0.3125rem; +} +article.sphinx-template-article table tr th:first-of-type, +article.sphinx-template-article table tr td:first-of-type { + padding-left: 0; +} +article.sphinx-template-article table.docutils.field-list th.field-name { + padding: 0.3125rem; + padding-left: 0; +} +article.sphinx-template-article table.docutils.field-list td.field-body { + padding: 0.3125rem; +} +article.sphinx-template-article table.docutils.field-list td.field-body p:last-of-type { + margin-bottom: 0; +} +article.sphinx-template-article ul, +article.sphinx-template-article ol { + margin: 1.5rem 0 3.125rem 0; +} +@media screen and (min-width: 768px) { + article.sphinx-template-article ul, + article.sphinx-template-article ol { + padding-left: 6.25rem; + } +} +article.sphinx-template-article ul li, +article.sphinx-template-article ol li { + margin-bottom: 0.625rem; +} +article.sphinx-template-article dl { + margin-bottom: 1.5rem; +} +article.sphinx-template-article dl dt { + margin-bottom: 0.75rem; +} +article.sphinx-template-article pre { + margin-bottom: 2.5rem; +} +article.sphinx-template-article hr { + margin-top: 4.6875rem; + margin-bottom: 4.6875rem; +} +article.sphinx-template-article blockquote { + margin: 0 auto; + margin-bottom: 2.5rem; + width: 65%; +} + +html { + height: 100%; +} +@media screen and (min-width: 768px) { + html { + font-size: 16px; + } +} + +body { + background: #ffffff; + height: 100%; + margin: 0; +} +body.no-scroll { + height: 100%; + overflow: hidden; +} + +p { + margin-top: 0; + margin-bottom: 1.125rem; +} +p a:link, +p a:visited, +p a:hover { + color: var(--pytorch); + text-decoration: none; +} +@media screen and (min-width: 768px) { + p a:hover { + text-decoration: underline; + } +} +p a:link, +p a:visited, +p a:hover { + color: var(--pytorch-red); +} + +.sphinx-template-breadcrumbs li a { + color: var(--pytorch-red); +} + +ul.sphinx-template-breadcrumbs { + padding-left: 0; + list-style-type: none; +} +ul.sphinx-template-breadcrumbs li { + display: inline-block; + font-size: 0.875rem; +} +ul.sphinx-template-breadcrumbs a { + color: var(--pytorch-red); + text-decoration: none; +} + +.table-of-contents-link-wrapper { + display: block; + margin-top: 0; + padding: 1.25rem 1.875rem; + background-color: #f3f4f7; + position: relative; + color: #262626; + font-size: 1.25rem; +} +.table-of-contents-link-wrapper.is-open .toggle-table-of-contents { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); +} +@media screen and (min-width: 1100px) { + .table-of-contents-link-wrapper { + display: none; + } +} + +.toggle-table-of-contents { + background-image: url("../images/chevron-down-grey.svg"); + background-position: center center; + background-repeat: no-repeat; + background-size: 18px 18px; + height: 100%; + position: absolute; + right: 21px; + width: 30px; + top: 0; +} + +.docs-header .main-menu ul li a { + color: #262626; +} +.docs-header .main-menu-open-button { + background-image: url("../images/icon-menu-dots-dark.svg"); +} + +.rst-content footer .rating-hr.hr-top { + margin-bottom: -0.0625rem; +} +.rst-content footer .rating-hr.hr-bottom { + margin-top: -0.0625rem; +} +.rst-content footer .rating-container { + display: -webkit-inline-box; + display: -ms-inline-flexbox; + display: inline-flex; + font-size: 1.125rem; +} +.rst-content footer .rating-container .rating-prompt, .rst-content footer .rating-container .was-helpful-thank-you { + padding: 0.625rem 1.25rem 0.625rem 1.25rem; +} +.rst-content footer .rating-container .was-helpful-thank-you { + display: none; +} +.rst-content footer .rating-container .rating-prompt.yes-link, .rst-content footer .rating-container .rating-prompt.no-link { + color: var(--pytorch); + cursor: pointer; +} +.rst-content footer .rating-container .rating-prompt.yes-link:hover, .rst-content footer .rating-container .rating-prompt.no-link:hover { + background-color: var(--pytorch); + color: #ffffff; +} +.rst-content footer .rating-container .stars-outer { + display: inline-block; + position: relative; + font-family: FontAwesome; + padding: 0.625rem 1.25rem 0.625rem 1.25rem; +} +.rst-content footer .rating-container .stars-outer i { + cursor: pointer; +} +.rst-content footer .rating-container .stars-outer .star-fill { + color: var(--pytorch-red); +} +.rst-content footer div[role="contentinfo"] { + padding-top: 2.5rem; +} +.rst-content footer div[role="contentinfo"] p { + margin-bottom: 0; +} +.rst-content .highlighted { + background: var(--yellow); + box-shadow: 0 0 0 2 var(--yellow); + display: inline; + font-weight: bold; + margin-bottom: 0; +} +.rst-content .style-external-links a.reference.external:after { + font-family: FontAwesome; + content: "\f08e"; + color: var(--readthedoc); + vertical-align: super; + font-size: 60%; + margin: 0 0.2em; +} +.rst-content :not(h1, h2, h3, h4, h5, h6, +.toctree-l1, .toctree-l2, .toctree-l3, .toctree-l4) > a.reference.external code { + color: var(--google-blue); +} +.rst-content :not(h1, h2, h3, h4, h5, h6, +.toctree-l1, .toctree-l2, .toctree-l3, .toctree-l4) > a.reference.internal code { + color: var(--google-green); +} + + +h1 { + font-size: 2rem; + letter-spacing: 1.78px; + line-height: 2.5rem; + text-transform: uppercase; + margin: 1.375rem 0; +} + +code.xref.py.py-attr.docutils.literal.notranslate { + color: #6c6c6d; + background-color: #f3f4f7; + padding: 2px 0px; +} + +pre { + padding: 1.375rem; +} + +.highlight .c1 { + color: #6c6c6d; +} + +/* .headerlink { + color: #0A507A !important; + font-family: FontAwesome; + float: right; + visibility: hidden; + position: absolute; +} +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} */ + + +a:link.has-code code, +a:hover.has-code code, +a:visited.has-code code { + color: #4974D1; + text-decoration: inherit; +} + +.sphinx-template-left-menu code, .sphinx-template-right-menu code, .sphinx-template-breadcrumbs code, +.toctree-l1 code, .toctree-l1 a:link.has-code code, .toctree-l1 a:hover.has-code code, .toctree-l1 a:visited.has-code code, +h1 code, h1 a:link.has-code code, h1 a:hover.has-code code, h1 a:visited.has-code code { + font-family: inherit; + font-size: inherit; + color: inherit; +} + +article.sphinx-template-article ul, +article.sphinx-template-article ol { + padding-left: 1.875rem; + margin: 0; +} +article.sphinx-template-article ul li, +article.sphinx-template-article ol li { + margin: 0; + line-height: 1.75rem; +} +article.sphinx-template-article ul p, +article.sphinx-template-article ol p { + line-height: 1.75rem; + margin-bottom: 0; +} +article.sphinx-template-article ul ul, +article.sphinx-template-article ul ol, +article.sphinx-template-article ol ul, +article.sphinx-template-article ol ol { + margin: 0; +} +article.sphinx-template-article h1, +article.sphinx-template-article h2, +article.sphinx-template-article h3, +article.sphinx-template-article h4, +article.sphinx-template-article h5, +article.sphinx-template-article h6 { + font-weight: normal; +} +article.sphinx-template-article h1 a, +article.sphinx-template-article h2 a, +article.sphinx-template-article h3 a, +article.sphinx-template-article h4 a, +article.sphinx-template-article h5 a, +article.sphinx-template-article h6 a { + color: #262626; +} +article.sphinx-template-article p.caption { + margin-top: 1.25rem; +} + +article.sphinx-template-article h1:first-of-type { + margin-top: 0; +} + +article.sphinx-template-article .sphx-glr-thumbcontainer { + margin: 0; + border: 1px solid #d6d7d8; + border-radius: 0; + width: 45%; + text-align: center; + margin-bottom: 5%; +} +@media screen and (max-width: 1100px) { + article.sphinx-template-article .sphx-glr-thumbcontainer:nth-child(odd) { + margin-left: 0; + margin-right: 2.5%; + } + article.sphinx-template-article .sphx-glr-thumbcontainer:nth-child(even) { + margin-right: 0; + margin-left: 2.5%; + } + article.sphinx-template-article .sphx-glr-thumbcontainer .figure { + width: 40%; + } +} +@media screen and (min-width: 1101px) { + article.sphinx-template-article .sphx-glr-thumbcontainer { + margin-right: 3%; + margin-bottom: 3%; + width: 30%; + } +} +article.sphinx-template-article .sphx-glr-thumbcontainer .caption-text a { + font-size: 1rem; + color: #262626; + letter-spacing: 0; + line-height: 1.5rem; + text-decoration: none; +} +article.sphinx-template-article .sphx-glr-thumbcontainer:hover { + -webkit-box-shadow: none; + box-shadow: none; + border-bottom-color: #ffffff; +} +article.sphinx-template-article .sphx-glr-thumbcontainer:hover .figure:before { + bottom: 100%; +} +article.sphinx-template-article .sphx-glr-thumbcontainer .figure { + width: 80%; +} +article.sphinx-template-article .sphx-glr-thumbcontainer .figure:before { + content: ""; + display: block; + position: absolute; + top: 0; + bottom: 35%; + left: 0; + right: 0; + background: #8A94B3; + opacity: 0.10; +} +article.sphinx-template-article .sphx-glr-thumbcontainer .figure a.reference.internal { + text-align: left; +} +@media screen and (min-width: 768px) { + article.sphinx-template-article .sphx-glr-thumbcontainer:after { + content: ""; + display: block; + width: 0; + height: 1px; + position: absolute; + bottom: 0; + left: 0; + background-color: var(--pytorch); + -webkit-transition: width .250s ease-in-out; + transition: width .250s ease-in-out; + } + article.sphinx-template-article .sphx-glr-thumbcontainer:hover:after { + width: 100%; + } +} +@media screen and (min-width: 768px) { + article.sphinx-template-article .sphx-glr-thumbcontainer:after { + background-color: var(--pytorch-red); + } +} + +article.sphinx-template-article section :not(dt) > code { + color: #262626; + border-top: 2px; + border-bottom: 2px; + padding: 0px 3px; + -webkit-box-decoration-break: clone; + box-decoration-break: clone; +} +article.sphinx-template-article section :not(dt) > code .pre { + outline: 0px; + padding: 0px; +} +article.sphinx-template-article .py.function dt, article.sphinx-template-article .attribute dt, article.sphinx-template-article .class .attribute dt, article.sphinx-template-article .class dt { + position: relative; + background: #f3f4f7; + padding: 0.5rem; + border-left: 3px solid var(--pytorch-red); + word-wrap: break-word; + padding-right: 100px; +} +article.sphinx-template-article .py.function dd dt, article.sphinx-template-article .attribute dd dt { + border-left: 3px solid var(--lightning); +} +article.sphinx-template-article .class .attribute dd dt, article.sphinx-template-article .class dd dt { + border-top: 3px solid var(--lightning); +} +article.sphinx-template-article .py.function dt em.property, article.sphinx-template-article .attribute dt em.property, article.sphinx-template-article .class dt em.property { + font-family: inherit; +} +article.sphinx-template-article .py.function dt em, article.sphinx-template-article .attribute dt em, article.sphinx-template-article .class .attribute dt em, article.sphinx-template-article .class dt em, article.sphinx-template-article .py.function dt .sig-paren, article.sphinx-template-article .attribute dt .sig-paren, article.sphinx-template-article .class dt .sig-paren { + font-family: IBMPlexMono,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; + font-size: 87.5%; +} +article.sphinx-template-article .py.function dt a, article.sphinx-template-article .attribute dt a, article.sphinx-template-article .class .attribute dt a, article.sphinx-template-article .class dt a { + right: 30px; + padding-right: 0; + top: 50%; + -webkit-transform: perspective(1px) translateY(-50%); + transform: perspective(1px) translateY(-50%); +} +article.sphinx-template-article .py.function dt:hover .viewcode-link, article.sphinx-template-article .attribute dt:hover .viewcode-link, article.sphinx-template-article .class dt:hover .viewcode-link { + color: var(--pytorch-red); +} +article.sphinx-template-article .py.function .anchorjs-link, article.sphinx-template-article .attribute .anchorjs-link, article.sphinx-template-article .class .anchorjs-link { + display: inline; + position: absolute; + right: 8px; + font-size: 1.5625rem !important; + padding-left: 0; +} +article.sphinx-template-article .py.function dt > code, article.sphinx-template-article .attribute dt > code, article.sphinx-template-article .class .attribute dt > code, article.sphinx-template-article .class dt > code { + color: #262626; + border-top: solid 2px #f3f4f7; + background-color: #f3f4f7; + border-bottom: solid 2px #f3f4f7; + -webkit-box-decoration-break: clone; + box-decoration-break: clone; +} +article.sphinx-template-article .py.function .viewcode-link, article.sphinx-template-article .attribute .viewcode-link, article.sphinx-template-article .class .viewcode-link { + padding-left: 0.6rem; + position: absolute; + font-size: 0.875rem; + color: #979797; + letter-spacing: 0; + line-height: 1.5rem; + text-transform: uppercase; +} +article.sphinx-template-article .py.function dd, article.sphinx-template-article .attribute dd, article.sphinx-template-article .class .attribute dd, article.sphinx-template-article .class dd { + padding-left: 3.75rem; +} +article.sphinx-template-article .py.function table tbody tr th.field-name, article.sphinx-template-article .attribute table tbody tr th.field-name, article.sphinx-template-article .class table tbody tr th.field-name { + white-space: nowrap; + color: #262626; + width: 20%; +} +@media screen and (min-width: 768px) { + article.sphinx-template-article .py.function table tbody tr th.field-name, article.sphinx-template-article .attribute table tbody tr th.field-name, article.sphinx-template-article .class table tbody tr th.field-name { + width: 15%; + } +} +article.sphinx-template-article .py.function table tbody tr td.field-body, article.sphinx-template-article .attribute table tbody tr td.field-body, article.sphinx-template-article .class table tbody tr td.field-body { + padding: 0.625rem; + width: 80%; + color: #262626; +} +@media screen and (min-width: 768px) { + article.sphinx-template-article .py.function table tbody tr td.field-body, article.sphinx-template-article .attribute table tbody tr td.field-body, article.sphinx-template-article .class table tbody tr td.field-body { + width: 85%; + } +} +@media screen and (min-width: 1600px) { + article.sphinx-template-article .py.function table tbody tr td.field-body, article.sphinx-template-article .attribute table tbody tr td.field-body, article.sphinx-template-article .class table tbody tr td.field-body { + padding-left: 1.25rem; + } +} +article.sphinx-template-article .py.function table tbody tr td.field-body p, article.sphinx-template-article .attribute table tbody tr td.field-body p, article.sphinx-template-article .class table tbody tr td.field-body p { + padding-left: 0px; +} +article.sphinx-template-article .py.function table tbody tr td.field-body p:last-of-type, article.sphinx-template-article .attribute table tbody tr td.field-body p:last-of-type, article.sphinx-template-article .class table tbody tr td.field-body p:last-of-type { + margin-bottom: 0; +} +article.sphinx-template-article .py.function table tbody tr td.field-body ol, article.sphinx-template-article .attribute table tbody tr td.field-body ol, article.sphinx-template-article .class table tbody tr td.field-body ol, article.sphinx-template-article .py.function table tbody tr td.field-body ul, article.sphinx-template-article .attribute table tbody tr td.field-body ul, article.sphinx-template-article .class table tbody tr td.field-body ul { + padding-left: 1rem; + padding-bottom: 0; +} +article.sphinx-template-article .py.function table.docutils.field-list, article.sphinx-template-article .attribute table.docutils.field-list, article.sphinx-template-article .class table.docutils.field-list { + margin-bottom: 0.75rem; +} +article.sphinx-template-article .attribute .has-code { + float: none; +} +article.sphinx-template-article .class dt { + border-left: none; + border-top: 3px solid var(--pytorch-red); + padding-left: 4em; +} +article.sphinx-template-article .class dt em.property { + position: absolute; + left: 0.5rem; +} +article.sphinx-template-article .class dd .docutils dt { + padding-left: 0.5rem; +} +article.sphinx-template-article .class em.property { + text-transform: uppercase; + font-style: normal; + color: var(--pytorch-red); + font-size: 1rem; + letter-spacing: 0; + padding-right: 0.75rem; +} +article.sphinx-template-article .class dl dt em.property { + position: static; + left: 0; + padding-right: 0; +} +article.sphinx-template-article .class .method dt, +article.sphinx-template-article .class .staticmethod dt { + border-left: 3px solid var(--lightning); + border-top: none; + padding-left: 0.5rem; +} +article.sphinx-template-article .class .method dd dt, +article.sphinx-template-article .class .staticmethod dd dt { + border-left: 3px solid var(--google-green); +} +article.sphinx-template-article .class .attribute dt { + border-top: none; +} +article.sphinx-template-article .class .attribute dt em.property { + position: relative; + left: 0; +} +article.sphinx-template-article table { + table-layout: fixed; +} + +div.deprecated p { + display: inline; +} +div.deprecated, +div.versionchanged { + margin-top: 0.5rem; + padding: 0.5rem; + margin-bottom: 0.5rem; + border: none; +} +div.versionadded { + margin: 1rem 0; +} +div.deprecated p:last-child, +div.versionchanged p:last-child, +div.versionadded p:last-child { + margin-bottom: 0 +} +div.deprecated { + color: #b94a48; + background-color: #fdede9; +} +div.versionchanged { + background-color: #fffbe8; +} + +article.sphinx-template-article .note, +article.sphinx-template-article .warning, +article.sphinx-template-article .tip, +article.sphinx-template-article .seealso, +article.sphinx-template-article .hint, +article.sphinx-template-article .important, +article.sphinx-template-article .caution, +article.sphinx-template-article .danger, +article.sphinx-template-article .attention, +article.sphinx-template-article .error { + background: #f3f4f7; + margin-top: 1.875rem; + margin-bottom: 1.125rem; +} +article.sphinx-template-article .note .admonition-title, +article.sphinx-template-article .warning .admonition-title, +article.sphinx-template-article .tip .admonition-title, +article.sphinx-template-article .seealso .admonition-title, +article.sphinx-template-article .hint .admonition-title, +article.sphinx-template-article .important .admonition-title, +article.sphinx-template-article .caution .admonition-title, +article.sphinx-template-article .danger .admonition-title, +article.sphinx-template-article .attention .admonition-title, +article.sphinx-template-article .error .admonition-title { + color: #ffffff; + letter-spacing: 1px; + text-transform: uppercase; + margin-bottom: 1.125rem; + padding: 3px 0 3px 1.375rem; + position: relative; + font-size: 0.875rem; +} +article.sphinx-template-article .note .admonition-title:before, +article.sphinx-template-article .warning .admonition-title:before, +article.sphinx-template-article .tip .admonition-title:before, +article.sphinx-template-article .seealso .admonition-title:before, +article.sphinx-template-article .hint .admonition-title:before, +article.sphinx-template-article .important .admonition-title:before, +article.sphinx-template-article .caution .admonition-title:before, +article.sphinx-template-article .danger .admonition-title:before, +article.sphinx-template-article .attention .admonition-title:before, +article.sphinx-template-article .error .admonition-title:before { + content: "\2022"; + position: absolute; + left: 9px; + color: #ffffff; + top: 2px; +} +article.sphinx-template-article .note p:nth-child(n + 2), +article.sphinx-template-article .warning p:nth-child(n + 2), +article.sphinx-template-article .tip p:nth-child(n + 2), +article.sphinx-template-article .seealso p:nth-child(n + 2), +article.sphinx-template-article .hint p:nth-child(n + 2), +article.sphinx-template-article .important p:nth-child(n + 2), +article.sphinx-template-article .caution p:nth-child(n + 2), +article.sphinx-template-article .danger p:nth-child(n + 2), +article.sphinx-template-article .attention p:nth-child(n + 2), +article.sphinx-template-article .error p:nth-child(n + 2) { + padding: 0 1.375rem; +} +article.sphinx-template-article .note table, +article.sphinx-template-article .warning table, +article.sphinx-template-article .tip table, +article.sphinx-template-article .seealso table, +article.sphinx-template-article .hint table, +article.sphinx-template-article .important table, +article.sphinx-template-article .caution table, +article.sphinx-template-article .danger table, +article.sphinx-template-article .attention table, +article.sphinx-template-article .error table { + margin: 0 2rem; + width: auto; +} +article.sphinx-template-article .note :not(dt) > code, +article.sphinx-template-article .warning :not(dt) > code, +article.sphinx-template-article .tip :not(dt) > code, +article.sphinx-template-article .seealso :not(dt) > code, +article.sphinx-template-article .hint :not(dt) > code, +article.sphinx-template-article .important :not(dt) > code, +article.sphinx-template-article .caution :not(dt) > code, +article.sphinx-template-article .danger :not(dt) > code, +article.sphinx-template-article .attention :not(dt) > code, +article.sphinx-template-article .error :not(dt) > code { + border-top: 2px; + border-bottom: 2px; + padding: 0px 3px; + -webkit-box-decoration-break: clone; + box-decoration-break: clone; +} +article.sphinx-template-article .note :not(dt) > code .pre, +article.sphinx-template-article .warning :not(dt) > code .pre, +article.sphinx-template-article .tip :not(dt) > code .pre, +article.sphinx-template-article .seealso :not(dt) > code .pre, +article.sphinx-template-article .hint :not(dt) > code .pre, +article.sphinx-template-article .important :not(dt) > code .pre, +article.sphinx-template-article .caution :not(dt) > code .pre, +article.sphinx-template-article .danger :not(dt) > code .pre, +article.sphinx-template-article .attention :not(dt) > code .pre, +article.sphinx-template-article .error :not(dt) > code .pre { + outline: 0px; + padding: 0px; +} +article.sphinx-template-article .note pre, +article.sphinx-template-article .warning pre, +article.sphinx-template-article .tip pre, +article.sphinx-template-article .seealso pre, +article.sphinx-template-article .hint pre, +article.sphinx-template-article .important pre, +article.sphinx-template-article .caution pre, +article.sphinx-template-article .danger pre, +article.sphinx-template-article .attention pre, +article.sphinx-template-article .error pre { + margin-bottom: 0; +} +article.sphinx-template-article .note .highlight, +article.sphinx-template-article .warning .highlight, +article.sphinx-template-article .tip .highlight, +article.sphinx-template-article .seealso .highlight, +article.sphinx-template-article .hint .highlight, +article.sphinx-template-article .important .highlight, +article.sphinx-template-article .caution .highlight, +article.sphinx-template-article .danger .highlight, +article.sphinx-template-article .attention .highlight, +article.sphinx-template-article .error .highlight { + margin: 0 2rem 1.125rem 2rem; +} +article.sphinx-template-article .note ul, +article.sphinx-template-article .note ol, +article.sphinx-template-article .warning ul, +article.sphinx-template-article .warning ol, +article.sphinx-template-article .tip ul, +article.sphinx-template-article .tip ol, +article.sphinx-template-article .seealso ul, +article.sphinx-template-article .seealso ol, +article.sphinx-template-article .hint ul, +article.sphinx-template-article .hint ol, +article.sphinx-template-article .important ul, +article.sphinx-template-article .important ol, +article.sphinx-template-article .caution ul, +article.sphinx-template-article .caution ol, +article.sphinx-template-article .danger ul, +article.sphinx-template-article .danger ol, +article.sphinx-template-article .attention ul, +article.sphinx-template-article .attention ol, +article.sphinx-template-article .error ul, +article.sphinx-template-article .error ol { + padding-left: 3.25rem; +} +article.sphinx-template-article .note ul li, +article.sphinx-template-article .note ol li, +article.sphinx-template-article .warning ul li, +article.sphinx-template-article .warning ol li, +article.sphinx-template-article .tip ul li, +article.sphinx-template-article .tip ol li, +article.sphinx-template-article .seealso ul li, +article.sphinx-template-article .seealso ol li, +article.sphinx-template-article .hint ul li, +article.sphinx-template-article .hint ol li, +article.sphinx-template-article .important ul li, +article.sphinx-template-article .important ol li, +article.sphinx-template-article .caution ul li, +article.sphinx-template-article .caution ol li, +article.sphinx-template-article .danger ul li, +article.sphinx-template-article .danger ol li, +article.sphinx-template-article .attention ul li, +article.sphinx-template-article .attention ol li, +article.sphinx-template-article .error ul li, +article.sphinx-template-article .error ol li { + color: #262626; +} +article.sphinx-template-article .note p, +article.sphinx-template-article .warning p, +article.sphinx-template-article .tip p, +article.sphinx-template-article .seealso p, +article.sphinx-template-article .hint p, +article.sphinx-template-article .important p, +article.sphinx-template-article .caution p, +article.sphinx-template-article .danger p, +article.sphinx-template-article .attention p, +article.sphinx-template-article .error p { + margin-top: 1.125rem; +} +article.sphinx-template-article .note .admonition-title { + background: #54c7ec; +} +article.sphinx-template-article .warning .admonition-title { + background: #e94f3b; +} +article.sphinx-template-article .tip .admonition-title { + background: #6bcebb; +} +article.sphinx-template-article .seealso .admonition-title { + background: #6bcebb; +} +article.sphinx-template-article .hint .admonition-title { + background: #a2cdde; +} +article.sphinx-template-article .important .admonition-title { + background: #5890ff; +} +article.sphinx-template-article .caution .admonition-title { + background: #f7923a; +} +article.sphinx-template-article .danger .admonition-title { + background: #db2c49; +} +article.sphinx-template-article .attention .admonition-title { + background: #f5a623; +} +article.sphinx-template-article .error .admonition-title { + background: #cc2f90; +} +article.sphinx-template-article .sphx-glr-download-link-note.admonition.note, +article.sphinx-template-article .reference.download.internal, article.sphinx-template-article .sphx-glr-signature { + display: none; +} +article.sphinx-template-article .admonition > p:last-of-type { + margin-bottom: 0; + padding-bottom: 1.125rem !important; +} + +.sphinx-template-article div.sphx-glr-download a { + background-color: #f3f4f7; + background-image: url("../images/arrow-down-orange.svg"); + background-repeat: no-repeat; + background-position: left 10px center; + background-size: 15px 15px; + border-radius: 0; + border: none; + display: block; + text-align: left; + padding: 0.9375rem 3.125rem; + position: relative; + margin: 1.25rem auto; +} +@media screen and (min-width: 768px) { + .sphinx-template-article div.sphx-glr-download a:after { + content: ""; + display: block; + width: 0; + height: 1px; + position: absolute; + bottom: 0; + left: 0; + background-color: var(--pytorch); + -webkit-transition: width .250s ease-in-out; + transition: width .250s ease-in-out; + } + .sphinx-template-article div.sphx-glr-download a:hover:after { + width: 100%; + } +} +@media screen and (min-width: 768px) { + .sphinx-template-article div.sphx-glr-download a:after { + background-color: var(--pytorch-red); + } +} +@media screen and (min-width: 768px) { + .sphinx-template-article div.sphx-glr-download a { + background-position: left 20px center; + } +} +.sphinx-template-article div.sphx-glr-download a:hover { + -webkit-box-shadow: none; + box-shadow: none; + text-decoration: none; + background-image: url("../images/arrow-down-orange.svg"); + background-color: #f3f4f7; +} +.sphinx-template-article div.sphx-glr-download a span.pre { + background-color: transparent; + font-size: 1.125rem; + padding: 0; + color: #262626; +} +.sphinx-template-article div.sphx-glr-download a code, .sphinx-template-article div.sphx-glr-download a kbd, .sphinx-template-article div.sphx-glr-download a pre, .sphinx-template-article div.sphx-glr-download a samp, .sphinx-template-article div.sphx-glr-download a span.pre { + font-family: FreightSans, Helvetica Neue, Helvetica, Arial, sans-serif; +} + +.sphinx-template-article p.sphx-glr-script-out { + margin-bottom: 1.125rem; +} + +.sphinx-template-article div.sphx-glr-script-out { + margin-bottom: 2.5rem; +} +.sphinx-template-article div.sphx-glr-script-out .highlight { + margin-left: 0; + margin-top: 0; +} +.sphinx-template-article div.sphx-glr-script-out .highlight pre { + background-color: #fdede9; + padding: 1.5625rem; + color: #837b79; +} +.sphinx-template-article div.sphx-glr-script-out + p { + margin-top: unset; +} + +article.sphinx-template-article .sphinx-template-table-responsive table { + border: none; + border-color: #ffffff !important; + table-layout: fixed; +} +article.sphinx-template-article .sphinx-template-table-responsive table thead tr { + border-bottom: 2px solid #6c6c6d; +} +article.sphinx-template-article .sphinx-template-table-responsive table thead th { + line-height: 1.75rem; + padding-left: 0.9375rem; + padding-right: 0.9375rem; +} +article.sphinx-template-article .sphinx-template-table-responsive table tbody .row-odd { + background-color: #f3f4f7; +} +article.sphinx-template-article .sphinx-template-table-responsive table tbody td { + color: #6c6c6d; + white-space: normal; + padding: 0.9375rem; + font-size: 1rem; + line-height: 1.375rem; +} +article.sphinx-template-article .sphinx-template-table-responsive table tbody td .pre { + background: #ffffff; + color: var(--pytorch-red); + font-size: 87.5%; +} +article.sphinx-template-article .sphinx-template-table-responsive table tbody td code { + font-size: 87.5%; +} + +a[rel~="prev"], a[rel~="next"] { + padding: 0.375rem 0 0 0; +} + +img.next-page, +img.previous-page { + width: 8px; + height: 10px; + position: relative; + top: -1px; +} + +img.previous-page { + -webkit-transform: scaleX(-1); + transform: scaleX(-1); +} + +.rst-footer-buttons { + margin-top: 1.875rem; + margin-bottom: 1.875rem; +} +.rst-footer-buttons .btn:focus, +.rst-footer-buttons .btn.focus { + -webkit-box-shadow: none; + box-shadow: none; +} + +article.sphinx-template-article blockquote { + margin-left: 3.75rem; + color: #6c6c6d; +} + +article.sphinx-template-article .caption { + color: #6c6c6d; + letter-spacing: 0.25px; + line-height: 2.125rem; +} + +article.sphinx-template-article .math { + color: #262626; + width: auto; + text-align: center; + } + article.sphinx-template-article .math img { + width: auto; + } + +.sphinx-template-breadcrumbs-wrapper { + width: 100%; +} +@media screen and (min-width: 1101px) { + .sphinx-template-breadcrumbs-wrapper { + float: left; + margin-left: 3%; + width: 75%; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-breadcrumbs-wrapper { + width: 850px; + margin-left: 1.875rem; + } +} +.sphinx-template-breadcrumbs-wrapper .sphinx-template-breadcrumbs-aside { + float: right; +} +.sphinx-template-breadcrumbs-wrapper .sphinx-template-breadcrumbs-aside .fa.fa-github { + margin-top: 5px; + display: block; +} + +.sphinx-template-article .container { + padding-left: 0; + padding-right: 0; + max-width: none; +} + +a:link, +a:visited, +a:hover { + color: var(--pytorch-red); +} + +::-webkit-input-placeholder { + color: var(--pytorch-red); +} + +::-moz-placeholder { + color: var(--pytorch-red); +} + +:-ms-input-placeholder { + color: var(--pytorch-red); +} + +:-moz-placeholder { + color: var(--pytorch-red); +} + +@media screen and (min-width: 768px) { + .site-footer a:hover { + color: var(--pytorch-red); + } +} + +.docs-resources a { + color: var(--pytorch-red); +} + +.header-holder { + position: relative; + z-index: 201; +} + +.header-holder .main-menu ul li.active:after { + color: var(--pytorch-red); +} +.header-holder .main-menu ul li.active a { + color: var(--pytorch-red); +} +@media screen and (min-width: 1100px) { + .header-holder .main-menu ul li a:hover { + color: var(--pytorch-red); + } +} + +.version { + padding-bottom: 1rem; +} + +.sphinx-template-call-to-action-links { + padding-top: 0; + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} +@media screen and (min-width: 768px) { + .sphinx-template-call-to-action-links { + padding-top: 2.5rem; + } +} +@media (min-width: 768px) and (max-width: 1239px) { + .sphinx-template-call-to-action-links { + padding-top: 0; + } +} +@media (min-width: 1100px) and (max-width: 1239px) { + .sphinx-template-call-to-action-links { + padding-top: 2.5rem; + } +} +.sphinx-template-call-to-action-links .call-to-action-img, .sphinx-template-call-to-action-links .call-to-action-notebook-img { + height: 1.375rem; + width: 1.375rem; + margin-right: 10px; +} +.sphinx-template-call-to-action-links .call-to-action-notebook-img { + height: 1rem; +} +.sphinx-template-call-to-action-links a { + padding-right: 1.25rem; + color: #000000; + cursor: pointer; +} +.sphinx-template-call-to-action-links a:hover { + color: var(--pytorch); +} +.sphinx-template-call-to-action-links a .call-to-action-desktop-view { + display: none; +} +@media screen and (min-width: 768px) { + .sphinx-template-call-to-action-links a .call-to-action-desktop-view { + display: block; + } +} +.sphinx-template-call-to-action-links a .call-to-action-mobile-view { + display: block; +} +@media screen and (min-width: 768px) { + .sphinx-template-call-to-action-links a .call-to-action-mobile-view { + display: none; + } +} +.sphinx-template-call-to-action-links a #google-colab-link, .sphinx-template-call-to-action-links a #download-notebook-link, +.sphinx-template-call-to-action-links a #github-view-link { + padding-bottom: 0.625rem; + border-bottom: 1px solid #f3f4f7; + padding-right: 2.5rem; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} +.sphinx-template-call-to-action-links a #google-colab-link:hover, .sphinx-template-call-to-action-links a #download-notebook-link:hover, +.sphinx-template-call-to-action-links a #github-view-link:hover { + border-bottom-color: var(--pytorch); + color: var(--pytorch); +} + +.sphinx-template-container { + margin: 0 auto; + padding: 0 1.875rem; + width: auto; + position: relative; +} +@media screen and (min-width: 1100px) { + .sphinx-template-container { + padding: 0; + } +} +@media screen and (min-width: 1101px) { + .sphinx-template-container { + margin-left: 25%; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-container { + margin-left: 350px; + } +} +.sphinx-template-container:before, .sphinx-template-container:after { + content: ""; + display: table; +} +.sphinx-template-container:after { + clear: both; +} +.sphinx-template-container { + *zoom: 1; +} + +.sphinx-template-content-wrap { + background-color: #ffffff; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + position: relative; + padding-top: 0; +} +.sphinx-template-content-wrap:before, .sphinx-template-content-wrap:after { + content: ""; + display: table; +} +.sphinx-template-content-wrap:after { + clear: both; +} +.sphinx-template-content-wrap { + *zoom: 1; +} +@media screen and (min-width: 1101px) { + .sphinx-template-content-wrap { + padding-top: 45px; + float: left; + width: 100%; + display: block; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-content-wrap { + width: 100%; + } +} + +.sphinx-template-content { + background: #ffffff; + width: 100%; + max-width: 700px; + position: relative; +} + +.sphinx-template-content-left { + min-height: 100vh; + margin-top: 2.5rem; + width: 100%; +} +@media screen and (min-width: 1101px) { + .sphinx-template-content-left { + margin-top: 0; + margin-left: 3%; + width: 75%; + float: left; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-content-left { + width: 850px; + margin-left: 30px; + } +} +.sphinx-template-content-left .main-content { + padding-top: 0.9375rem; +} +.sphinx-template-content-left .main-content ul.simple { + padding-bottom: 1.25rem; +} +.sphinx-template-content-left .main-content .note:nth-child(1), .sphinx-template-content-left .main-content .warning:nth-child(1) { + margin-top: 0; +} + +.sphinx-template-content-right { + display: none; + position: relative; + overflow-x: hidden; + overflow-y: hidden; +} +@media screen and (min-width: 1101px) { + .sphinx-template-content-right { + display: block; + margin-left: 0; + width: 19%; + float: left; + height: 100%; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-content-right { + width: 280px; + } +} + +@media screen and (min-width: 1101px) { + .sphinx-template-side-scroll { + position: relative; + overflow-x: hidden; + overflow-y: scroll; + height: 100%; + } +} + +.sphinx-template-menu-vertical { + padding: 1.25rem 1.875rem 2.5rem 1.875rem; +} +@media screen and (min-width: 1101px) { + .sphinx-template-menu-vertical { + display: block; + padding-top: 0; + padding-right: 13.5%; + padding-bottom: 5.625rem; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-menu-vertical { + padding-left: 0; + padding-right: 1.5625rem; + } +} + +.sphinx-template-left-menu { + display: none; + background-color: #f3f4f7; + color: #262626; + overflow: scroll; +} +@media screen and (min-width: 1101px) { + .sphinx-template-left-menu { + display: block; + overflow-x: hidden; + overflow-y: hidden; + padding-bottom: 110px; + padding: 0 1.875rem 0 0; + width: 25%; + z-index: 200; + float: left; + } + .sphinx-template-left-menu.make-fixed { + position: fixed; + top: 0; + bottom: 0; + left: 0; + float: none; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-left-menu { + padding: 0 0 0 1.875rem; + width: 350px; + } +} + +.expand-menu, .hide-menu { + color: #6c6c6d; + padding-left: 10px; + cursor: pointer; +} + +.collapse { + display: none; +} + +.left-nav-top-caption { + padding-top: 1rem; +} + +.sphinx-template-left-menu p.caption { + color: #262626; + display: block; + font-size: 1.2rem; + line-height: 1.375rem; + margin-bottom: 1rem; + text-transform: none; + white-space: normal; +} + +.sphinx-template-left-menu-search { + margin-bottom: 2.5rem; +} +@media screen and (min-width: 1101px) { + .sphinx-template-left-menu-search { + margin: 1.25rem 0.625rem 1.875rem 0; + } +} + +.sphinx-template-left-menu-search ::-webkit-input-placeholder { + color: #262626; +} +.sphinx-template-left-menu-search ::-moz-placeholder { + color: #262626; +} +.sphinx-template-left-menu-search :-ms-input-placeholder { + color: #262626; +} +.sphinx-template-left-menu-search ::-ms-input-placeholder { + color: #262626; +} +.sphinx-template-left-menu-search ::placeholder { + color: #262626; +} + +.sphinx-template-left-menu-search :focus::-webkit-input-placeholder { + color: transparent; +} +.sphinx-template-left-menu-search :focus::-moz-placeholder { + color: transparent; +} +.sphinx-template-left-menu-search :focus:-ms-input-placeholder { + color: transparent; +} +.sphinx-template-left-menu-search :focus::-ms-input-placeholder { + color: transparent; +} +.sphinx-template-left-menu-search :focus::placeholder { + color: transparent; +} + +.sphinx-template-left-menu-search input[type=text] { + border-radius: 0; + padding: 0.5rem 0.75rem; + border-color: #ffffff; + color: #262626; + border-style: solid; + font-size: 1rem; + width: 100%; + background-color: #f3f4f7; + background-image: url("../images/search-icon.svg"); + background-repeat: no-repeat; + background-size: 18px 18px; + background-position: 12px 10px; + padding-left: 40px; + background-color: #ffffff; +} +.sphinx-template-left-menu-search input[type=text]:focus { + outline: 0; +} + +@media screen and (min-width: 1101px) { + .sphinx-template-left-menu .sphinx-template-side-scroll { + width: 120%; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-left-menu .sphinx-template-side-scroll { + width: 340px; + } +} + +.sphinx-template-right-menu { + min-height: 100px; + overflow-x: hidden; + overflow-y: hidden; + left: 0; + z-index: 200; + padding-top: 0; + position: relative; +} +@media screen and (min-width: 1101px) { + .sphinx-template-right-menu { + width: 100%; + } + .sphinx-template-right-menu.scrolling-fixed { + position: fixed; + top: 45px; + left: 83.5%; + width: 14%; + } + .sphinx-template-right-menu.scrolling-absolute { + position: absolute; + left: 0; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-right-menu { + left: 0; + width: 380px; + } + .sphinx-template-right-menu.scrolling-fixed { + position: fixed; + top: 45px; + left: 1230px; + } + .sphinx-template-right-menu.scrolling-absolute { + position: absolute; + left: 0; + } +} + +.sphinx-template-left-menu ul, +.sphinx-template-right-menu ul { + list-style-type: none; + padding-left: 0; + margin-bottom: 2.5rem; +} +.sphinx-template-left-menu > ul, +.sphinx-template-right-menu > ul { + margin-bottom: 2.5rem; +} +.sphinx-template-left-menu a:link, +.sphinx-template-left-menu a:visited, +.sphinx-template-left-menu a:hover, +.sphinx-template-right-menu a:link, +.sphinx-template-right-menu a:visited, +.sphinx-template-right-menu a:hover { + color: #6c6c6d; + font-size: 0.875rem; + line-height: 1rem; + padding: 0; + text-decoration: none; +} +.sphinx-template-left-menu a:link.reference.internal, +.sphinx-template-left-menu a:visited.reference.internal, +.sphinx-template-left-menu a:hover.reference.internal, +.sphinx-template-right-menu a:link.reference.internal, +.sphinx-template-right-menu a:visited.reference.internal, +.sphinx-template-right-menu a:hover.reference.internal { + margin-bottom: 0.3125rem; + margin-left: 1.5rem; + position: relative; +} +.sphinx-template-left-menu li code, +.sphinx-template-right-menu li code { + border: none; + background: inherit; + color: inherit; + padding-left: 0; + padding-right: 0; +} +.search li code { + font-family: inherit; + font-size: inherit; +} +.sphinx-template-left-menu li span.toctree-expand, +.sphinx-template-right-menu li span.toctree-expand { + display: block; + float: left; + margin-left: -1.2em; + font-size: 0.8em; + line-height: 1.6em; +} +.sphinx-template-left-menu li.on a, .sphinx-template-left-menu li.current > a, +.sphinx-template-right-menu li.on a, +.sphinx-template-right-menu li.current > a { + position: relative; + border: none; +} +.sphinx-template-left-menu li.on a span.toctree-expand, .sphinx-template-left-menu li.current > a span.toctree-expand, +.sphinx-template-right-menu li.on a span.toctree-expand, +.sphinx-template-right-menu li.current > a span.toctree-expand { + display: block; + font-size: 0.8em; + line-height: 1.6em; +} + +/* l1 text */ +.sphinx-template-left-menu li.toctree-l1 > a, +.sphinx-template-right-menu li.toctree-l1 > a { + color: #262626; + font-size: 1rem; +} + +/* l1 current text */ +.sphinx-template-left-menu li.toctree-l1.current > a, +.sphinx-template-right-menu li.toctree-l1.current > a { + color: var(--pytorch-red); +} + + +/* l2 text */ +.sphinx-template-left-menu li.toctree-l2 > a, +.sphinx-template-right-menu li.toctree-l2 > a { + left: 15px; + font-size: 1rem; +} +@media screen and (min-width: 1101px) { + .sphinx-template-left-menu li.toctree-l2 > a, + .sphinx-template-right-menu li.toctree-l2 > a { + left: 20px; + } +} +/* l2 current text */ +.sphinx-template-left-menu li.toctree-l2.current > a, +.sphinx-template-right-menu li.toctree-l2.current > a { + color: var(--lightning); +} + +/* l1 current point */ +.sphinx-template-left-menu li.toctree-l1.current > a:before, +.sphinx-template-right-menu li.toctree-l1.current > a:before { + content: "\2022"; + display: inline-block; + position: absolute; + left: -15px; + top: -10%; + font-size: 1.375rem; + color: var(--pytorch-red); /* point color */ +} +@media screen and (min-width: 1101px) { + .sphinx-template-left-menu li.toctree-l1.current > a:before, + .sphinx-template-right-menu li.toctree-l1.current > a:before { + left: -20px; + } +} + +/* l2 current point */ +.sphinx-template-left-menu li.toctree-l2.current > a:before, +.sphinx-template-right-menu li.toctree-l2.current > a:before { + content: "\2022"; + display: inline-block; + position: absolute; + left: -15px; + top: -10%; + font-size: 1.375rem; + color: var(--lightning); +} +@media screen and (min-width: 1101px) { + .sphinx-template-left-menu li.toctree-l2.current > a:before, + .sphinx-template-right-menu li.toctree-l2.current > a:before { + left: -20px; + } +} + + +.sphinx-template-left-menu li.toctree-l1.current li.toctree-l2 > ul, .sphinx-template-left-menu li.toctree-l2.current li.toctree-l3 > ul, +.sphinx-template-right-menu li.toctree-l1.current li.toctree-l2 > ul, +.sphinx-template-right-menu li.toctree-l2.current li.toctree-l3 > ul { + display: none; +} +.sphinx-template-left-menu li.toctree-l1.current li.toctree-l2.current > ul, .sphinx-template-left-menu li.toctree-l2.current li.toctree-l3.current > ul, +.sphinx-template-right-menu li.toctree-l1.current li.toctree-l2.current > ul, +.sphinx-template-right-menu li.toctree-l2.current li.toctree-l3.current > ul { + display: block; +} +.sphinx-template-left-menu li.toctree-l2.current li.toctree-l3 > a, +.sphinx-template-right-menu li.toctree-l2.current li.toctree-l3 > a { + display: block; +} + +/* l3 text */ +.sphinx-template-left-menu li.toctree-l3 > a, +.sphinx-template-right-menu li.toctree-l3 > a { + left: 30px; + font-size: 0.9em; +} +@media screen and (min-width: 1101px) { + .sphinx-template-left-menu li.toctree-l3 > a, + .sphinx-template-right-menu li.toctree-l3 > a { + left: 40px; + } +} +/* l3 current text */ +.sphinx-template-left-menu li.toctree-l3.current > a, +.sphinx-template-right-menu li.toctree-l3.current > a { + color: var(--google-green); +} +/* l3 current point */ +.sphinx-template-left-menu li.toctree-l3.current > a:before, +.sphinx-template-right-menu li.toctree-l3.current > a:before { + content: "\2022"; + display: inline-block; + position: absolute; + left: -15px; + top: -10%; + font-size: 1.2rem; + color: var(--google-green); +} +@media screen and (min-width: 1101px) { + .sphinx-template-left-menu li.toctree-l3.current > a:before, + .sphinx-template-right-menu li.toctree-l3.current > a:before { + left: -20px; + } +} + +.sphinx-template-left-menu li.toctree-l3.current li.toctree-l4 > a, +.sphinx-template-right-menu li.toctree-l3.current li.toctree-l4 > a { + display: block; +} + +/* l4 text */ +.sphinx-template-left-menu li.toctree-l4 > a, +.sphinx-template-right-menu li.toctree-l4 > a { + left: 45px; + font-size: 0.9em; +} +@media screen and (min-width: 1101px) { + .sphinx-template-left-menu li.toctree-l4 > a, + .sphinx-template-right-menu li.toctree-l4 > a { + left: 60px; + } +} +/* l4 current text */ +.sphinx-template-left-menu li.toctree-l4.current > a, +.sphinx-template-right-menu li.toctree-l4.current > a { + color: #f4b400; +} +/* l4 current point */ +.sphinx-template-left-menu li.toctree-l4.current > a:before, +.sphinx-template-right-menu li.toctree-l4.current > a:before { + content: "\2022"; + display: inline-block; + position: absolute; + left: -15px; + top: -10%; + font-size: 1.2rem; + color: #f4b400; +} +@media screen and (min-width: 1101px) { + .sphinx-template-left-menu li.toctree-l4.current > a:before, + .sphinx-template-right-menu li.toctree-l4.current > a:before { + left: -20px; + } +} + +.sphinx-template-left-menu li[aria-expanded="true"] > ul, +.sphinx-template-right-menu li[aria-expanded="true"] > ul { + display: block; +} +.sphinx-template-left-menu li ul, +.sphinx-template-right-menu li ul { + margin-bottom: 0; + display: none; +} +.sphinx-template-left-menu li ul li a, +.sphinx-template-right-menu li ul li a { + margin-bottom: 0; +} +.sphinx-template-left-menu a, +.sphinx-template-right-menu a { + display: inline-block; + position: relative; +} +.sphinx-template-left-menu a:hover, +.sphinx-template-right-menu a:hover { + cursor: pointer; +} +.sphinx-template-left-menu a:active, +.sphinx-template-right-menu a:active { + cursor: pointer; +} + +.sphinx-template-left-menu ul { + padding-left: 0; +} + +/* .sphinx-template-right-menu a:link, +.sphinx-template-right-menu a:visited, +.sphinx-template-right-menu a:hover { + color: #6c6c6d; +} +.sphinx-template-right-menu a:link span.pre, +.sphinx-template-right-menu a:visited span.pre, +.sphinx-template-right-menu a:hover span.pre { + color: #6c6c6d; +} */ +.sphinx-template-right-menu a.reference.internal button { + display: block; + padding: 0; + border: 0; + margin: 0; + color: inherit; +} +.sphinx-template-right-menu a.reference.internal[aria-expanded="true"] button:before { + content: "-"; + font-family: monospace; + position: absolute; + left: -12px; +} +.sphinx-template-right-menu a.reference.internal[aria-expanded="false"] button:before { + content: "+"; + font-family: monospace; + position: absolute; + left: -12px; +} +.sphinx-template-right-menu li.active > a { + color: var(--pytorch-red); +} +.sphinx-template-right-menu li.active > a span.pre, .sphinx-template-right-menu li.active > a:before { + color: var(--pytorch-red); +} +.sphinx-template-right-menu li.active > a:after { + content: "\2022"; + color: var(--pytorch); + display: inline-block; + font-size: 1.375rem; + left: -17px; + position: absolute; + top: 1px; +} +.sphinx-template-right-menu .sphinx-template-side-scroll > ul > li > ul > li { + margin-bottom: 0; +} +.sphinx-template-right-menu ul ul { + padding-left: 0; +} +.sphinx-template-right-menu ul ul li { + padding-left: 0px; +} +.sphinx-template-right-menu ul ul li a.reference.internal { + padding-left: 0; +} +.sphinx-template-right-menu ul ul li ul { + display: none; + padding-left: 10px; +} +.sphinx-template-right-menu ul ul li li a.reference.internal { + padding-left: 0; +} +.sphinx-template-right-menu li ul { + display: block; +} + +.sphinx-template-right-menu .sphinx-template-side-scroll { + padding-top: 20px; +} +@media screen and (min-width: 1101px) { + .sphinx-template-right-menu .sphinx-template-side-scroll { + width: 120%; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-right-menu .sphinx-template-side-scroll { + width: 400px; + } +} +.sphinx-template-right-menu .sphinx-template-side-scroll > ul { + padding-left: 10%; + padding-right: 10%; + margin-bottom: 0; +} +@media screen and (min-width: 1600px) { + .sphinx-template-right-menu .sphinx-template-side-scroll > ul { + padding-left: 25px; + } +} +.sphinx-template-right-menu .sphinx-template-side-scroll > ul > li > a.reference.internal { + color: #262626; + font-weight: 500; +} +.sphinx-template-right-menu .sphinx-template-side-scroll ul li { + position: relative; +} + +#sphinx-template-right-menu ul li ul li .side-scroll-highlight { + color: var(--pytorch-red); +} +#sphinx-template-right-menu ul li ul li ul li .side-scroll-highlight { + color: var(--lightning); +} +#sphinx-template-right-menu ul li ul li ul li ul li .side-scroll-highlight { + color: var(--google-green); +} +#sphinx-template-right-menu ul li ul li ul li ul li ul li .side-scroll-highlight { + color: var(--readthedoc); +} + +.header-container { + max-width: none; + margin-top: 4px; +} +@media screen and (min-width: 1101px) { + .header-container { + margin-top: 0; + } +} +@media screen and (min-width: 1600px) { + .header-container { + margin-top: 0; + } +} + +.container-fluid.header-holder { + padding-right: 0; + padding-left: 0; +} + +.header-holder .container { + max-width: none; + padding-right: 1.875rem; + padding-left: 1.875rem; +} +@media screen and (min-width: 1101px) { + .header-holder .container { + padding-right: 1.875rem; + padding-left: 1.875rem; + } +} + +.header-holder .main-menu { + -webkit-box-pack: unset; + -ms-flex-pack: unset; + justify-content: unset; + position: relative; +} +@media screen and (min-width: 1101px) { + .header-holder .main-menu ul { + padding-left: 0; + margin-left: 26%; + } +} +@media screen and (min-width: 1600px) { + .header-holder .main-menu ul { + padding-left: 38px; + margin-left: 310px; + } +} + +.sphinx-template-page-level-bar { + display: none; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + background-color: #ffffff; + border-bottom: 1px solid #e2e2e2; + width: 100%; + z-index: 201; +} +@media screen and (min-width: 1101px) { + .sphinx-template-page-level-bar { + left: 0; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + height: 45px; + padding-left: 0; + width: 100%; + position: absolute; + z-index: 1; + } + .sphinx-template-page-level-bar.left-menu-is-fixed { + position: fixed; + top: 0; + left: 25%; + padding-left: 0; + right: 0; + width: 75%; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-page-level-bar { + left: 0; + right: 0; + width: auto; + z-index: 1; + } + .sphinx-template-page-level-bar.left-menu-is-fixed { + left: 350px; + right: 0; + width: auto; + } +} +.sphinx-template-page-level-bar ul, .sphinx-template-page-level-bar li { + margin: 0; +} + +.sphinx-template-shortcuts-wrapper { + display: none; +} +@media screen and (min-width: 1101px) { + .sphinx-template-shortcuts-wrapper { + font-size: 0.875rem; + float: left; + margin-left: 2%; + } +} +@media screen and (min-width: 1600px) { + .sphinx-template-shortcuts-wrapper { + margin-left: 1.875rem; + } +} + +.cookie-banner-wrapper { + display: none; +} +.cookie-banner-wrapper .container { + padding-left: 1.875rem; + padding-right: 1.875rem; + max-width: 1240px; +} +.cookie-banner-wrapper.is-visible { + display: block; + position: fixed; + bottom: 0; + background-color: #f3f4f7; + min-height: 100px; + width: 100%; + z-index: 401; + border-top: 3px solid #ededee; +} +.cookie-banner-wrapper .gdpr-notice { + color: #6c6c6d; + margin-top: 1.5625rem; + text-align: left; + max-width: 1440px; +} +@media screen and (min-width: 768px) { + .cookie-banner-wrapper .gdpr-notice { + width: 77%; + } +} +@media (min-width: 768px) and (max-width: 1239px) { + .cookie-banner-wrapper .gdpr-notice { + width: inherit; + } +} +.cookie-banner-wrapper .gdpr-notice .cookie-policy-link { + color: #343434; +} +.cookie-banner-wrapper .close-button { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: transparent; + border: 1px solid #f3f4f7; + height: 1.3125rem; + position: absolute; + bottom: 42px; + right: 0; + top: 0; + cursor: pointer; + outline: none; +} +@media screen and (min-width: 768px) { + .cookie-banner-wrapper .close-button { + right: 20%; + top: inherit; + } +} +@media (min-width: 768px) and (max-width: 1239px) { + .cookie-banner-wrapper .close-button { + right: 0; + top: 0; + } +} + +.main-menu ul li .resources-dropdown a { + cursor: pointer; +} +.main-menu ul li .dropdown-menu { + border-radius: 0; + padding: 0; +} +.main-menu ul li .dropdown-menu .dropdown-item { + color: #6c6c6d; + border-bottom: 1px solid #e2e2e2; +} +.main-menu ul li .dropdown-menu .dropdown-item:last-of-type { + border-bottom-color: transparent; +} +.main-menu ul li .dropdown-menu .dropdown-item:hover { + background-color: var(--pytorch); +} +.main-menu ul li .dropdown-menu .dropdown-item p { + font-size: 1rem; + color: #979797; +} +.main-menu ul li .dropdown-menu a.dropdown-item:hover { + color: #ffffff; +} +.main-menu ul li .dropdown-menu a.dropdown-item:hover p { + color: #ffffff; +} + +.resources-dropdown-menu { + left: -75px; + width: 226px; + display: none; + position: absolute; + z-index: 1000; + display: none; + float: left; + min-width: 10rem; + padding: 0.5rem 0; + font-size: 1rem; + color: #212529; + text-align: left; + list-style: none; + background-color: #ffffff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0.25rem; +} + +.resources-dropdown:hover .resources-dropdown-menu { + display: block; +} + +.main-menu ul li .resources-dropdown-menu { + border-radius: 0; + padding: 0; +} +.main-menu ul li.active:hover .resources-dropdown-menu { + display: block; +} + +.main-menu ul li .resources-dropdown-menu .dropdown-item { + color: #6c6c6d; + border-bottom: 1px solid #e2e2e2; +} + +.resources-dropdown .with-down-orange-arrow { + padding-right: 2rem; + position: relative; + background: url("../images/chevron-down-orange.svg"); + background-size: 14px 18px; + background-position: top 7px right 10px; + background-repeat: no-repeat; +} + +.with-down-arrow { + padding-right: 2rem; + position: relative; + background-image: url("../images/chevron-down-black.svg"); + background-size: 14px 18px; + background-position: top 7px right 10px; + background-repeat: no-repeat; +} +.with-down-arrow:hover { + background-image: url("../images/chevron-down-orange.svg"); + background-repeat: no-repeat; +} + +.header-holder .main-menu ul li .resources-dropdown .doc-dropdown-option { + padding-top: 1rem; +} + +.header-holder .main-menu ul li a.nav-dropdown-item { + display: block; + font-size: 1rem; + line-height: 1.3125rem; + width: 100%; + padding: 0.25rem 1.5rem; + clear: both; + font-weight: 400; + color: #979797; + text-align: center; + background-color: transparent; + border-bottom: 1px solid #e2e2e2; +} +.header-holder .main-menu ul li a.nav-dropdown-item.active:before { + content: "\F0A3"; + font-family: FontAwesome; + color: var(--lightning); + padding: 0.5rem 0rem; + font-size: 1.3rem; + left: 3px; + position: absolute; + text-align: left; +} +.header-holder .main-menu ul li a.nav-dropdown-item.active:hover:before { + color: var(--google-green); +} +.header-holder .main-menu ul li a.nav-dropdown-item:last-of-type { + border-bottom-color: transparent; +} +.header-holder .main-menu ul li a.nav-dropdown-item:hover { + background-color: var(--pytorch); + color: white; +} +.header-holder .main-menu ul li a.nav-dropdown-item .dropdown-title { + font-size: 1.125rem; + color: #6c6c6d; + letter-spacing: 0; + line-height: 34px; +} + +.header-holder .main-menu ul li a.nav-dropdown-item:hover .dropdown-title { + background-color: var(--pytorch); + color: white; +} + +.fa:before { + font-family: FontAwesome; + display: inline-block; + font-style: normal; + font-weight: 400; + font-size: inherit; + line-height: 1; + padding-right: 2px; +} +.fa-black:before { + color: 'black'; +} +.fa-blue:before { + color: var(--readthedoc); +} +.fa-large:before { + font-size: large; +} +.fa.fa-home:before { + content: "\F015"; +} +.fa.fa-github:before { + content: "\F09B"; +} +.fa.fa-arrow-circle-left:before { + content: "\F0A8"; +} +.fa.fa-arrow-circle-right:before { + content: "\F0A9"; +} + +.toctree-wrapper .toctree-l2 a { + color: var(--lightning); +} +.toctree-wrapper .toctree-l2 .toctree-l3 a { + color: var(--google-green); +} +.toctree-wrapper .toctree-l2 .toctree-l3 .toctree-l4 a { + color: var(--readthedoc); +} + +/*# sourceMappingURL=theme.css.map */ diff --git a/_static/doctools.js b/_static/doctools.js new file mode 100644 index 00000000..d06a71d7 --- /dev/null +++ b/_static/doctools.js @@ -0,0 +1,156 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Base JavaScript utilities for all Sphinx HTML documentation. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/_static/documentation_options.js b/_static/documentation_options.js new file mode 100644 index 00000000..138ae34f --- /dev/null +++ b/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: '2.0.3', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/_static/favicon.ico b/_static/favicon.ico new file mode 100644 index 00000000..c679534a Binary files /dev/null and b/_static/favicon.ico differ diff --git a/_static/file.png b/_static/file.png new file mode 100644 index 00000000..a858a410 Binary files /dev/null and b/_static/file.png differ diff --git a/_static/fonts/FontAwesome/fontawesome-webfont.eot b/_static/fonts/FontAwesome/fontawesome-webfont.eot new file mode 100644 index 00000000..e9f60ca9 Binary files /dev/null and b/_static/fonts/FontAwesome/fontawesome-webfont.eot differ diff --git a/_static/fonts/FontAwesome/fontawesome-webfont.svg b/_static/fonts/FontAwesome/fontawesome-webfont.svg new file mode 100644 index 00000000..855c845e --- /dev/null +++ b/_static/fonts/FontAwesome/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_static/fonts/FontAwesome/fontawesome-webfont.ttf b/_static/fonts/FontAwesome/fontawesome-webfont.ttf new file mode 100644 index 00000000..35acda2f Binary files /dev/null and b/_static/fonts/FontAwesome/fontawesome-webfont.ttf differ diff --git a/_static/fonts/FontAwesome/fontawesome-webfont.woff b/_static/fonts/FontAwesome/fontawesome-webfont.woff new file mode 100644 index 00000000..400014a4 Binary files /dev/null and b/_static/fonts/FontAwesome/fontawesome-webfont.woff differ diff --git a/_static/fonts/FontAwesome/fontawesome-webfont.woff2 b/_static/fonts/FontAwesome/fontawesome-webfont.woff2 new file mode 100644 index 00000000..4d13fc60 Binary files /dev/null and b/_static/fonts/FontAwesome/fontawesome-webfont.woff2 differ diff --git a/_static/fonts/FreightSans/freight-sans-bold-italic.woff b/_static/fonts/FreightSans/freight-sans-bold-italic.woff new file mode 100644 index 00000000..e3172484 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-bold-italic.woff differ diff --git a/_static/fonts/FreightSans/freight-sans-bold-italic.woff2 b/_static/fonts/FreightSans/freight-sans-bold-italic.woff2 new file mode 100644 index 00000000..cec2dc94 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-bold-italic.woff2 differ diff --git a/_static/fonts/FreightSans/freight-sans-bold.woff b/_static/fonts/FreightSans/freight-sans-bold.woff new file mode 100644 index 00000000..de46625e Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-bold.woff differ diff --git a/_static/fonts/FreightSans/freight-sans-bold.woff2 b/_static/fonts/FreightSans/freight-sans-bold.woff2 new file mode 100644 index 00000000..dc05cd82 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-bold.woff2 differ diff --git a/_static/fonts/FreightSans/freight-sans-book-italic.woff b/_static/fonts/FreightSans/freight-sans-book-italic.woff new file mode 100644 index 00000000..a50e5038 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-book-italic.woff differ diff --git a/_static/fonts/FreightSans/freight-sans-book-italic.woff2 b/_static/fonts/FreightSans/freight-sans-book-italic.woff2 new file mode 100644 index 00000000..fe284db6 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-book-italic.woff2 differ diff --git a/_static/fonts/FreightSans/freight-sans-book.woff b/_static/fonts/FreightSans/freight-sans-book.woff new file mode 100644 index 00000000..6ab8775f Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-book.woff differ diff --git a/_static/fonts/FreightSans/freight-sans-book.woff2 b/_static/fonts/FreightSans/freight-sans-book.woff2 new file mode 100644 index 00000000..2688739f Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-book.woff2 differ diff --git a/_static/fonts/FreightSans/freight-sans-light-italic.woff b/_static/fonts/FreightSans/freight-sans-light-italic.woff new file mode 100644 index 00000000..beda58d4 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-light-italic.woff differ diff --git a/_static/fonts/FreightSans/freight-sans-light-italic.woff2 b/_static/fonts/FreightSans/freight-sans-light-italic.woff2 new file mode 100644 index 00000000..e2fa0134 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-light-italic.woff2 differ diff --git a/_static/fonts/FreightSans/freight-sans-light.woff b/_static/fonts/FreightSans/freight-sans-light.woff new file mode 100644 index 00000000..226a0bf8 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-light.woff differ diff --git a/_static/fonts/FreightSans/freight-sans-light.woff2 b/_static/fonts/FreightSans/freight-sans-light.woff2 new file mode 100644 index 00000000..6d8ff2c0 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-light.woff2 differ diff --git a/_static/fonts/FreightSans/freight-sans-medium-italic.woff b/_static/fonts/FreightSans/freight-sans-medium-italic.woff new file mode 100644 index 00000000..a42115d6 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-medium-italic.woff differ diff --git a/_static/fonts/FreightSans/freight-sans-medium-italic.woff2 b/_static/fonts/FreightSans/freight-sans-medium-italic.woff2 new file mode 100644 index 00000000..16a7713a Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-medium-italic.woff2 differ diff --git a/_static/fonts/FreightSans/freight-sans-medium.woff b/_static/fonts/FreightSans/freight-sans-medium.woff new file mode 100644 index 00000000..5ea34539 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-medium.woff differ diff --git a/_static/fonts/FreightSans/freight-sans-medium.woff2 b/_static/fonts/FreightSans/freight-sans-medium.woff2 new file mode 100644 index 00000000..c58b6a52 Binary files /dev/null and b/_static/fonts/FreightSans/freight-sans-medium.woff2 differ diff --git a/_static/fonts/IBMPlexMono/IBMPlexMono-Light.woff b/_static/fonts/IBMPlexMono/IBMPlexMono-Light.woff new file mode 100644 index 00000000..cf37a5c5 Binary files /dev/null and b/_static/fonts/IBMPlexMono/IBMPlexMono-Light.woff differ diff --git a/_static/fonts/IBMPlexMono/IBMPlexMono-Light.woff2 b/_static/fonts/IBMPlexMono/IBMPlexMono-Light.woff2 new file mode 100644 index 00000000..955a6eab Binary files /dev/null and b/_static/fonts/IBMPlexMono/IBMPlexMono-Light.woff2 differ diff --git a/_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff b/_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff new file mode 100644 index 00000000..fc65a679 Binary files /dev/null and b/_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff differ diff --git a/_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff2 b/_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff2 new file mode 100644 index 00000000..c352e40e Binary files /dev/null and b/_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff2 differ diff --git a/_static/fonts/IBMPlexMono/IBMPlexMono-Regular.woff b/_static/fonts/IBMPlexMono/IBMPlexMono-Regular.woff new file mode 100644 index 00000000..7d63d89f Binary files /dev/null and b/_static/fonts/IBMPlexMono/IBMPlexMono-Regular.woff differ diff --git a/_static/fonts/IBMPlexMono/IBMPlexMono-Regular.woff2 b/_static/fonts/IBMPlexMono/IBMPlexMono-Regular.woff2 new file mode 100644 index 00000000..d0d7ded9 Binary files /dev/null and b/_static/fonts/IBMPlexMono/IBMPlexMono-Regular.woff2 differ diff --git a/_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff b/_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff new file mode 100644 index 00000000..1da7753c Binary files /dev/null and b/_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff differ diff --git a/_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2 b/_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2 new file mode 100644 index 00000000..79dffdb8 Binary files /dev/null and b/_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2 differ diff --git a/_static/images/arrow-down-orange.svg b/_static/images/arrow-down-orange.svg new file mode 100644 index 00000000..e9d8e9ec --- /dev/null +++ b/_static/images/arrow-down-orange.svg @@ -0,0 +1,19 @@ + + + + Group 5 + Created with Sketch. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_static/images/arrow-right-with-tail.svg b/_static/images/arrow-right-with-tail.svg new file mode 100644 index 00000000..5843588f --- /dev/null +++ b/_static/images/arrow-right-with-tail.svg @@ -0,0 +1,19 @@ + + + + Page 1 + Created with Sketch. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_static/images/chevron-down-black.svg b/_static/images/chevron-down-black.svg new file mode 100644 index 00000000..097bc076 --- /dev/null +++ b/_static/images/chevron-down-black.svg @@ -0,0 +1,16 @@ + + + Created with Sketch. + + + + + + + + + + + + + diff --git a/_static/images/chevron-down-grey.svg b/_static/images/chevron-down-grey.svg new file mode 100644 index 00000000..82d6514f --- /dev/null +++ b/_static/images/chevron-down-grey.svg @@ -0,0 +1,18 @@ + + + + +Created with Sketch. + + + + + + + + + + + + diff --git a/_static/images/chevron-down-orange.svg b/_static/images/chevron-down-orange.svg new file mode 100644 index 00000000..fd79a578 --- /dev/null +++ b/_static/images/chevron-down-orange.svg @@ -0,0 +1,16 @@ + + + Created with Sketch. + + + + + + + + + + + + + diff --git a/_static/images/chevron-down-white.svg b/_static/images/chevron-down-white.svg new file mode 100644 index 00000000..e6c94e27 --- /dev/null +++ b/_static/images/chevron-down-white.svg @@ -0,0 +1,16 @@ + + + Created with Sketch. + + + + + + + + + + + + + diff --git a/_static/images/chevron-right-orange.svg b/_static/images/chevron-right-orange.svg new file mode 100644 index 00000000..7033fc93 --- /dev/null +++ b/_static/images/chevron-right-orange.svg @@ -0,0 +1,17 @@ + + + + +Page 1 +Created with Sketch. + + + + + + + + + + diff --git a/_static/images/chevron-right-white.svg b/_static/images/chevron-right-white.svg new file mode 100644 index 00000000..dd9e77f2 --- /dev/null +++ b/_static/images/chevron-right-white.svg @@ -0,0 +1,17 @@ + + + + +Page 1 +Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/_static/images/home-footer-background.jpg b/_static/images/home-footer-background.jpg new file mode 100644 index 00000000..b307bb57 Binary files /dev/null and b/_static/images/home-footer-background.jpg differ diff --git a/_static/images/icon-close.svg b/_static/images/icon-close.svg new file mode 100644 index 00000000..348964e7 --- /dev/null +++ b/_static/images/icon-close.svg @@ -0,0 +1,21 @@ + + + + Page 1 + Created with Sketch. + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_static/images/icon-menu-dots-dark.svg b/_static/images/icon-menu-dots-dark.svg new file mode 100644 index 00000000..fa2ad044 --- /dev/null +++ b/_static/images/icon-menu-dots-dark.svg @@ -0,0 +1,42 @@ + + + + Page 1 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_static/images/logo-facebook-dark.svg b/_static/images/logo-facebook-dark.svg new file mode 100644 index 00000000..cff17915 --- /dev/null +++ b/_static/images/logo-facebook-dark.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/_static/images/logo-twitter-dark.svg b/_static/images/logo-twitter-dark.svg new file mode 100644 index 00000000..1572570f --- /dev/null +++ b/_static/images/logo-twitter-dark.svg @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/_static/images/logo-youtube-dark.svg b/_static/images/logo-youtube-dark.svg new file mode 100644 index 00000000..e3cfedd7 --- /dev/null +++ b/_static/images/logo-youtube-dark.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/_static/images/search-icon.svg b/_static/images/search-icon.svg new file mode 100644 index 00000000..ebb0df86 --- /dev/null +++ b/_static/images/search-icon.svg @@ -0,0 +1,19 @@ + + + + Created with Sketch. + + + + + + + + + + + + + + + diff --git a/_static/images/view-page-source-icon.svg b/_static/images/view-page-source-icon.svg new file mode 100644 index 00000000..6f5bbe07 --- /dev/null +++ b/_static/images/view-page-source-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/_static/jquery.js b/_static/jquery.js new file mode 100644 index 00000000..c4c6022f --- /dev/null +++ b/_static/jquery.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0t?(l&&(clearTimeout(l),l=null),a=c,s=e.apply(i,o),l||(i=o=null)):l||!1===n.trailing||(l=setTimeout(r,d)),s}},closest:function(e,t){var n,i;for(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"].some((function(e){return"function"==typeof document.body[e]&&(n=e,!0)}));e;){if((i=e.parentElement)&&i[n](t))return i;e=i}return null},offset:function(e){if(e&&(rect=e.getBoundingClientRect(),rect.width||rect.height||e.getClientRects().length)){var t=e.ownerDocument.documentElement;return{top:rect.top+window.pageYOffset-t.clientTop,left:rect.left+window.pageXOffset-t.clientLeft}}},headersHeight:function(){return document.getElementById("sphinx-template-left-menu").classList.contains("make-fixed")?document.getElementById("sphinx-template-page-level-bar").offsetHeight:document.getElementById("header-holder").offsetHeight+document.getElementById("sphinx-template-page-level-bar").offsetHeight},windowHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},getFixedOffset:function(){return document.getElementById("sphinx-template-page-level-bar").offsetHeight+0}}},{}],2:[function(e,t,n){var i={init:function(){i.bind(),i.cookieExists()||(i.setCookie(),i.showCookieNotice())},bind:function(){$(".close-button").on("click",i.hideCookieNotice)},cookieExists:function(){return!!localStorage.getItem("returningPytorchUser")},setCookie:function(){localStorage.setItem("returningPytorchUser",!0)},showCookieNotice:function(){$(".cookie-banner-wrapper").addClass("is-visible")},hideCookieNotice:function(){$(".cookie-banner-wrapper").removeClass("is-visible")}};$((function(){i.init()}))},{}],3:[function(e,t,n){window.highlightNavigation={navigationListItems:document.querySelectorAll("#sphinx-template-right-menu li"),sections:document.querySelectorAll(".sphinx-template-article section section, .sig.sig-object"),sectionIdTonavigationLink:{},bind:function(){if(sideMenus.displayRightMenu){for(var e=0;e=0;o--){var s=i[o];if(t>=utilities.offset(s).top-n){var l=highlightNavigation.sectionIdTonavigationLink[s.id],a=utilities.closest(l,"li");if(a&&!a.classList.contains("active")){for(o=0;o768&&mobileMenu.close()}))},close:function(){$(".mobile-main-menu").removeClass("open"),$("body").removeClass("no-scroll"),$(window).off("resize.ForMobileMenu")}}},{}],6:[function(e,t,n){window.mobileTOC={bind:function(){$("[data-behavior='toggle-table-of-contents']").on("click",(function(e){e.preventDefault();var t=$(this).parent();t.hasClass("is-open")?(t.removeClass("is-open"),$(".sphinx-template-left-menu").slideUp(200,(function(){$(this).css({display:""})}))):(t.addClass("is-open"),$(".sphinx-template-left-menu").slideDown(200))}))}}},{}],7:[function(e,t,n){window.scrollToAnchor={bind:function(){var e=window.document,t=window.history,n=window.location,i=!(!t||!t.pushState),o={ANCHOR_REGEX:/^#[^ ]+$/,init:function(){this.scrollToCurrent(),$(window).on("hashchange",$.proxy(this,"scrollToCurrent")),$("body").on("click","a",$.proxy(this,"delegateAnchors")),$("body").on("click","#sphinx-template-right-menu li span",$.proxy(this,"delegateSpans"))},scrollIfAnchor:function(o,s){var l;if(!this.ANCHOR_REGEX.test(o))return!1;if(l=e.getElementById(o.slice(1))){var a=$(l).offset().top-utilities.getFixedOffset();$("html, body").scrollTop(a),i&&s&&t.pushState({},e.title,n.pathname+o)}return!!l},scrollToCurrent:function(e){this.scrollIfAnchor(window.location.hash)&&e&&e.preventDefault()},delegateSpans:function(e){var t=utilities.closest(e.target,"a");this.scrollIfAnchor(t.getAttribute("href"),!0)&&e.preventDefault()},delegateAnchors:function(e){var t=e.target;this.scrollIfAnchor(t.getAttribute("href"),!0)&&e.preventDefault()}};$(e).ready($.proxy(o,"init"))}}},{}],8:[function(e,t,n){window.sideMenus={rightMenuIsOnScreen:function(){return null!==document.getElementById("sphinx-template-content-right").offsetParent},isFixedToBottom:!1,bind:function(){var e=document.querySelectorAll("#sphinx-template-right-menu li"),t=e.length>1;if(!t)for(var n=0;n ul > li > a.reference.internal");for(n=0;n0&&o.classList.add("has-children")}$("#sphinx-template-right-menu ul li ul li a.reference.internal").each((function(){if(this.nextElementSibling&&"UL"===this.nextElementSibling.tagName){var e=$(this),t=this.nextElementSibling;e.attr("aria-expanded","false");var n=$('');n.on("click",(function(n){return"true"===e.attr("aria-expanded")?(t.style.display="none",e.attr("aria-expanded","false")):(t.style.display="block",e.attr("aria-expanded","true")),n.stopPropagation(),!1})),e.prepend(n)}}));var s=document.querySelector('#sphinx-template-right-menu a[href="'+window.location.hash+'"]');s&&(s.nextElementSibling&&"UL"===s.nextElementSibling.tagName&&s.nextElementSibling.children.length>0&&(s.nextElementSibling.style.display="block",$(s).attr("aria-expanded","true")),sideMenus.expandClosestUnexpandedParentList(s)),sideMenus.handleNavBar(),sideMenus.handleLeftMenu(),sideMenus.rightMenuIsOnScreen()&&sideMenus.handleRightMenu()}$(window).on("resize scroll",(function(e){sideMenus.handleNavBar(),sideMenus.handleLeftMenu(),sideMenus.rightMenuIsOnScreen()&&sideMenus.handleRightMenu()}))},leftMenuIsFixed:function(){return document.getElementById("sphinx-template-left-menu").classList.contains("make-fixed")},handleNavBar:function(){var e=document.getElementById("header-holder").offsetHeight;utilities.scrollTop()>=e?(document.getElementById("sphinx-template-left-menu").classList.add("make-fixed"),document.getElementById("sphinx-template-page-level-bar").classList.add("left-menu-is-fixed")):(document.getElementById("sphinx-template-left-menu").classList.remove("make-fixed"),document.getElementById("sphinx-template-page-level-bar").classList.remove("left-menu-is-fixed"))},expandClosestUnexpandedParentList:function(e){var t=utilities.closest(e,"ul");if(t){var n=t.previousElementSibling;if(n&&"A"===n.tagName&&n.classList.contains("reference")){if(n.classList.contains("title-link"))return;t.style.display="block",$(n).attr("aria-expanded","true"),sideMenus.expandClosestUnexpandedParentList(n)}}},handleLeftMenu:function(){var e=utilities.windowHeight(),t=document.getElementById("docs-resources").getBoundingClientRect().top;if(t>=e)document.getElementById("sphinx-template-left-menu").style.height="100%";else{var n=e-t;document.getElementById("sphinx-template-left-menu").style.height=e-n+"px"}},handleRightMenu:function(){var e=document.getElementById("sphinx-template-content-right"),t=document.getElementById("sphinx-template-right-menu"),n=t.getElementsByTagName("ul")[0],i=document.getElementById("sphinx-template-article"),o=i.offsetHeight,s=utilities.offset(i).top+o,l=document.getElementById("header-holder").offsetHeight;if(utilities.scrollTop()=s&&(e.style.height=o+l+"px",t.style.top=utilities.scrollTop()-l+"px",t.classList.add("scrolling-absolute"),t.classList.remove("scrolling-fixed"),document.getElementById("sphinx-template-shortcuts-wrapper").style.display="none");else e.style.height=o+l+"px",t.style.top=s-l-n.offsetHeight+"px",t.classList.add("scrolling-absolute"),document.getElementById("sphinx-template-shortcuts-wrapper").style.display="none";utilities.scrollTop()"),e("table.docutils.footnote").wrap("
"),e("table.docutils.citation").wrap("
"),e(".sphinx-template-menu-vertical ul").not(".simple").siblings("a").each((function(){var n=e(this);expand=e(''),expand.on("click",(function(e){return t.toggleCurrent(n),e.stopPropagation(),!1})),n.prepend(expand)}))},reset:function(){var e=encodeURI(window.location.hash)||"#";try{var t=$(".sphinx-template-menu-vertical"),n=t.find('[href="'+e+'"]');if(0===n.length){var i=$('.document [id="'+e.substring(1)+'"]').closest("section section, .sig.sig-object");0===(n=t.find('[href="#'+i.attr("id")+'"]')).length&&(n=t.find('[href="#"]'))}if(n.length>0){$(".sphinx-template-menu-vertical .current").removeClass("current").attr("aria-expanded","false"),n.addClass("current").attr("aria-expanded","true"),n.closest("li.toctree-l1").parent().addClass("current").attr("aria-expanded","true");for(let e=1;e<=10;e++)n.closest("li.toctree-l"+e).addClass("current").attr("aria-expanded","true")}$(".sphinx-template-menu-vertical li.toctree-l1").attr("aria-expanded","true")}catch(o){console.log("Error expanding nav for anchor",o)}},onScroll:function(){this.winScroll=!1;var e=this.win.scrollTop(),t=e+this.winHeight,n=this.navBar.scrollTop()+(e-this.winPosition);e<0||t>this.docHeight||(this.navBar.scrollTop(n),this.winPosition=e)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(e){var t=e.closest("li");t.siblings("li.current").removeClass("current").attr("aria-expanded","false"),t.siblings().find("li.current").removeClass("current").attr("aria-expanded","false");var n=t.find("> ul li");n.length&&(n.removeClass("current").attr("aria-expanded","false"),t.addClass("current").attr("aria-expanded",(function(e,t){return"true"==t?"false":"true"})))}},i),"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:t.exports.ThemeNav,StickyNav:t.exports.ThemeNav}),function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n[ + ]"),$(this.firstChild).after("[ - ]"),$(this).next("ul").hide()):(0==collapsedSections.includes(t)&&e||"expand"==sessionStorage.getItem(t))&&($(this.firstChild).after("[ + ]"),$(this.firstChild).after("[ - ]"))})),$(".expand-menu").on("click",(function(){$(this).prev(".hide-menu").toggle(),$(this).parent().next("ul").toggle();var e=$(this).parent().text().replace(/[^\w\s]/gi,"").trim();"collapse"==sessionStorage.getItem(e)&&sessionStorage.removeItem(e),sessionStorage.setItem(e,"expand"),t(this)})),$(".hide-menu").on("click",(function(){$(this).next(".expand-menu").toggle(),$(this).parent().next("ul").toggle();var e=$(this).parent().text().replace(/[^\w\s]/gi,"").trim();"expand"==sessionStorage.getItem(e)&&sessionStorage.removeItem(e),sessionStorage.setItem(e,"collapse"),t(this)}))})),$(document).on("click",".page",(function(){$("html, body").animate({scrollTop:$("#dropdown-filter-tags").position().top},"slow")})),$(".stars-outer > i").hover((function(){$(this).prevAll().addBack().toggleClass("fas star-fill")})),$(".stars-outer > i").on("click",(function(){$(this).prevAll().each((function(){$(this).addBack().addClass("fas star-fill")})),$(".stars-outer > i").each((function(){$(this).unbind("mouseenter mouseleave").css({"pointer-events":"none"})}))})),$("#sphinx-template-side-scroll-right").on("click","a.reference.internal",(function(e){var t=$(this),n=t.attr("href").replaceAll(".","\\."),i=0;"#"!==n&&(i=$(n).offset().top-utilities.getFixedOffset()),prev_offset=$(window).scrollTop(),Math.abs(i-prev_offset)<10?t.children("button").trigger("click"):$("html").stop().animate({scrollTop:i},850),e.preventDefault(),e.stopPropagation()})),topMenu=$("#sphinx-template-side-scroll-right"),menuItems=topMenu.find("a[href^='#']"),scrollItems={};for(var o=0;o1&&$(s).length&&(scrollItems[s]=menuItems[o])}ArticleItems=$(Object.keys(scrollItems).join(", ")),findParent=function(e){return $(e).parent().parent().siblings("a.reference.internal")},makeHighlight=function(e){if(!$(e).hasClass("title-link")){$(e).addClass("side-scroll-highlight");var t=findParent(e);t.length&&makeHighlight(t)}},showHighlight=function(e){$(menuItems).removeClass("side-scroll-highlight"),$(menuItems).removeClass("current"),$(e).addClass("current"),makeHighlight(e),$("#sphinx-template-right-menu ul li ul li a.reference.internal[aria-expanded='true']").each((function(){this.nextElementSibling.style.display="none",$(this).attr("aria-expanded","false")})),sideMenus.expandClosestUnexpandedParentList(e)},initHighlight=function(){if(ArticleItems.length){for(var e=-1e10,t=-1,n=0;ne&&(e=i,t=n)}-1!==t&&showHighlight(scrollItems["#"+ArticleItems[t].id.replaceAll(".","\\.")])}},$(window).scroll(initHighlight),$(document).ready(initHighlight),$(window).on("hashchange",initHighlight)},{jquery:"jquery"}]},{},[1,2,3,4,5,6,7,8,"trojanzoo-sphinx-theme",9]); \ No newline at end of file diff --git a/_static/js/vendor/anchor.min.js b/_static/js/vendor/anchor.min.js new file mode 100644 index 00000000..1216eeac --- /dev/null +++ b/_static/js/vendor/anchor.min.js @@ -0,0 +1,9 @@ +// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat +// +// AnchorJS - v4.3.0 - 2020-10-21 +// https://www.bryanbraun.com/anchorjs/ +// Copyright (c) 2020 Bryan Braun; Licensed MIT +// +// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat +!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function d(A){A.icon=Object.prototype.hasOwnProperty.call(A,"icon")?A.icon:"",A.visible=Object.prototype.hasOwnProperty.call(A,"visible")?A.visible:"hover",A.placement=Object.prototype.hasOwnProperty.call(A,"placement")?A.placement:"right",A.ariaLabel=Object.prototype.hasOwnProperty.call(A,"ariaLabel")?A.ariaLabel:"Anchor",A.class=Object.prototype.hasOwnProperty.call(A,"class")?A.class:"",A.base=Object.prototype.hasOwnProperty.call(A,"base")?A.base:"",A.truncate=Object.prototype.hasOwnProperty.call(A,"truncate")?Math.floor(A.truncate):64,A.titleText=Object.prototype.hasOwnProperty.call(A,"titleText")?A.titleText:""}function f(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new TypeError("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],d(this.options),this.isTouchDevice=function(){return Boolean("ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,o,n,i,s,a,r,c,l,h,u,p=[];if(d(this.options),"touch"===(h=this.options.visible)&&(h=this.isTouchDevice()?"always":"hover"),0===(e=f(A=A||"h2, h3, h4, h5, h6")).length)return this;for(!function(){if(null!==document.head.querySelector("style.anchorjs"))return;var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(e):document.head.insertBefore(e,A);e.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",e.sheet.cssRules.length),e.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",e.sheet.cssRules.length),e.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",e.sheet.cssRules.length),e.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',e.sheet.cssRules.length)}(),t=document.querySelectorAll("[id]"),o=[].map.call(t,function(A){return A.id}),i=0;i\]./()*\\\n\t\b\v\u00A0]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}}); +// @license-end \ No newline at end of file diff --git a/_static/js/vendor/bootstrap.min.js b/_static/js/vendor/bootstrap.min.js new file mode 100644 index 00000000..c4c0d1f9 --- /dev/null +++ b/_static/js/vendor/bootstrap.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v4.3.1 (https://getbootstrap.com/) + * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;nthis._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=ndocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:''}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t=o.clientWidth&&n>=o.clientHeight}),l=0a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-us[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f]),E=parseFloat(w['border'+f+'Width']),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,$(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ce.FLIP:p=[n,i];break;case ce.CLOCKWISE:p=G(n);break;case ce.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)f(l.top)||'bottom'===n&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.rightwindow.devicePixelRatio||!fe),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={"x-placement":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ge}); +//# sourceMappingURL=popper.min.js.map diff --git a/_static/katex-math.css b/_static/katex-math.css new file mode 100644 index 00000000..bdd1634d --- /dev/null +++ b/_static/katex-math.css @@ -0,0 +1,50 @@ +/* Responsives: make equations scrollable on small screens. + * See: https://github.com/Khan/KaTeX/issues/327 */ +.katex-display > .katex { + max-width: 100%; +} +.katex-display > .katex > .katex-html { + max-width: 100%; + overflow-x: auto; + overflow-y: hidden; + padding-left: 2px; + padding-right: 2px; + padding-bottom: 1px; + padding-top: 3px; +} +/* Increase margin around equations */ +.katex-display { + margin: 1.2em 0; +} +/* Equation number floats to the right and shows permalink for mouse hover + on the right side of equation number. */ +div.math { + position: relative; + padding-right: 2.5em; +} +.eqno { + height: 100%; + position: absolute; + right: 0; + padding-left: 5px; + padding-bottom: 5px; + padding-right: 1px; +} +.eqno:before { + /* Force vertical alignment of number */ + display: inline-block; + height: 100%; + vertical-align: middle; + content: ""; +} +.eqno .headerlink { + display: none; + visibility: hidden; + font-size: 14px; + padding-left: .3em; +} +.eqno:hover .headerlink { + display: inline-block; + visibility: visible; + margin-right: -1.05em; +} diff --git a/_static/language_data.js b/_static/language_data.js new file mode 100644 index 00000000..250f5665 --- /dev/null +++ b/_static/language_data.js @@ -0,0 +1,199 @@ +/* + * language_data.js + * ~~~~~~~~~~~~~~~~ + * + * This script contains the language-specific data used by searchtools.js, + * namely the list of stopwords, stemmer, scorer and splitter. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; + + +/* Non-minified version is copied as a separate JS file, is available */ + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + diff --git a/_static/logo/trojanzoo-logo-dark.svg b/_static/logo/trojanzoo-logo-dark.svg new file mode 100644 index 00000000..ad6e3730 --- /dev/null +++ b/_static/logo/trojanzoo-logo-dark.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_static/logo/trojanzoo-logo-icon.svg b/_static/logo/trojanzoo-logo-icon.svg new file mode 100644 index 00000000..e0537f0a --- /dev/null +++ b/_static/logo/trojanzoo-logo-icon.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + diff --git a/_static/logo/trojanzoo-logo.svg b/_static/logo/trojanzoo-logo.svg new file mode 100644 index 00000000..8a9b74ee --- /dev/null +++ b/_static/logo/trojanzoo-logo.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_static/minus.png b/_static/minus.png new file mode 100644 index 00000000..d96755fd Binary files /dev/null and b/_static/minus.png differ diff --git a/_static/plus.png b/_static/plus.png new file mode 100644 index 00000000..7107cec9 Binary files /dev/null and b/_static/plus.png differ diff --git a/_static/pygments.css b/_static/pygments.css new file mode 100644 index 00000000..0d49244e --- /dev/null +++ b/_static/pygments.css @@ -0,0 +1,75 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #eeffcc; } +.highlight .c { color: #408090; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #333333 } /* Generic.Output */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0044DD } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #208050 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mb { color: #208050 } /* Literal.Number.Bin */ +.highlight .mf { color: #208050 } /* Literal.Number.Float */ +.highlight .mh { color: #208050 } /* Literal.Number.Hex */ +.highlight .mi { color: #208050 } /* Literal.Number.Integer */ +.highlight .mo { color: #208050 } /* Literal.Number.Oct */ +.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #06287e } /* Name.Function.Magic */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ +.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/_static/searchtools.js b/_static/searchtools.js new file mode 100644 index 00000000..7918c3fa --- /dev/null +++ b/_static/searchtools.js @@ -0,0 +1,574 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for the full-text search. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _displayItem = (item, searchTerms, highlightTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; + + const [docName, title, anchor, descr, score, _filename] = item; + + let listItem = document.createElement("li"); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = contentRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = contentRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = title; + if (descr) { + listItem.appendChild(document.createElement("span")).innerHTML = + " (" + descr + ")"; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + } + else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms) + ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." + ); + else + Search.status.innerText = _( + `Search finished, found ${resultCount} page(s) matching the search query.` + ); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms, + highlightTerms, +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms, highlightTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + 5 + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter(term => term) // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString) => { + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent !== undefined) return docContent.textContent; + console.warn( + "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + /** + * execute search (requires search index to be loaded) + */ + query: (query) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords array is from language_data.js + if ( + stopwords.indexOf(queryTermLower) !== -1 || + queryTerm.match(/^\d+$/) + ) + return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + // array of [docname, title, anchor, descr, score, filename] + let results = []; + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + let score = Math.round(100 * queryLower.length / title.length) + results.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id] of foundEntries) { + let score = Math.round(100 * queryLower.length / entry.length) + results.push([ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // lookup as object + objectTerms.forEach((term) => + results.push(...Search.performObjectSearch(term, objectTerms)) + ); + + // lookup as search terms in fulltext + results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); + + // now sort the results by score (in opposite order of appearance, since the + // display function below uses pop() to retrieve items) and then + // alphabetically + results.sort((a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; + }); + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + results = results.reverse(); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms, highlightTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4] + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => + objectSearchCallback(prefix, array) + ) + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + const arr = [ + { files: terms[word], score: Scorer.term }, + { files: titleTerms[word], score: Scorer.title }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord) && !terms[word]) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord) && !titleTerms[word]) + arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); + }); + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, {}); + scoreMap.get(file)[word] = record.score; + }); + }); + + // create the mapping + files.forEach((file) => { + if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); + else fileMap.set(file, [word]); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2 + ).length; + if ( + wordList.length !== searchTerms.size && + wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file || + titleTerms[term] === file || + (terms[term] || []).includes(file) || + (titleTerms[term] || []).includes(file) + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w])); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords) => { + const text = Search.htmlToText(htmlText); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/_static/sphinx_highlight.js b/_static/sphinx_highlight.js new file mode 100644 index 00000000..8a96c69a --- /dev/null +++ b/_static/sphinx_highlight.js @@ -0,0 +1,154 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore( + span, + parent.insertBefore( + rest, + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/genindex.html b/genindex.html new file mode 100644 index 00000000..776f579a --- /dev/null +++ b/genindex.html @@ -0,0 +1,1327 @@ + + + + + + + + + + + + + + + Index — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ + +

Index

+ +
+ _ + | A + | B + | C + | D + | E + | F + | G + | I + | K + | L + | M + | N + | O + | P + | R + | S + | T + | U + | V + | W + | Z + +
+

_

+ + + +
+ +

A

+ + + +
+ +

B

+ + + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

I

+ + + +
+ +

K

+ + + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + + +
+ +

P

+ + + +
+ +

R

+ + + +
+ +

S

+ + + +
+ +

T

+ + + +
+ +

U

+ + + +
+ +

V

+ + + +
+ +

W

+ + +
+ +

Z

+ + +
+ + + +
+ +
+ + +
+
+ +
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 00000000..21177b1e --- /dev/null +++ b/index.html @@ -0,0 +1,525 @@ + + + + + + + + + + + + + + + + TrojanZoo documentation — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

TrojanZoo documentation

+

TrojanZoo is a universal pytorch platform for conducting security researches (especially for backdoor attacks/defenses) for image classification in deep learning.

+
+

Tutorials

+ +
+ +
+
+

Indices and tables

+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/objects.inv b/objects.inv new file mode 100644 index 00000000..21f1f665 Binary files /dev/null and b/objects.inv differ diff --git a/py-modindex.html b/py-modindex.html new file mode 100644 index 00000000..544ccb4e --- /dev/null +++ b/py-modindex.html @@ -0,0 +1,472 @@ + + + + + + + + + + + + + + + Python Module Index — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
    +
  • Docs >
  • +
  • Python Module Index
  • +
  • +
  • +
+
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+ + +
+ + +
+
+ +
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/search.html b/search.html new file mode 100644 index 00000000..1d715fe3 --- /dev/null +++ b/search.html @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + Search — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ + + + +
+ +
+ +
+ +
+ + +
+
+ +
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/searchindex.js b/searchindex.js new file mode 100644 index 00000000..5f0390dc --- /dev/null +++ b/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"docnames": ["index", "trojanvision/attacks/adv", "trojanvision/attacks/backdoor/clean_label", "trojanvision/attacks/backdoor/dynamic", "trojanvision/attacks/backdoor/index", "trojanvision/attacks/backdoor/normal", "trojanvision/attacks/index", "trojanvision/configs", "trojanvision/datasets/folder", "trojanvision/datasets/index", "trojanvision/datasets/normal", "trojanvision/defenses/adv", "trojanvision/defenses/backdoor/attack_agnostic", "trojanvision/defenses/backdoor/index", "trojanvision/defenses/backdoor/input_filtering", "trojanvision/defenses/backdoor/model_inspection", "trojanvision/defenses/backdoor/training_filtering", "trojanvision/defenses/index", "trojanvision/environ", "trojanvision/index", "trojanvision/marks", "trojanvision/models/index", "trojanvision/models/nas", "trojanvision/models/others", "trojanvision/models/torchvision", "trojanvision/optim", "trojanvision/trainer", "trojanvision/utils", "trojanzoo/attacks", "trojanzoo/configs", "trojanzoo/datasets", "trojanzoo/defenses", "trojanzoo/environ", "trojanzoo/index", "trojanzoo/models", "trojanzoo/optim", "trojanzoo/trainer", "trojanzoo/utils/data", "trojanzoo/utils/fim", "trojanzoo/utils/index", "trojanzoo/utils/logger", "trojanzoo/utils/model", "trojanzoo/utils/module", "trojanzoo/utils/tensor", "trojanzoo/utils/train", "tutorials/basic"], "filenames": ["index.rst", "trojanvision/attacks/adv.rst", "trojanvision/attacks/backdoor/clean_label.rst", "trojanvision/attacks/backdoor/dynamic.rst", "trojanvision/attacks/backdoor/index.rst", "trojanvision/attacks/backdoor/normal.rst", "trojanvision/attacks/index.rst", "trojanvision/configs.rst", "trojanvision/datasets/folder.rst", "trojanvision/datasets/index.rst", "trojanvision/datasets/normal.rst", "trojanvision/defenses/adv.rst", "trojanvision/defenses/backdoor/attack_agnostic.rst", "trojanvision/defenses/backdoor/index.rst", "trojanvision/defenses/backdoor/input_filtering.rst", "trojanvision/defenses/backdoor/model_inspection.rst", "trojanvision/defenses/backdoor/training_filtering.rst", "trojanvision/defenses/index.rst", "trojanvision/environ.rst", "trojanvision/index.rst", "trojanvision/marks.rst", "trojanvision/models/index.rst", "trojanvision/models/nas.rst", "trojanvision/models/others.rst", "trojanvision/models/torchvision.rst", "trojanvision/optim.rst", "trojanvision/trainer.rst", "trojanvision/utils.rst", "trojanzoo/attacks.rst", "trojanzoo/configs.rst", "trojanzoo/datasets.rst", "trojanzoo/defenses.rst", "trojanzoo/environ.rst", "trojanzoo/index.rst", "trojanzoo/models.rst", "trojanzoo/optim.rst", "trojanzoo/trainer.rst", "trojanzoo/utils/data.rst", "trojanzoo/utils/fim.rst", "trojanzoo/utils/index.rst", "trojanzoo/utils/logger.rst", "trojanzoo/utils/model.rst", "trojanzoo/utils/module.rst", "trojanzoo/utils/tensor.rst", "trojanzoo/utils/train.rst", "tutorials/basic.rst"], "titles": ["TrojanZoo documentation", "adv", "clean_label", "dynamic", "backdoor", "normal", "attacks", "configs", "folder", "datasets", "normal", "adv", "attack_agnostic", "backdoor", "input_filtering", "model_inspection", "training_filtering", "defenses", "environ", "trojanvision", "marks", "models", "nas", "others", "torchvision", "optim", "trainer", "utils", "attacks", "configs", "datasets", "defenses", "environ", "trojanzoo", "models", "optim", "trainer", "data", "fim", "utils", "logger", "model", "module", "tensor", "train", "basic"], "terms": {"i": [0, 2, 3, 5, 6, 7, 9, 12, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 26, 28, 29, 30, 31, 32, 34, 36, 37, 39, 40, 41, 42, 43, 45], "univers": [0, 2, 5, 14, 15, 22, 23, 24, 43], "pytorch": [0, 8, 9, 22, 30, 34, 38, 40, 41], "platform": [0, 22, 24], "conduct": [0, 2, 5, 16, 24], "secur": 0, "research": [0, 3, 16, 22, 24], "especi": 0, "backdoor": [0, 2, 3, 5, 6, 12, 14, 15, 16, 17, 19, 20], "attack": [0, 2, 3, 5, 12, 14, 15, 16, 17, 19, 20, 21, 23, 31, 33, 42, 45], "defens": [0, 12, 14, 15, 16, 19, 23, 33, 42, 45], "imag": [0, 2, 3, 5, 6, 8, 9, 10, 12, 14, 20, 21, 23, 24, 30], "classif": [0, 3, 5, 8, 14, 28, 34, 40, 41], "deep": [0, 2, 5, 16, 24], "learn": [0, 2, 5, 10, 14, 17, 22, 24, 34], "basic": [0, 9, 21, 38, 42], "config": [0, 6, 9, 17, 18, 19, 20, 21, 26, 28, 30, 31, 32, 33, 34, 36, 42], "dataset": [0, 2, 6, 8, 10, 17, 19, 20, 21, 22, 23, 24, 28, 29, 31, 32, 33, 34, 36, 37, 42, 45], "environ": [0, 19, 21, 33, 45], "model": [0, 2, 3, 5, 6, 9, 12, 14, 15, 17, 19, 22, 23, 24, 28, 31, 32, 33, 36, 39, 42, 44, 45], "optim": [0, 3, 5, 15, 17, 19, 22, 33, 34, 36, 41, 42, 44], "trainer": [0, 19, 33, 45], "util": [0, 2, 5, 6, 9, 14, 17, 19, 21, 22, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44], "data": [0, 2, 3, 5, 6, 8, 9, 12, 15, 16, 17, 20, 21, 22, 23, 30, 32, 33, 34, 39, 40], "fim": [0, 33, 39], "logger": [0, 14, 17, 33, 39, 44], "modul": [0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 38, 39, 41, 44], "tensor": [0, 2, 3, 5, 6, 9, 14, 15, 16, 17, 20, 21, 28, 30, 32, 33, 34, 35, 37, 38, 39, 41], "train": [0, 2, 3, 5, 6, 9, 10, 12, 16, 17, 21, 22, 23, 30, 33, 34, 36, 37, 39, 40], "trojanvis": [0, 2, 3, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 26, 29, 45], "adv": [0, 6, 17, 19], "normal": [0, 3, 4, 6, 9, 19, 21, 34, 41, 43], "clean_label": [0, 4, 6, 19], "dynam": [0, 4, 6, 15, 19], "folder": [0, 9, 19, 30, 34, 42], "attack_agnost": [0, 13, 17, 19], "input_filt": [0, 13, 17, 19], "training_filt": [0, 13, 17, 19], "model_inspect": [0, 13, 17, 19], "mark": [0, 2, 3, 5, 6, 14, 15, 17, 19, 45], "torchvis": [0, 8, 9, 10, 19, 21, 34, 37, 41], "na": [0, 19, 21], "other": [0, 2, 3, 5, 16, 19, 21, 34, 35, 38, 41], "index": [0, 5, 6, 17, 28, 34, 37, 41], "class": [2, 3, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 20, 21, 22, 23, 24, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42], "invisiblepoison": [2, 4, 6], "generator_mod": 2, "default": [2, 3, 5, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 22, 23, 26, 28, 29, 30, 31, 32, 34, 35, 36, 37, 39, 40, 41, 42, 43], "noise_coeff": 2, "0": [2, 3, 5, 6, 8, 9, 10, 12, 14, 15, 16, 17, 20, 21, 22, 23, 24, 29, 30, 32, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45], "35": [2, 16], "train_generator_epoch": 2, "800": 2, "kwarg": [2, 3, 5, 6, 8, 9, 10, 12, 14, 15, 16, 17, 20, 21, 22, 23, 24, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 45], "sourc": [2, 3, 5, 6, 8, 9, 10, 12, 14, 15, 16, 17, 20, 21, 22, 23, 24, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "invis": 2, "poison": [2, 3, 5, 6, 14, 15, 16, 17], "propos": [2, 3, 5, 14, 15, 16, 22, 23, 24], "rui": 2, "ning": 2, "from": [2, 3, 5, 6, 9, 10, 14, 15, 16, 17, 20, 21, 22, 23, 24, 28, 29, 30, 31, 32, 34, 36, 37, 39, 41, 42, 43], "old": [2, 9], "dominion": 2, "infocom": 2, "2021": [2, 24], "base": [2, 3, 5, 9, 10, 12, 22, 24, 28, 29, 34, 38, 40, 41, 42], "cleanlabelbackdoor": [2, 6], "preprocess": [2, 5, 9, 34], "trigger": [2, 3, 5, 6, 14, 15, 17], "gener": [2, 3, 5, 14, 15, 22, 28, 34, 40, 41, 42, 43], "auto": [2, 3, 20, 32], "encod": [2, 3], "amplifi": [2, 5], "its": [2, 14, 16, 17, 29, 32, 34], "featur": [2, 3, 5, 6, 10, 12, 16, 24, 34, 41], "activ": [2, 5, 6, 12, 16, 23, 34], "make": [2, 24, 41], "paper": [2, 3, 5, 8, 10, 12, 14, 15, 16, 22, 23, 24], "A": [2, 5, 6, 8, 10, 15, 21, 30, 34, 36, 38, 39, 42], "blackbox": 2, "clean": [2, 3, 5, 6, 12, 17, 42], "label": [2, 5, 6, 9, 14, 15, 17, 21, 28, 30, 34, 37, 41], "neural": [2, 5, 15, 16, 22, 24], "network": [2, 5, 9, 10, 15, 16, 22, 24, 34, 38], "code": [2, 3, 5, 12, 14, 15, 16, 22, 24], "http": [2, 3, 5, 8, 10, 14, 15, 21, 22, 24, 34, 38, 40, 41], "github": [2, 3, 5, 8, 10, 14, 15, 21, 22, 24, 34, 38, 40, 41, 45], "com": [2, 3, 5, 8, 10, 14, 15, 21, 22, 24, 34, 38, 40, 41], "rigley007": 2, "invi_poison": 2, "paramet": [2, 3, 5, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 22, 23, 26, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43], "str": [2, 5, 6, 7, 8, 9, 10, 15, 16, 17, 20, 21, 22, 23, 28, 29, 30, 31, 32, 34, 35, 36, 39, 40, 41, 42], "choos": [2, 6, 16, 20, 21, 22, 23, 34, 36], "resnet_comp": [2, 24], "resnet": [2, 21, 24], "float": [2, 3, 5, 6, 8, 9, 10, 12, 14, 15, 16, 17, 20, 21, 22, 23, 30, 32, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44], "minifi": 2, "rate": [2, 5, 17, 22, 34], "adversari": [2, 5, 16, 21, 23, 35], "int": [2, 3, 5, 6, 8, 9, 10, 12, 14, 15, 16, 17, 20, 21, 22, 23, 28, 29, 30, 32, 34, 35, 37, 38, 39, 40, 41, 42, 43], "epoch": [2, 3, 5, 12, 17, 22, 34, 44, 45], "10": [2, 3, 10, 12, 15, 16, 17, 34, 37, 42, 44], "refool": [2, 4, 6], "candidate_num": 2, "100": [2, 3, 5, 10, 14, 15, 17, 30, 34], "rank_it": 2, "16": [2, 3, 10, 15], "refool_epoch": 2, "5": [2, 3, 5, 6, 9, 14, 15, 24, 30, 34, 37, 40, 41, 42, 43], "refool_lr": 2, "1e": [2, 5, 15, 17, 22, 41, 45], "3": [2, 3, 5, 8, 9, 10, 14, 17, 20, 21, 22, 23, 24, 30, 34, 37, 41], "refool_sample_perc": 2, "1": [2, 3, 5, 6, 9, 10, 15, 16, 17, 20, 21, 23, 24, 28, 32, 34, 35, 37, 38, 40, 41, 42, 43, 45], "voc_root": 2, "none": [2, 3, 5, 6, 9, 10, 14, 16, 17, 20, 21, 22, 23, 28, 29, 30, 31, 32, 34, 35, 36, 37, 39, 40, 41, 42, 43, 44], "effici": [2, 22, 24], "fals": [2, 3, 6, 8, 9, 12, 15, 17, 20, 21, 22, 28, 30, 32, 34, 36, 37, 38, 39, 41, 43, 44], "reflect": 2, "yunfei": 2, "liu": [2, 5, 15, 22], "beihang": 2, "eccv": [2, 22, 24], "2020": [2, 3, 5], "It": [2, 3, 5, 6, 8, 9, 10, 14, 15, 16, 17, 18, 20, 21, 22, 23, 26, 28, 29, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42], "inherit": [2, 5, 6, 8, 9, 10, 14, 15, 16, 17, 21, 28, 29, 30, 31, 32, 34, 35, 36, 37, 42], "size": [2, 5, 14, 16, 22, 30, 37, 41, 43], "must": 2, "same": [2, 20, 28, 34, 40, 41], "current": [2, 3, 5, 6, 15, 17, 29, 34, 35, 40, 42], "mark_alpha": [2, 6, 20], "forc": 2, "which": [2, 5, 9, 12, 16, 17, 20, 21, 28, 30, 31, 32, 34, 35, 36, 41, 42], "mean": [2, 3, 5, 8, 9, 10, 15, 16, 17, 20, 21, 30, 34, 35, 43], "us": [2, 3, 5, 6, 9, 10, 14, 16, 17, 18, 20, 21, 22, 24, 26, 28, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 43], "blend": 2, "them": [2, 5, 6, 12], "should": [2, 3, 5, 6, 21, 22, 32, 34, 35], "possibl": 2, "set": [2, 3, 5, 6, 15, 16, 17, 20, 21, 22, 24, 30, 32, 34, 37, 39, 41, 42], "manual": 2, "instead": [2, 3, 9, 20, 21, 22, 28, 30, 31, 32, 34, 36, 37, 38, 40, 41], "The": [2, 3, 5, 6, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 22, 23, 26, 28, 29, 30, 31, 32, 34, 35, 36, 37, 39, 40, 41, 42, 43], "ha": [2, 5, 12, 14, 29, 37], "procedur": [2, 5, 14, 16], "anoth": [2, 22], "public": 2, "e": [2, 3, 9, 10, 23, 29, 30, 32, 34, 35, 41], "g": [2, 9, 10, 23, 29, 30, 32, 34, 35, 41], "pascal": 2, "voc": 2, "candid": 2, "select": [2, 5, 34, 35, 41], "cat": [2, 3, 10], "background": [2, 20], "person": [2, 8], "find": [2, 5, 6], "all": [2, 5, 6, 9, 15, 16, 17, 21, 24, 28, 29, 34, 36, 37, 40, 41, 42, 43], "those": [2, 5, 41], "2": [2, 3, 5, 6, 9, 12, 14, 15, 16, 17, 20, 21, 22, 24, 30, 34, 37, 41, 45], "don": 2, "t": [2, 5, 15, 16, 20, 21, 22, 30, 34], "have": [2, 5, 8, 12, 30, 35], "object": [2, 5, 43], "For": [2, 5, 6, 9, 14, 15, 16, 20, 21, 28, 30, 31, 32, 34, 36], "pair": 2, "process": [2, 3, 9, 20, 30, 32, 34, 35, 39, 41, 42, 43], "ghost": 2, "effect": 2, "focal": 2, "blur": 2, "calcul": [2, 5, 6, 16, 21, 30, 34, 35, 37], "differ": [2, 3, 5, 9, 14, 16, 18, 20, 26, 29, 30, 34, 37, 40, 41], "between": [2, 3, 5, 6, 14], "structur": [2, 23, 41], "similar": [2, 3, 5, 41], "ssim": 2, "call": [2, 3, 5, 7, 15, 17, 20, 28, 29, 30, 32, 34, 35, 37, 39, 40, 41, 42], "skimag": [2, 5], "metric": [2, 16], "structural_similar": 2, "If": [2, 3, 6, 9, 14, 15, 17, 20, 21, 30, 34, 35, 37, 41, 42, 43], "rel": [2, 16], "larg": [2, 8, 24], "enough": 2, "veri": [2, 24], "dark": 2, "around": 2, "7": [2, 5, 8, 12, 15, 21, 24, 41], "85": 2, "ad": [2, 9, 20, 21, 23, 28, 30, 31, 32, 34, 36], "rank": [2, 28, 34, 41], "tent": 2, "multipl": [2, 10], "inject": [2, 6], "togeth": [2, 5, 20, 30, 37, 39, 42], "initi": [2, 9, 15, 20, 21, 30, 34, 41], "repeat": [2, 43], "assign": 2, "sampl": [2, 3, 5, 6, 9, 12, 14, 16, 17, 28, 34, 37, 41, 43], "weight": [2, 3, 5, 6, 15, 22, 30, 34, 41], "certain": [2, 6, 14, 30, 34, 37, 41], "amount": [2, 40], "40": 2, "origin": [2, 5, 6, 12, 14, 17, 20, 21, 30, 35], "target": [2, 5, 6, 16, 17, 22, 28, 30, 34, 37, 41], "randomli": [2, 6, 20, 37], "attach": [2, 3, 5, 6, 15, 17], "each": [2, 3, 5, 6, 14, 15, 16, 17, 30, 34, 37, 40, 41], "input": [2, 3, 5, 6, 9, 12, 14, 15, 17, 20, 21, 23, 28, 34, 35, 37, 41, 43], "accord": [2, 5, 8, 22, 34, 35, 42], "infect": [2, 6], "retrain": [2, 5, 6], "pretrain": [2, 34, 45], "evalu": [2, 14, 17, 21, 34, 44], "succ": 2, "new": [2, 5, 7, 9, 29, 32], "unus": [2, 5, 6, 9, 15, 30, 34, 35, 41], "median": [2, 40], "ones": [2, 30, 37], "reset": [2, 40, 41], "state": [2, 5, 15, 34], "time": [2, 40], "largest": 2, "final": [2, 6, 12, 29, 34, 40], "train_mod": [2, 5, 6, 17], "natur": [2, 3], "dreamtalecor": 2, "There": [2, 5, 7, 16, 20, 22, 29, 32], "ar": [2, 3, 5, 6, 12, 16, 20, 22, 30, 34, 41, 42], "our": [2, 5], "implement": [2, 5, 6, 9, 16, 20, 21, 22, 28, 30, 31, 32, 34, 36, 37, 41, 42], "ve": [2, 5], "consult": [2, 5], "first": [2, 3, 5, 12, 20, 22, 24, 30, 34, 37, 40, 41], "author": [2, 5, 12], "clarifi": [2, 5], "trojanzoo": [2, 5, 6, 7, 9, 14, 17, 18, 21, 26, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "work": [2, 5, 38], "": [2, 3, 5, 14, 15, 17, 20, 21, 29, 30, 34, 35, 39], "allow": 2, "dure": [2, 3, 5, 6, 22], "NO": 2, "160": 2, "actual": [2, 5, 6, 20], "usual": [2, 20, 29, 30, 34, 35], "reach": [2, 35], "thi": [2, 3, 5, 6, 9, 20, 21, 22, 28, 30, 31, 32, 34, 36, 37, 41, 42], "number": [2, 3, 5, 6, 9, 12, 14, 16, 17, 22, 24, 30, 32, 34, 40], "requir": [2, 3, 32, 36], "200": [2, 5, 8, 22], "caus": 2, "more": [2, 8, 9, 20, 21, 28, 30, 31, 32, 34, 36], "uniqu": [2, 3, 40], "600": 2, "too": [2, 40], "much": 2, "accuraci": [2, 34, 39, 41, 42, 44], "drop": [2, 30, 34], "slow": 2, "4": [2, 5, 9, 15, 16, 21, 22, 24, 30, 34, 37, 42], "everi": [2, 34, 38], "loop": 2, "howev": [2, 12], "mention": 2, "tell": 2, "me": 2, "thei": [2, 20], "load": [2, 3, 6, 17, 20, 22, 29, 30, 32, 34, 40], "imagenet": [2, 8, 9, 10, 40], "provid": [2, 6, 9, 17, 20, 21, 30, 34, 40], "after": [2, 5, 6, 24], "also": [2, 3, 17, 35], "conflict": [2, 5], "claim": [2, 5, 8, 21, 30, 34], "top": [2, 5, 6, 34, 41], "algorithm": [2, 22], "random": [2, 5, 6, 9, 14, 20, 21, 22, 23, 30, 32, 34, 37], "w": [2, 3, 5, 9, 14, 15, 16, 17, 20, 21, 30, 34], "follow": [2, 5, 24, 45], "iter": [2, 17, 21, 34, 35, 40, 41, 42, 44], "updat": [2, 24, 29, 38, 40, 42], "percentag": [2, 3, 6, 14], "path": [2, 7, 17, 20, 21, 22, 29, 30, 34, 42], "data_dir": [2, 9, 30], "bool": [2, 3, 6, 8, 9, 10, 14, 17, 20, 21, 22, 28, 30, 32, 34, 36, 37, 38, 39, 40, 41, 43], "whether": [2, 3, 6, 9, 10, 14, 17, 20, 21, 22, 30, 32, 34, 36, 37, 39, 40, 41, 43], "onli": [2, 5, 6, 16, 18, 20, 21, 24, 26, 34, 41, 42], "subset": [2, 9, 30, 37], "20": [2, 5, 15, 22, 35, 40, 42], "asr": [2, 14, 15, 17], "variabl": [2, 3, 5, 6, 8, 9, 10, 14, 15, 17, 20, 21, 22, 29, 30, 31, 32, 34, 36, 38, 40, 42], "reflect_img": 2, "torch": [2, 3, 5, 6, 9, 14, 15, 16, 17, 20, 21, 22, 24, 28, 30, 32, 34, 35, 36, 37, 38, 39, 41, 43], "shape": [2, 3, 5, 9, 14, 15, 16, 17, 20, 21, 28, 34, 35, 37, 41, 43], "c": [2, 3, 5, 9, 10, 14, 15, 16, 17, 20, 21, 34, 41], "h": [2, 3, 5, 9, 14, 15, 17, 20, 21, 34], "mode": [2, 3, 6, 9, 10, 21, 30, 34, 35], "see": [2, 6, 9, 20, 21, 28, 30, 31, 32, 34, 36, 41], "detail": [2, 9, 12, 36], "descript": 2, "badnet": [2, 3, 4, 5, 6, 45], "poison_set": [2, 6, 17], "becaus": [2, 5, 34], "best": 2, "keep": [2, 3, 6, 41], "unknown": [2, 42], "refool_sample_num": 2, "len": [2, 5, 6, 17, 30, 34, 37, 40], "target_set": 2, "add_mark": [2, 3, 6, 20], "x": [2, 3, 6, 22, 34, 37, 38, 41, 43], "add": [2, 3, 5, 6, 9, 20, 21, 28, 30, 31, 32, 34, 36, 43], "watermark": [2, 3, 5, 6, 14, 17, 20], "self": [2, 3, 5, 6, 8, 9, 10, 14, 16, 17, 20, 24, 29, 30, 34, 35, 40, 42], "inputawaredynam": [3, 4, 6], "train_mask_epoch": 3, "25": 3, "lambda_div": 3, "lambda_norm": 3, "mask_dens": 3, "032": 3, "cross_perc": 3, "poison_perc": [3, 5, 6, 17], "awar": [3, 24], "anh": 3, "nguyen": 3, "tran": 3, "vinai": 3, "nip": [3, 24], "mask": [3, 14, 15, 17], "synthes": 3, "In": [3, 20], "loss": [3, 5, 6, 15, 17, 22, 30, 34, 35, 44], "besid": 3, "classifi": [3, 5, 6, 15, 22, 24, 34, 41], "still": [3, 5, 20, 34], "correctli": 3, "cross": 3, "vinairesearch": 3, "releas": 3, "begin": [3, 5], "align": 3, "textbf": 3, "opt": 3, "_": [3, 5, 24], "text": [3, 5, 6, 30, 40], "adam": [3, 5], "g_": 3, "lr": [3, 34, 45], "01": [3, 5, 6, 10, 15, 34], "beta": 3, "9": [3, 42], "_mask": 3, "_epoch": [3, 34, 44], "hspace": 3, "5mm": 3, "x_1": 3, "_set": 3, "10mm": 3, "x_2": 3, "_anoth": 3, "_batch": 3, "mathcal": [3, 5], "l": [3, 5], "div": [3, 21, 43], "frac": [3, 6, 21, 30, 40], "lvert": 3, "rvert": 3, "norm": [3, 15, 17, 38], "relu": [3, 5, 23, 24, 34, 41], "_densiti": 3, "lambda_": 3, "step": [3, 22], "rule": 3, "110mm": 3, "4pt": 3, "y_1": 3, "n_": 3, "x_": 3, "cdot": 3, "y": [3, 5, 15, 22, 37, 41], "y_": 3, "ce": [3, 5], "_entropi": 3, "end": [3, 17, 35, 42], "divers": 3, "both": [3, 34], "when": [3, 15, 16, 20, 21, 30, 34, 37, 39, 40, 42, 43], "threshold": [3, 14, 15, 16, 32, 35, 39], "valu": [3, 5, 6, 9, 12, 15, 20, 21, 28, 29, 30, 31, 32, 34, 36, 39, 40, 41, 42, 43], "whole": [3, 6, 17, 34], "true": [3, 6, 8, 17, 20, 21, 24, 30, 34, 37, 39, 40, 41, 43, 44], "frozen": [3, 34, 41], "mark_gener": 3, "nn": [3, 21, 24, 34, 38, 41], "sequenti": [3, 24, 34, 41], "instanc": [3, 6, 7, 9, 20, 21, 28, 29, 30, 31, 32, 34, 36, 42], "construct": [3, 17, 21], "define_gener": 3, "output": [3, 5, 14, 17, 21, 32, 34, 35, 39, 40, 41, 42], "n": [3, 5, 6, 16, 17, 20, 21, 28, 34, 35, 38, 40, 41, 43], "mask_gener": 3, "do": [3, 5, 7, 29, 32], "NOT": [3, 5, 34, 37, 40], "directli": [3, 6, 30, 34], "Their": [3, 5], "raw": [3, 40], "rang": [3, 5, 20, 22, 30, 37, 43], "pleas": [3, 5, 9, 20, 21, 28, 30, 31, 32, 34, 36], "get_mark": 3, "get_mask": [3, 17], "static": [3, 5, 9, 20, 29, 30, 34, 42], "num_channel": 3, "32": [3, 8, 10, 23, 30, 34, 37, 44], "64": [3, 14, 24, 41], "128": [3, 41], "in_channel": [3, 5], "out_channel": [3, 22], "defin": [3, 5, 7, 15, 34, 43], "compos": [3, 9, 10, 16, 21, 37, 42], "down": 3, "middl": [3, 35, 40, 42], "up": 3, "conv": [3, 22, 24, 41], "bn": [3, 21], "c_": 3, "maxpool": [3, 24, 41], "upsampl": 3, "list": [3, 5, 8, 9, 10, 15, 16, 17, 20, 23, 29, 30, 34, 36, 37, 40, 41, 42], "intermedi": [3, 24, 34, 41], "element": [3, 5, 34, 37, 41], "serv": [3, 5, 34], "layer": [3, 5, 9, 10, 12, 21, 22, 23, 24, 34, 38, 41], "out_featur": [3, 34, 41], "preced": [3, 34], "mnist": [3, 9, 10, 23, 37], "cifar": [3, 10, 22], "channel": [3, 20, 21, 23, 24], "last": [3, 5, 20, 30, 34, 40], "return": [3, 5, 6, 9, 10, 14, 15, 16, 17, 20, 21, 28, 29, 30, 31, 32, 34, 35, 36, 37, 40, 41, 42, 43, 44], "get_data": [3, 6, 9, 21, 30, 34], "org": [3, 6, 8], "keep_org": [3, 6], "poison_label": [3, 6], "get": [3, 5, 6, 9, 10, 14, 15, 16, 17, 20, 21, 29, 30, 34, 37, 41, 42], "method": [3, 5, 6, 7, 9, 16, 20, 21, 28, 29, 30, 31, 32, 34, 35, 37, 41, 42], "replac": 3, "some": [3, 6, 12, 20], "version": [3, 17, 20, 34], "while": [3, 6, 34], "append": [3, 6, 40], "get_filenam": [3, 6, 17], "target_class": [3, 5, 6], "filenam": [3, 6, 17], "_input": [3, 17, 20, 21, 28, 34, 35, 41], "_gener": 3, "tanh": [3, 5, 43], "result": [3, 5, 6, 16, 34, 42], "previous": [3, 6], "save": [3, 6, 9, 30, 34, 44], "file": [3, 6, 8, 9, 15, 20, 22, 29, 30, 34, 45], "train_mask_gener": 3, "verbos": [3, 17, 30, 32, 34, 40, 41, 42, 44, 45], "trojannn": [4, 5, 6], "imc": [4, 5, 6], "latentbackdoor": [4, 5, 6], "trojannet": [4, 5, 6], "source_class": [5, 6], "batch": [5, 6, 9, 20, 21, 28, 30, 34, 35, 37, 41, 43], "tianyu": 5, "gu": 5, "york": 5, "2017": [5, 10, 23, 24], "backdoorattack": [5, 6], "equival": [5, 6, 18, 26], "identifi": [5, 15], "vulner": 5, "machin": [5, 14, 32], "suppli": 5, "chain": 5, "preprocess_lay": 5, "flatten": [5, 24, 34, 41], "preprocess_next_lay": 5, "fc": [5, 34, 41], "target_valu": 5, "neuron_num": 5, "neuron_lr": 5, "neuron_epoch": 5, "1000": [5, 8, 9, 10, 15, 34, 41], "yingqi": [5, 15], "purdu": [5, 15], "ndss": 5, "2018": [5, 8, 22, 24], "pixel": [5, 14, 20], "maxim": 5, "well": [5, 16, 17, 34, 36, 42], "connect": [5, 21, 24], "neuron": [5, 6, 12], "trojan": [5, 15], "purduepaml": 5, "websit": [5, 8, 10], "io": [5, 10, 21], "chosen": [5, 16], "next": 5, "denois": 5, "img": [5, 14, 21], "max_num_it": 5, "ep": [5, 21, 38, 41], "restor": [5, 15], "denoise_tv_bregman": 5, "preprocess_mark": 5, "perform": [5, 38], "observ": 5, "noisi": [5, 43], "get_neuron_idx": 5, "r": [5, 16, 21, 30, 34, 38], "get_neuron_valu": 5, "trigger_input": 5, "neuron_idx": 5, "averag": [5, 6, 23, 24, 36, 38, 40, 41], "map": [5, 6, 9, 16, 21, 28, 29, 30, 31, 34, 42], "obtain": 5, "get_lay": [5, 34, 39, 41], "maxmiz": 5, "lr_schedul": [5, 34, 36, 44], "cosineannealinglr": [5, 34], "funcion": 5, "imagemodel": [5, 6, 21], "attack_remask_epoch": 5, "attack_remask_lr": 5, "co": 5, "ren": 5, "pang": 5, "pennsylvania": 5, "cc": [5, 15, 23], "tale": 5, "evil": 5, "twin": 5, "versu": 5, "offici": [5, 21, 22, 34], "inner": 5, "optimize_mark": [5, 15, 17], "loss_fn": [5, 34, 35, 44], "class_sample_num": 5, "mse_weight": 5, "latent": 5, "yuanshun": 5, "yao": 5, "huii": 5, "li": [5, 8], "haitao": 5, "zheng": 5, "ben": [5, 15], "zhao": [5, 15], "chicago": [5, 15], "2019": [5, 14, 15, 16, 22, 24], "minim": 5, "mse": 5, "distanc": [5, 16], "formula": 5, "_weight": 5, "sandlab": 5, "uchicago": 5, "edu": [5, 8, 10], "doe": [5, 40], "involv": 5, "teacher": 5, "student": 5, "transfer": 5, "nor": 5, "task": [5, 22], "main": [5, 12, 20, 28, 31, 35, 40, 41], "contribut": 5, "applic": 5, "scenario": 5, "focus": 5, "problem": 5, "user": [5, 7, 9, 20, 21, 28, 29, 30, 31, 32, 34, 36], "who": 5, "demand": [5, 21], "get_avg_target_feat": 5, "target_input": 5, "target_label": 5, "other_input": 5, "other_label": 5, "sample_data": 5, "dict": [5, 6, 7, 8, 9, 10, 15, 21, 28, 29, 30, 31, 32, 34, 35, 36, 40, 41, 42], "tupl": [5, 6, 9, 14, 21, 34, 37, 41], "select_point": 5, "mlp_alpha": 5, "comb_temperatur": 5, "amplify_r": 5, "train_noise_num": 5, "valid_noise_num": 5, "2000": 5, "ruixiang": 5, "tang": 5, "texa": 5, "m": [5, 41, 42], "univeristi": 5, "kdd": 5, "b": 5, "black": [5, 20], "syn_trigger_candid": 5, "num_class": [5, 8, 9, 10, 17, 24, 30, 34, 44], "correspond": [5, 17, 34], "small": [5, 16, 24], "mlp": 5, "nois": [5, 21, 23, 43], "_mlpnet": 5, "auxiliari": [5, 22, 34, 39, 41], "stand": [5, 30, 34, 41], "without": [5, 21, 32], "binari": 5, "combin": [5, 21], "softmax": [5, 34], "multipli": [5, 15, 20], "logit": [5, 34, 41], "an": [5, 6, 9, 10, 15, 23, 28, 30, 31, 32, 34, 35, 40, 41, 42], "embarrassingli": 5, "simpl": 5, "approach": [5, 15], "trx14": 5, "confid": [5, 6, 28, 34, 41], "probabl": [5, 22, 34], "predict": [5, 14, 16, 17, 34, 41], "doesn": [5, 15], "appli": [5, 10, 30, 34, 38, 41], "ani": [5, 6, 9, 14, 15, 29, 30, 34, 35, 36, 41, 42], "binar": 5, "explain": 5, "alreadi": [5, 7, 21, 29, 32], "overfit": 5, "necessari": 5, "alpha": [5, 9, 20, 21, 38], "simpli": 5, "recommend": [5, 22, 40], "fulli": 5, "sigmoid": [5, 23, 34, 41], "adadelta": 5, "tensorflow": [5, 22, 41], "further": [5, 15, 21, 24, 42], "non": [5, 34, 41], "grei": 5, "expect": [5, 8], "gradual": 5, "proport": [5, 16], "fix": 5, "constant": [5, 34], "converg": 5, "faster": 5, "temperatur": 5, "valid": [5, 6, 9, 10, 22, 30, 34, 39, 44], "all_point": 5, "mark_height": [5, 20], "mark_width": [5, 20], "combination_numb": 5, "syn_random_nois": 5, "length": [5, 9, 17, 30, 37, 40, 41], "bernoulli": 5, "distribut": [5, 21, 32], "p": [5, 15, 34, 42], "where": [5, 29], "add_argu": [6, 9, 17, 20, 21, 28, 30, 31, 32, 34, 36, 45], "parser": [6, 9, 17, 20, 21, 28, 30, 31, 32, 34, 36, 45], "attack_nam": [6, 28], "class_dict": [6, 9, 17, 21, 28, 30, 31, 34], "argument": [6, 9, 10, 15, 17, 20, 21, 28, 30, 31, 32, 34, 35, 36, 37, 39, 40, 41, 42], "specif": [6, 9, 20, 21, 28, 29, 30, 31, 32, 34, 36, 40], "argpars": [6, 9, 20, 21, 28, 30, 31, 32, 34, 36, 45], "argumentpars": [6, 9, 20, 21, 28, 30, 31, 32, 34, 36, 45], "name": [6, 8, 9, 10, 20, 21, 22, 23, 24, 28, 29, 30, 31, 32, 34, 36, 40, 41, 42], "alia": [6, 9, 20, 21, 28, 30, 31, 32, 34, 36], "type": [6, 9, 21, 28, 30, 31, 34, 36, 41], "_argumentgroup": [6, 28, 31, 32, 34, 36], "group": [6, 9, 20, 21, 28, 30, 31, 32, 34, 36], "creat": [6, 7, 9, 17, 18, 20, 21, 26, 28, 29, 30, 31, 32, 34, 36, 40, 45], "dataset_nam": [6, 9, 17, 20, 21, 22, 28, 29, 30, 31, 32, 34, 36], "model_nam": [6, 21, 28, 31, 34], "includ": [6, 9, 20, 21, 24, 28, 30, 31, 34, 36, 41], "folder_path": [6, 8, 9, 17, 21, 22, 28, 30, 31, 34, 42, 44], "attack_dir": [6, 28], "data_typ": [6, 9, 21, 28, 30, 31, 34], "imageset": [6, 9, 10, 20, 21], "keyword": [6, 9, 15, 17, 20, 21, 28, 30, 31, 32, 34, 35, 36, 37, 39, 40, 41, 42], "pass": [6, 9, 10, 17, 18, 20, 21, 22, 26, 28, 30, 31, 34, 35, 37, 39], "init": [6, 7, 9, 20, 21, 28, 29, 30, 31, 32, 34, 41], "abstract": [6, 17, 28, 30, 31, 35], "misclassifi": [6, 34], "pick": [6, 30, 37], "poison_num": 6, "modifi": 6, "mix": [6, 22], "poison_ratio": 6, "ratio": [6, 12, 30, 37], "divid": [6, 15], "batch_siz": [6, 30, 37, 43], "train_set": 6, "get_neuron_jaccard": 6, "k": [6, 16, 34, 38, 41], "jaccard": [6, 17], "indic": [6, 35], "kind": 6, "clean_idx": 6, "poison_idx": 6, "_idx": 6, "get_poison_dataset": 6, "seed": [6, 15, 30, 32, 37], "round": 6, "env": [6, 9, 21, 30, 32, 34, 37, 39, 40, 45], "data_se": [6, 30, 32, 37], "validate_confid": 6, "success_onli": 6, "measur": 6, "success": 6, "arg": [6, 9, 17, 30, 31, 32, 35, 38, 42], "under": [6, 22], "distort": 6, "neglig": 6, "human": 6, "detect": [6, 8, 16, 17, 31, 45], "load_mark": [6, 20], "dynamicbackdoor": 6, "config_path": [7, 29], "packag": [7, 20, 29], "o": [7, 21, 29], "dirnam": [7, 29], "__file__": [7, 29], "yml": [7, 29], "normpath": [7, 29], "expandus": [7, 29], "project": [7, 22, 29], "preset": [7, 20, 29, 30], "never": [7, 29, 32], "unless": [7, 29, 32], "you": [7, 8, 9, 21, 22, 29, 32, 41, 42, 45], "know": [7, 29, 32], "what": [7, 29, 32], "re": [7, 29, 32], "cub200": [8, 9], "data_format": [8, 9], "memori": [8, 9, 24, 30, 35, 39, 40, 42], "introduc": [8, 10], "peter": 8, "welind": 8, "2010": 8, "imagefold": [8, 9], "caltech": 8, "ucsd": 8, "bird": [8, 10], "www": [8, 10], "vision": [8, 21, 40, 41], "visipedia": 8, "cub": 8, "html": [8, 10], "data_shap": [8, 9, 10, 20, 21], "224": [8, 9, 21, 41], "valid_set": [8, 30], "cub200_2011": [8, 9], "2011": 8, "gtsrb": [8, 9], "norm_par": [8, 9, 10, 21], "3403": 8, "3121": 8, "3214": 8, "std": [8, 9, 10, 21, 23, 34, 43], "2724": 8, "2608": 8, "2669": 8, "loss_weight": [8, 30, 34], "johann": 8, "stallkamp": 8, "german": 8, "traffic": 8, "sign": 8, "recognit": [8, 10, 24], "benchmark": [8, 22, 32], "multi": 8, "competit": 8, "ini": 8, "rub": 8, "de": 8, "gtsrb_dataset": 8, "43": 8, "485": [8, 21], "456": [8, 21], "406": [8, 21], "229": [8, 21], "225": [8, 21], "ilsvrc2012": 8, "jia": 8, "deng": 8, "feifei": 8, "2012": 8, "scale": [8, 20, 24, 38], "hierarch": 8, "databas": 8, "net": [8, 22, 38, 41], "about": [8, 24], "php": 8, "issu": [8, 34], "1563": 8, "need": [8, 17, 22, 28, 30, 31, 34, 35], "visit": 8, "download": [8, 9, 21, 30, 37], "ilsvrc2012_devkit_t12": 8, "tar": [8, 9], "gz": 8, "ilsvrc2012_img_train": 8, "ilsvrc2012_img_v": 8, "meta": 8, "bin": [8, 45], "isic2018": [8, 9], "noel": 8, "codella": 8, "skin": 8, "lesion": 8, "analysi": [8, 10], "toward": 8, "melanoma": 8, "challeng": 8, "host": 8, "intern": 8, "collabor": 8, "isic": 8, "archiv": 8, "vggface2": [8, 9], "qiong": 8, "cao": 8, "recognis": 8, "face": 8, "across": [8, 9], "pose": 8, "ag": 8, "expir": 8, "dead": 8, "link": [8, 9], "robot": 8, "ox": 8, "ac": 8, "uk": 8, "vgg": [8, 21, 24], "vgg_face2": 8, "8631": 8, "why": 8, "papaer": 8, "500": [8, 15], "cifar10": [9, 10, 22], "cifar100": [9, 10, 22], "imagenet16": [9, 10, 22], "imagenet32": [9, 10], "stl10": [9, 10], "contain": [9, 21, 30, 34, 36], "transform": [9, 10, 20, 21, 24, 30, 34, 37, 41], "auto_aug": 9, "mixup": 9, "mixup_alpha": 9, "cutmix": 9, "cutmix_alpha": 9, "cutout": 9, "cutout_length": 9, "repres": [9, 28, 30, 31], "friendli": [9, 20, 21, 28, 30, 31, 32, 34, 36], "6": [9, 15, 21, 24, 30, 37, 41], "otherwis": [9, 21, 39], "piltotensor": [9, 21, 37], "convertimagedtyp": [9, 21, 37], "bit": 9, "get_transform": [9, 10, 30], "autoaug": 9, "randommixup": 9, "randomcutmix": 9, "classmethod": [9, 21, 28, 30, 31, 32, 34, 36, 42], "view": [9, 20, 21, 28, 30, 31, 32, 34, 36, 41, 42, 45], "concret": [9, 21, 28, 30, 31, 34], "mai": [9, 21, 28, 30, 31, 34], "overrid": [9, 17, 21, 28, 30, 31, 34], "put": [9, 22], "devic": [9, 21, 32, 34, 39], "non_block": 9, "longtensor": 9, "sequenc": [9, 10, 37], "make_fold": 9, "img_typ": 9, "png": [9, 20, 21], "format": [9, 22, 40], "class_nam": [9, 10], "img_idx": 9, "url": [9, 21], "ext": 9, "param": [9, 29, 32, 34, 39, 41, 42], "extens": 9, "md5": 9, "org_folder_nam": 9, "extract": [9, 22, 30], "zip": 9, "could": [9, 41], "child_nam": 9, "sample_num": 9, "child": 9, "_sampl": 9, "1307": 10, "3081": 10, "gradient": [10, 21, 24, 34, 38], "document": 10, "yann": 10, "lecun": 10, "exdb": 10, "28": [10, 37, 41], "49139968": 10, "48215827": 10, "44653124": 10, "24703233": 10, "24348505": 10, "26158768": 10, "alex": [10, 24], "krizhevski": [10, 24], "2009": 10, "tini": 10, "toronto": 10, "kriz": 10, "airplan": 10, "automobil": 10, "deer": 10, "dog": 10, "frog": 10, "hors": 10, "ship": 10, "truck": 10, "122": 10, "68": 10, "255": [10, 12, 21], "116": 10, "66": 10, "104": 10, "63": 10, "22": 10, "61": 10, "26": 10, "65": 10, "09": 10, "patryk": 10, "chrabaszcz": 10, "downsampl": [10, 41], "variant": [10, 14], "altern": [10, 41], "patrykchrabaszcz": 10, "flexibl": 10, "command": [10, 32], "line": [10, 32, 34, 41], "larger": [10, 34, 41], "than": [10, 16, 24, 34, 41], "imagenet64": 10, "507": 10, "487": 10, "441": 10, "267": 10, "256": [10, 21, 24, 41], "276": 10, "singl": [10, 24, 43], "unsupervis": 10, "stanford": 10, "acoat": 10, "unlabel": 10, "advtrain": [12, 13, 17], "pgd_alpha": 12, "pgd_ep": 12, "8": [12, 14, 15, 21, 30, 37], "pgd_iter": 12, "fineprun": [12, 13, 17], "prune_ratio": 12, "95": 12, "fine": 12, "prune": 12, "describ": 12, "kangliu": 12, "idea": 12, "alwai": [12, 30], "alwaya": 12, "low": 12, "take": 12, "test": [12, 14, 17], "filter": [12, 14, 16, 17, 34, 41], "dormant": 12, "consequ": 12, "disabl": [12, 39], "behavior": 12, "finetun": 12, "elimin": 12, "threat": 12, "post": 12, "caff": 12, "open": [12, 21], "clean_image_num": 12, "50": [12, 45], "02": [12, 15], "finetune_epoch": 12, "magnet": [12, 13, 17, 21, 23], "randomizedsmooth": [12, 13, 17], "recompress": [12, 13, 17], "resize_ratio": 12, "neo": [13, 14, 17], "strip": [13, 14, 17, 40], "activationclust": [13, 16, 17], "ab": [13, 15, 17], "deepinspect": [13, 15, 17], "neuralcleans": [13, 15, 17], "neuroninspect": [13, 15, 17], "tabor": [13, 15, 17], "neo_asr_threshold": 14, "neo_kmeans_num": 14, "neo_sample_num": 14, "sakshi": 14, "udeshi": 14, "singapor": 14, "technologi": [14, 22], "design": [14, 24], "inputfilt": [14, 17], "region": [14, 43], "domin": 14, "color": [14, 20, 21, 32, 40, 45], "sklearn": [14, 16], "cluster": [14, 16], "kmean": [14, 16], "check": [14, 15, 17, 30, 35], "exce": 14, "regard": [14, 41, 42], "agnost": 14, "defenc": 14, "against": [14, 23], "sakshiudeshi": 14, "assum": [14, 16], "defend": [14, 23], "knowledg": 14, "mark_siz": 14, "get_cls_diff": 14, "get_dominant_color": 14, "one": [14, 22, 24, 34, 41], "get_pred_label": [14, 17], "gpu": [14, 30, 32, 34, 39], "metriclogg": [14, 39, 40], "strip_fpr": 14, "05": [14, 41], "strip_alpha": 14, "strip_sample_num": 14, "booltensor": [14, 17, 35], "defense_input_num": [14, 16, 17], "seed_data_num": 15, "mask_ep": 15, "samp_k": 15, "same_rang": 15, "n_sampl": 15, "top_n_neuron": 15, "max_troj_s": 15, "remask_weight": 15, "defense_remask_lr": [15, 17], "defense_remask_epoch": [15, 17], "artifici": 15, "brain": 15, "stimul": 15, "inspect": [15, 17], "modelinspect": [15, 17], "scan": 15, "back": 15, "door": 15, "naiyeleo": 15, "gen_seed_data": 15, "numpi": [15, 30, 32, 37], "ndarrai": [15, 30], "kei": [15, 29, 32, 36, 40, 41, 42], "get_seed_data": 15, "npz": [15, 17], "exist": [15, 17, 30], "sample_ratio": 15, "noise_dim": 15, "gamma_1": 15, "gamma_2": 15, "nc_cost_multipli": 15, "nc_patienc": 15, "nc_asr_threshold": 15, "99": 15, "nc_early_stop_threshold": 15, "cleans": 15, "bolun": 15, "wang": 15, "ieee": 15, "adjust": 15, "cost": [15, 17], "earli": [15, 17, 21, 35], "stop": [15, 17, 21, 35], "strategi": [15, 21], "tri": [15, 17], "recov": [15, 17], "outlier": 15, "among": 15, "potenti": 15, "mitig": [15, 30], "bolunwang": 15, "cost_multiplier_up": 15, "increas": 15, "equal": 15, "cost_multiplier_down": 15, "decreas": 15, "init_cost": 15, "lambd_sp": 15, "lambd_sm": 15, "lambd_p": 15, "thre": 15, "tabor_hyperparam": 15, "wenbo": 15, "guo": 15, "dawn": 15, "song": 15, "penn": 15, "uc": 15, "berkelei": 15, "regular": [15, 21, 38], "term": 15, "highli": [15, 22], "accur": 15, "ai": 15, "system": 15, "usmannk": 15, "nb_cluster": 16, "nb_dim": 16, "reduce_method": 16, "fastica": 16, "cluster_analysi": 16, "silhouette_scor": 16, "bryant": 16, "chen": [16, 24], "ibm": 16, "safeai": 16, "aaai": 16, "trainingfilt": [16, 17], "separ": 16, "far": 16, "own": 16, "center": 16, "dim": [16, 20, 34], "reduc": [16, 24], "decomposit": 16, "pca": 16, "smallest": 16, "whose": [16, 42], "smaller": 16, "size_threshold": 16, "relative_s": 16, "fit": 16, "robust": 16, "toolbox": 16, "art": 16, "dimens": [16, 20, 24], "full": [16, 17, 22, 29, 30, 34, 39, 41], "els": [16, 17, 20, 30, 34], "minibatchkmean": 16, "analyze_by_dist": 16, "cluster_class": 16, "reduced_fm": 16, "reduced_fm_cent": 16, "_class": 16, "analyze_by_relative_s": 16, "analyze_by_silhouette_scor": 16, "silhouette_threshold": 16, "high": 16, "analyze_by_s": 16, "defense_nam": [17, 31], "backdoordefens": 17, "real_mark": 17, "real_mask": 17, "total": [17, 22, 30, 34, 35, 40, 42], "test_set": 17, "get_test_data": 17, "get_true_label": 17, "ground": 17, "truth": 17, "clean_set": 17, "get_dataset": [17, 30], "search": [17, 22, 24], "check_early_stop": 17, "remask": 17, "get_mark_loss_list": 17, "_label": [17, 21, 34, 41], "trigger_output": 17, "function": [17, 20, 21, 34, 35, 36, 43], "scalar": [17, 34], "loader": [17, 30, 34, 44], "logger_head": 17, "collect": [17, 30, 35, 40], "abc": [17, 30, 35, 40], "header": [17, 40, 42], "string": [17, 21, 29, 34, 35, 39, 40, 41, 42], "mark_path": 20, "npy": [20, 30], "square_whit": 20, "mark_background_color": 20, "mark_height_offset": 20, "mark_width_offset": 20, "mark_random_init": 20, "mark_random_po": 20, "mark_scatt": 20, "mark_scattered_height": 20, "mark_scattered_width": 20, "add_mark_fn": 20, "support": [20, 34, 36, 42], "case": [20, 32, 39], "can": [20, 22, 42, 45], "apple_black": 20, "apple_whit": 20, "square_black": 20, "watermark_black": 20, "watermark_whit": 20, "white": 20, "shall": 20, "ignor": [20, 21, 34], "opac": 20, "resiz": [20, 21], "height": 20, "width": 20, "offset": 20, "locat": [20, 34], "scatter": 20, "entir": [20, 21, 29, 30, 34, 35, 37, 39, 40, 41, 42], "occur": 20, "onc": 20, "shuffl": [20, 30, 37], "callabl": [20, 30, 34, 35], "custom": 20, "mark_img": 20, "already_process": 20, "pil": [20, 21], "pillow": 20, "just": [20, 30], "scatter_mark": 20, "mark_unscatt": 20, "mark_scattered_shap": 20, "becom": 20, "unscatt": 20, "alexnet": [21, 24], "densenet": [21, 24], "efficientnet": [21, 24], "mnasnet": [21, 24], "mobilenet": [21, 24], "shufflenetv2": [21, 24], "dart": [21, 22], "ena": [21, 22], "natsbench": [21, 22], "pnasnet": [21, 22], "proxylessna": [21, 22], "model_dir": [21, 34], "output_available_model": [21, 34], "indent": [21, 29, 34, 35, 39, 40, 41, 42, 44], "avail": [21, 22, 23, 24, 30, 32, 34, 43], "space": [21, 22, 29, 34, 35, 39, 40, 41, 42], "_imagemodel": 21, "adv_train": 21, "adv_train_random_init": 21, "adv_train_eval_random_init": 21, "adv_train_it": 21, "adv_train_alpha": 21, "adv_train_ep": 21, "adv_train_eval_it": 21, "adv_train_eval_alpha": 21, "adv_train_eval_ep": 21, "adv_train_trades_beta": 21, "norm_lay": 21, "sgm": 21, "sgm_gamma": 21, "suffix": [21, 34, 44], "modify_first_layer_channel": 21, "wrapper": [21, 30, 34], "most": [21, 32, 34, 36], "common": [21, 24, 34, 36], "interfac": [21, 34], "extend": [21, 42], "skip": [21, 38], "free": 21, "mahyarnajibi": 21, "freeadversarialtrain": 21, "fast": 21, "locuslab": 21, "fast_adversari": 21, "csdongxian": 21, "matter": 21, "pgd": 21, "eval": [21, 34], "trade": 21, "f": [21, 40], "_at": 21, "start": [21, 34, 35, 42], "benign": 21, "factor": [21, 34], "lambda": 21, "gn": 21, "gamma": [21, 34], "get_heatmap": 21, "grad_cam": 21, "cmap": 21, "jet": 21, "bicub": 21, "colormap": 21, "heatmap": 21, "saliency_map": 21, "matplotlib": 21, "interpol": 21, "kera": [21, 41], "exampl": [21, 23, 30, 34, 37, 39, 40, 41, 45], "import": [21, 22, 30, 34, 37, 39, 41, 45], "superimpos": 21, "wget": 21, "cpu": [21, 30, 32, 34], "resnet152": [21, 24], "centercrop": 21, "imgur": 21, "bvro0yd": 21, "isfil": 21, "african_eleph": 21, "convert": 21, "rgb": 21, "unsqueez": 21, "_prob": 21, "get_prob": [21, 34], "squeez": 21, "argmax": [21, 34], "item": [21, 35, 42], "conf": 21, "print": [21, 30, 34, 39, 41], "grad_cam_impos": 21, "saliency_map_impos": 21, "max": [21, 40, 43], "save_imag": 21, "center_crop": 21, "386": 21, "77": 21, "74": 21, "get_nam": 21, "vgg_comp": [21, 24], "13": [21, 24], "vgg13_comp": [21, 24], "vgg16_comp": [21, 24], "model_arch": 22, "init_channel": 22, "36": 22, "dropout_p": 22, "auxiliary_weight": 22, "genotyp": 22, "_dart": 22, "supernet": 22, "arch_search": 22, "use_full_train_set": 22, "arch_lr": 22, "3e": 22, "arch_weight_decai": 22, "arch_unrol": 22, "primit": 22, "like": [22, 32, 36, 42], "architectur": [22, 24], "differenti": 22, "quark0": 22, "oper": [22, 34, 39, 41], "amoebanet": 22, "amoebanet_adapt": 22, "darts_v1": 22, "darts_v2": 22, "drnas_cifar10": 22, "drna": 22, "drnas_imagenet": 22, "enas_adapt": 22, "nasnet": 22, "nasnet_adapt": 22, "pc_darts_cifar": 22, "pc_dart": 22, "pc_darts_imag": 22, "pdart": 22, "robust_dart": 22, "sga": 22, "snas_mild": 22, "snas_adapt": 22, "diy_deep": 22, "diy_noskip": 22, "diy_deep_noskip": 22, "stem": 22, "dropout": [22, 24, 34, 41], "decai": [22, 34, 41], "unrol": 22, "v2": [22, 24], "cell": 22, "_ena": 22, "yet": [22, 30], "microsoft": 22, "intellig": 22, "nni": 22, "librari": [22, 29], "enas_macro": 22, "pt": 22, "via": 22, "share": 22, "melodyguan": 22, "nats_bench": 22, "_natsbench": 22, "model_index": 22, "model_se": 22, "777": 22, "hp": 22, "nats_path": 22, "search_spac": 22, "tss": 22, "nat": 22, "bench": 22, "xuanyi": 22, "dong": 22, "sydnei": 22, "prerequisit": 22, "pip": 22, "instal": 22, "git": 22, "clone": 22, "d": 22, "autodl": 22, "v1_0": 22, "3ffb9": 22, "topologi": 22, "api": 22, "get_net_config": 22, "15624": 22, "get_net_param": 22, "888": 22, "999": 22, "12": [22, 41], "sss": 22, "120": 22, "_b": 22, "_pnasnet": 22, "chenxi": 22, "john": 22, "hopkin": 22, "third": 22, "parti": 22, "repo": 22, "correct": [22, 38], "guarante": 22, "might": 22, "better": 22, "reimplement": 22, "blob": [22, 24, 38, 40, 41], "master": [22, 24, 38, 40], "slim": 22, "py": [22, 24, 38, 40, 41, 45], "pnasnet_a": 22, "pnasnet_b": 22, "progress": [22, 32, 34], "kuangliu": 22, "target_platform": 22, "proxyless_cifar": 22, "_proxylessna": 22, "han": 22, "cai": 22, "mit": 22, "iclr": [22, 24], "direct": 22, "hardwar": 22, "lab": 22, "hub": [22, 34], "proxyless_cpu": 22, "proxyless_gpu": 22, "proxyless_mobil": 22, "proxyless_mobile_14": 22, "_magnet": 23, "v_nois": 23, "dongyu": 23, "meng": 23, "shanghai": 23, "tech": 23, "autoencod": 23, "two": [23, 30, 37], "prong": 23, "gaussian": [23, 43], "_alexnet": 24, "googl": 24, "2014": 24, "One": 24, "weird": 24, "trick": 24, "parallel": [24, 34], "convolut": 24, "conv2d": [24, 38, 41], "kernel_s": [24, 41], "11": [24, 30, 37], "stride": [24, 41], "pad": [24, 41], "inplac": [24, 34, 41], "maxpool2d": [24, 41], "192": 24, "384": 24, "pool": [24, 34, 41], "adaptiveavgpool2d": [24, 34, 41], "linear": [24, 34, 38, 41], "4096": 24, "121": 24, "_densenet": 24, "gao": [24, 38], "huang": 24, "cornel": 24, "cvpr": 24, "densenet_comp": 24, "densenet121": [24, 41], "densenet169": 24, "densenet201": 24, "densenet161": 24, "densenet121_comp": 24, "densenet169_comp": 24, "densenet201_comp": 24, "densenet161_comp": 24, "dens": 24, "_comp": 24, "remov": [24, 34, 42], "norm0": 24, "relu0": 24, "pool0": [24, 41], "befor": [24, 34], "block": 24, "_b0": 24, "_efficientnet": 24, "mingx": 24, "tan": 24, "icml": 24, "efficientnet_comp": 24, "efficientnet_b0": 24, "efficientnet_b1": 24, "efficientnet_b2": 24, "efficientnet_b3": 24, "efficientnet_b4": 24, "efficientnet_b5": 24, "efficientnet_b6": 24, "efficientnet_b7": 24, "efficientnet_b0_comp": 24, "efficientnet_b1_comp": 24, "efficientnet_b2_comp": 24, "efficientnet_b3_comp": 24, "efficientnet_b4_comp": 24, "efficientnet_b5_comp": 24, "efficientnet_b6_comp": 24, "efficientnet_b7_comp": 24, "rethink": 24, "mnas_alpha": 24, "_mnasnet": 24, "mnasnet0_5": 24, "mnasnet0_75": 24, "mnasnet1_0": 24, "mnasnet1_3": 24, "mobil": 24, "mobilenet_v2": 24, "_mobilenet": 24, "andrew": 24, "howard": 24, "liang": 24, "chieh": 24, "mobilenet_v3_larg": 24, "mobilenet_v3_smal": 24, "mobilenet_v2_comp": 24, "mobilenet_v3_large_comp": 24, "mobilenet_v3_small_comp": 24, "mobilenetv2": 24, "invert": 24, "residu": 24, "bottleneck": 24, "v3": 24, "mobilenetv3": 24, "inverted_residual_set": 24, "18": 24, "_resnet": 24, "seri": [24, 40], "resnext": 24, "wideresnet": 24, "resnet_": 24, "resnet18": [24, 41], "resnet34": 24, "resnet50": 24, "resnet101": 24, "resnet18_comp": 24, "resnet34_comp": 24, "resnet50_comp": 24, "resnet101_comp": 24, "resnet152_comp": 24, "resnext50_32x4d": 24, "resnext101_32x8d": 24, "resnext50_32x4d_comp": 24, "resnext101_32x8d_comp": 24, "wide_resnet50_2": 24, "wide_resnet101_2": 24, "wide_resnet50_2_comp": 24, "wide_resnet101_2_comp": 24, "resnet18_": 24, "resnet34_": 24, "resnet50_": 24, "resnet101_": 24, "resnet152_": 24, "resnet18_ap_comp": 24, "aggreg": 24, "wide": 24, "facebook": 24, "continu": 24, "episod": 24, "gem": 24, "facebookresearch": 24, "gradientepisodicmemori": 24, "_ap": 24, "rather": [24, 34], "global": [24, 40], "extractor": [24, 34], "resnetap": 24, "condens": 24, "match": 24, "vico": 24, "uoe": 24, "datasetcondens": 24, "_x0_5": 24, "_shufflenetv2": 24, "shufflenet": 24, "ningn": 24, "ma": 24, "megvii": 24, "shufflenetv2_comp": 24, "shufflenetv2_x0_5": 24, "shufflenetv2_x1_0": 24, "shufflenetv2_x1_5": 24, "shufflenetv2_x2_0": 24, "shufflenetv2_x0_5_comp": 24, "shufflenetv2_x1_0_comp": 24, "shufflenetv2_x1_5_comp": 24, "shufflenetv2_x2_0_comp": 24, "shufflenet_v2_x0_5": 24, "practic": 24, "guidelin": 24, "cnn": 24, "_vgg": 24, "karen": 24, "simonyan": 24, "oxford": 24, "2015": 24, "vgg_bn": 24, "vgg_bn_comp": 24, "vgg_": 24, "vgg_bn_": 24, "vgg11": 24, "vgg13": 24, "vgg16": 24, "vgg19": 24, "vgg11_bn": 24, "vgg13_bn": 24, "vgg16_bn": 24, "vgg19_bn": 24, "vgg11_comp": 24, "vgg19_comp": 24, "vgg11_bn_comp": 24, "vgg13_bn_comp": 24, "vgg16_bn_comp": 24, "vgg19_bn_comp": 24, "vgg11_": 24, "vgg13_": 24, "vgg16_": 24, "vgg19_": 24, "vgg11_bn_": 24, "vgg13_bn_": 24, "vgg16_bn_": 24, "vgg19_bn_": 24, "512": [24, 41], "modelprocess": [28, 31, 39, 42], "generate_target": [28, 34, 39, 41], "idx": [28, 34, 37, 41], "mod": [28, 34, 41], "cmd_config_path": [29, 32], "_base": 29, "configur": 29, "configtyp": 29, "config_fil": 29, "option": [29, 30, 34], "config_dict": 29, "father": 29, "cmd_config": 29, "full_config": 29, "merg": [29, 42], "get_config": 29, "load_config": 29, "yaml": 29, "json": 29, "summari": [29, 34, 36, 39, 41, 42, 45], "inform": [29, 30, 34, 35, 39, 40, 41, 42], "cmd": 29, "valid_batch_s": 30, "split_ratio": 30, "num_work": 30, "basicobject": [30, 34, 36, 39, 42], "neg": 30, "store": [30, 32, 40, 42], "split": [30, 37], "get_dataload": 30, "np": 30, "get_loss_weight": 30, "dataload": 30, "posit": [30, 35, 42], "label_nam": 30, "nativ": 30, "collate_fn": 30, "check_fil": 30, "prepar": 30, "get_org_dataset": 30, "get_class_subset": [30, 37, 39], "class_list": [30, 37], "tensorlistdataset": [30, 37, 39], "unprocess": [30, 34], "pin_memori": 30, "drop_last": 30, "worker": 30, "pin": 30, "split_dataset": [30, 32, 37, 39], "file_path": [30, 34, 44], "reciproc": 30, "imbal": 30, "_get_org_dataset": 30, "percent": [30, 37], "cannot": [30, 37], "set1": [30, 37], "set2": [30, 37], "set3": [30, 37], "set4": [30, 37], "defense_dir": 31, "cudnn_benchmark": 32, "cache_threshold": [32, 39], "tqdm": [32, 40], "model_ema": [32, 34, 36, 44], "optim_arg": [32, 36], "train_arg": [32, 36], "writer_arg": [32, 36], "singleton": 32, "cuda": [32, 34, 39], "show": [32, 34, 40, 41, 45], "consol": 32, "asni": 32, "escap": 32, "charact": [32, 40], "num_gpu": 32, "bar": 32, "level": [32, 34, 35, 40, 41, 42], "backend": 32, "cudnn": 32, "acceler": 32, "determinist": 32, "mb": [32, 39], "empty_cach": [32, 39], "world_siz": 32, "_model": 34, "randomized_smooth": 34, "rs_sigma": 34, "rs_n": 34, "local": 34, "_adv_train": 34, "empti": [34, 37, 39, 40, 41], "pth": 34, "fetch": 34, "smooth": [34, 40], "sigma": 34, "available_model": 34, "weightsenum": 34, "dataparallel": 34, "get_parallel_model": 34, "criterion": 34, "criterion_noreduct": 34, "reduct": [34, 35], "_train": 34, "lr_warmup_epoch": [34, 44], "model_ema_step": [34, 44], "grad_clip": [34, 44], "pre_condition": [34, 36, 44], "print_prefix": [34, 44], "start_epoch": [34, 44], "resum": [34, 44], "validate_interv": [34, 44, 45], "amp": [34, 44], "loader_train": [34, 44], "loader_valid": [34, 44], "epoch_fn": [34, 44], "get_data_fn": [34, 44], "after_loss_fn": [34, 44], "validate_fn": [34, 44], "save_fn": [34, 44], "writer": [34, 36, 44], "main_tag": [34, 44], "tag": [34, 44], "metric_fn": [34, 44], "_valid": 34, "_output": [34, 41], "topk": [34, 41], "comput": [34, 38, 39, 40, 41], "over": [34, 40, 41], "specifi": [34, 41, 42], "activate_param": [34, 39, 41], "requires_grad": [34, 41], "fn": 34, "recurs": [34, 41], "submodul": [34, 41], "children": [34, 41], "typic": 34, "immedi": 34, "move": [34, 36, 41], "buffer": 34, "define_criterion": 34, "crossentropyloss": 34, "define_optim": 34, "optimtyp": 34, "sgd": 34, "momentum": [34, 41], "weight_decai": 34, "lr_scheduler_typ": 34, "lr_step_siz": 34, "30": [34, 42], "lr_gamma": 34, "lr_min": 34, "lr_warmup_method": 34, "lr_warmup_decai": 34, "partial": 34, "enabl": [34, 39, 41], "steplr": 34, "exponentiallr": 34, "step_siz": 34, "t_max": 34, "minimum": [34, 40], "eta_min": 34, "warmup": 34, "total_it": 34, "start_factor": 34, "_lrschedul": [34, 36], "get_all_lay": [34, 39, 41], "layer_input": [34, 41], "depth": [34, 41], "prefix": [34, 41], "use_filt": [34, 41], "non_leaf": [34, 41], "seq_onli": [34, 41], "travers": [34, 37, 41], "infti": [34, 41, 43], "out": [34, 38, 41], "batchnorm2d": [34, 41], "leaf": [34, 41], "node": [34, 41], "integ": [34, 35, 41, 42], "No": [34, 41], "get_class": 34, "get_logit": 34, "get_final_fm": 34, "get_fm": 34, "layer_output": [34, 41], "get_layer_nam": [34, 39, 41], "__call__": 34, "defautl": 34, "randmized_smooth": 34, "forward": [34, 41], "get_official_weight": 34, "map_loc": 34, "load_state_dict_from_url": 34, "ordereddict": 34, "avaiabl": 34, "would": 34, "deprec": 34, "65936": 34, "we": [34, 41], "consid": 34, "distributeddataparallel": 34, "vector": 34, "get_target_prob": 34, "gather": 34, "compon": 34, "strict": 34, "checkpoint": 34, "chang": [34, 41], "affect": 34, "part": 34, "load_state_dict": 34, "auxialiari": 34, "state_dict": 34, "copi": [34, 42], "descend": 34, "named_children": 34, "yield": 34, "itself": 34, "named_modul": 34, "memo": 34, "named_paramet": 34, "remove_misclassifi": 34, "requires_grad_": 34, "autograd": 34, "record": 34, "destin": 34, "keep_var": 34, "dictionari": 34, "zero_grad": 34, "set_to_non": 34, "zero": 34, "define_preprocess": 34, "define_featur": 34, "define_classifi": 34, "num_featur": 34, "activation_inplac": 34, "fc1": 34, "relu1": 34, "dropout0": 34, "in_featur": [34, 41], "Will": 34, "bia": [34, 41], "dropout1": 34, "fc2": 34, "relu2": 34, "dropout2": 34, "fc3": 34, "ident": 34, "stop_threshold": 35, "early_stop_check": 35, "current_idx": 35, "adv_input": 35, "loss_valu": 35, "loss_kwarg": 35, "adversairl": 35, "get_output_int": [35, 42], "output_info": 35, "_iter": [35, 42], "legal": 35, "preprocess_input": 35, "org_input": 35, "update_input": 35, "classtyp": 36, "tensorboard": 36, "exponentialmovingaverag": [36, 39, 41], "kfac": [36, 38, 39], "ekfac": [36, 38, 39], "summarywrit": 36, "attribut": [36, 42], "usag": [36, 39, 40, 42], "exponenti": [36, 41], "pre": [36, 43], "condition": 36, "exclud": 36, "dataset_to_tensor": [37, 39], "10000": 37, "dtype": 37, "int64": 37, "sample_batch": [37, 39], "given": 37, "basekfac": [38, 39], "sua": 38, "update_freq": 38, "constraint_norm": 38, "state_typ": 38, "basest": [38, 39], "fac": 38, "preconditionn": 38, "second": 38, "moment": 38, "silent": 38, "precondit": 38, "tikhonov": 38, "invers": 38, "approxim": 38, "run": 38, "av": 38, "squar": 38, "fisher": 38, "pi": [38, 43], "thrandi": 38, "ra": 38, "stat": 38, "intra": 38, "minibatch": 38, "estim": 38, "storag": 38, "xh": 38, "xw": 38, "gy": 38, "yh": 38, "yw": 38, "num_loc": 38, "kfacstat": [38, 39], "xxt": 38, "kh": 38, "kw": 38, "ggt": 38, "ixxt": 38, "iggt": 38, "smoothedvalu": [39, 40], "averagemet": [39, 40], "init_weight": [39, 41], "tanh_func": [39, 43], "atan_func": [39, 43], "repeat_to_batch": [39, 43], "add_nois": [39, 43], "lock": 39, "boolean": 39, "contextmanag": 39, "avoid": [39, 41], "track": [39, 40], "suitabl": 39, "cach": 39, "memory_cach": 39, "output_memori": 39, "memory_summari": 39, "memory_alloc": 39, "memory_reserv": 39, "window_s": 40, "fmt": 40, "global_avg": 40, "3f": 40, "access": 40, "window": 40, "refer": [40, 41], "maxlen": 40, "dequ": 40, "pattern": 40, "count": 40, "sum": 40, "avg": 40, "min": [40, 43], "last_valu": 40, "stream": [40, 42], "synchronize_between_process": 40, "synchron": 40, "piec": 40, "update_list": 40, "value_list": 40, "delimit": 40, "meter_length": 40, "join": 40, "meter": 40, "iter_tim": 40, "data_tim": 40, "create_met": 40, "meter_nam": 40, "get_str": 40, "cut_too_long": 40, "green": 40, "cut": 40, "long": 40, "trail": 40, "whitespac": 40, "log_everi": 40, "tqdm_header": 40, "wrap": 40, "remain": 40, "total_tim": 40, "filter_list": 41, "intial": 41, "except": 41, "reset_paramet": 41, "so": 41, "conv1": 41, "layer1": 41, "layer2": 41, "layer3": 41, "layer4": 41, "avgpool": 41, "conv2": 41, "randn": 41, "conv0": 41, "112": 41, "56": 41, "denseblock1": 41, "_denseblock": 41, "transition1": 41, "avgpool2d": 41, "denseblock2": 41, "transition2": 41, "14": 41, "denseblock3": 41, "1024": 41, "transition3": 41, "denseblock4": 41, "dict_kei": 41, "mani": 41, "emb": 41, "rais": 41, "error": 41, "suggest": 41, "layer_name_list": 41, "tree_length": 41, "indent_atom": 41, "tree": 41, "increment": 41, "sub": 41, "bn1": 41, "affin": 41, "track_running_stat": 41, "dilat": 41, "ceil_mod": 41, "output_s": 41, "basicblock": 41, "maintain": 41, "ema_avg": 41, "avg_model_param": 41, "model_param": 41, "swa_util": 41, "averagedmodel": 41, "ema": 41, "pretti": 42, "param_list": 42, "categori": 42, "get_output": 42, "org_output": 42, "19": 42, "29": 42, "output_it": 42, "relat": 42, "clean_acc": 42, "_marker": 42, "marker": 42, "shown": 42, "clear": 42, "deepcopi": 42, "remove_non": 42, "mul": 43, "arctan": 43, "atan": 43, "math": 43, "clip_min": 43, "clip_max": 43, "forward_fn": 44, "output_freq": 44, "change_train_ev": 44, "lr_scheduler_freq": 44, "backward_and_step": 44, "metric_kwarg": 44, "logger_train": 44, "logger_valid": 44, "backdoor_defens": 45, "workflow": 45, "usr": 45, "python3": 45, "cuda_visible_devic": 45, "python": 45, "neural_cleans": 45, "__name__": 45, "__main__": 45, "parse_arg": 45, "__dict__": 45}, "objects": {"trojanvision.attacks": [[6, 0, 1, "", "BackdoorAttack"], [5, 0, 1, "", "BadNet"], [6, 0, 1, "", "CleanLabelBackdoor"], [6, 0, 1, "", "DynamicBackdoor"], [5, 0, 1, "", "IMC"], [3, 0, 1, "", "InputAwareDynamic"], [2, 0, 1, "", "InvisiblePoison"], [5, 0, 1, "", "LatentBackdoor"], [2, 0, 1, "", "Refool"], [5, 0, 1, "", "TrojanNN"], [5, 0, 1, "", "TrojanNet"], [6, 2, 1, "", "add_argument"], [6, 2, 1, "", "create"]], "trojanvision.attacks.BackdoorAttack": [[6, 1, 1, "", "add_mark"], [6, 1, 1, "", "get_data"], [6, 1, 1, "", "get_filename"], [6, 1, 1, "", "get_neuron_jaccard"], [6, 1, 1, "", "get_poison_dataset"], [6, 1, 1, "", "load"], [6, 1, 1, "", "save"], [6, 1, 1, "", "validate_confidence"]], "trojanvision.attacks.CleanLabelBackdoor": [[6, 1, 1, "", "get_poison_dataset"]], "trojanvision.attacks.IMC": [[5, 1, 1, "", "optimize_mark"]], "trojanvision.attacks.InputAwareDynamic": [[3, 1, 1, "", "add_mark"], [3, 1, 1, "", "define_generator"], [3, 1, 1, "", "get_data"], [3, 1, 1, "", "get_filename"], [3, 1, 1, "", "get_mark"], [3, 1, 1, "", "get_mask"], [3, 1, 1, "", "load"], [3, 1, 1, "", "save"], [3, 1, 1, "", "train_mask_generator"]], "trojanvision.attacks.LatentBackdoor": [[5, 1, 1, "", "get_avg_target_feats"], [5, 1, 1, "", "preprocess_mark"], [5, 1, 1, "", "sample_data"]], "trojanvision.attacks.Refool": [[2, 1, 1, "", "add_mark"]], "trojanvision.attacks.TrojanNN": [[5, 1, 1, "", "denoise"], [5, 1, 1, "", "get_neuron_idx"], [5, 1, 1, "", "get_neuron_value"], [5, 1, 1, "", "preprocess_mark"]], "trojanvision.attacks.TrojanNet": [[5, 1, 1, "", "syn_random_noises"], [5, 1, 1, "", "syn_trigger_candidates"]], "trojanvision": [[7, 3, 0, "-", "configs"], [18, 3, 0, "-", "environ"], [26, 3, 0, "-", "trainer"]], "trojanvision.datasets": [[10, 0, 1, "", "CIFAR10"], [10, 0, 1, "", "CIFAR100"], [8, 0, 1, "", "CUB200"], [8, 0, 1, "", "CUB200_2011"], [8, 0, 1, "", "GTSRB"], [8, 0, 1, "", "ISIC2018"], [9, 0, 1, "", "ImageFolder"], [8, 0, 1, "", "ImageNet"], [10, 0, 1, "", "ImageNet16"], [10, 0, 1, "", "ImageNet32"], [9, 0, 1, "", "ImageSet"], [10, 0, 1, "", "MNIST"], [10, 0, 1, "", "STL10"], [8, 0, 1, "", "VGGface2"], [9, 2, 1, "", "add_argument"], [9, 2, 1, "", "create"]], "trojanvision.datasets.ImageFolder": [[9, 1, 1, "", "add_argument"], [9, 1, 1, "", "initialize"], [9, 1, 1, "", "sample"]], "trojanvision.datasets.ImageSet": [[9, 1, 1, "", "add_argument"], [9, 1, 1, "", "get_data"], [9, 1, 1, "", "get_transform"], [9, 1, 1, "", "make_folder"]], "trojanvision.datasets.STL10": [[10, 1, 1, "", "get_transform"]], "trojanvision.defenses": [[15, 0, 1, "", "ABS"], [16, 0, 1, "", "ActivationClustering"], [12, 0, 1, "", "AdvTrain"], [17, 0, 1, "", "BackdoorDefense"], [15, 0, 1, "", "DeepInspect"], [12, 0, 1, "", "FinePruning"], [17, 0, 1, "", "InputFiltering"], [12, 0, 1, "", "MagNet"], [17, 0, 1, "", "ModelInspection"], [14, 0, 1, "", "Neo"], [15, 0, 1, "", "NeuralCleanse"], [15, 0, 1, "", "NeuronInspect"], [12, 0, 1, "", "RandomizedSmooth"], [12, 0, 1, "", "Recompress"], [14, 0, 1, "", "Strip"], [15, 0, 1, "", "Tabor"], [17, 0, 1, "", "TrainingFiltering"], [17, 2, 1, "", "add_argument"], [17, 2, 1, "", "create"]], "trojanvision.defenses.ABS": [[15, 1, 1, "", "gen_seed_data"], [15, 1, 1, "", "get_seed_data"]], "trojanvision.defenses.ActivationClustering": [[16, 1, 1, "", "analyze_by_distance"], [16, 1, 1, "", "analyze_by_relative_size"], [16, 1, 1, "", "analyze_by_silhouette_score"], [16, 1, 1, "", "analyze_by_size"]], "trojanvision.defenses.BackdoorDefense": [[17, 1, 1, "", "get_filename"]], "trojanvision.defenses.DeepInspect": [[15, 1, 1, "", "optimize_mark"]], "trojanvision.defenses.InputFiltering": [[17, 1, 1, "", "get_pred_labels"], [17, 1, 1, "", "get_test_data"], [17, 1, 1, "", "get_true_labels"]], "trojanvision.defenses.ModelInspection": [[17, 1, 1, "", "check_early_stop"], [17, 1, 1, "", "get_mark_loss_list"], [17, 1, 1, "", "load"], [17, 1, 1, "", "loss"], [17, 1, 1, "", "optimize_mark"]], "trojanvision.defenses.Neo": [[14, 1, 1, "", "get_cls_diff"], [14, 1, 1, "", "get_dominant_color"], [14, 1, 1, "", "get_pred_label"]], "trojanvision.defenses.Strip": [[14, 1, 1, "", "get_pred_labels"]], "trojanvision.defenses.TrainingFiltering": [[17, 1, 1, "", "get_datasets"], [17, 1, 1, "", "get_pred_labels"], [17, 1, 1, "", "get_true_labels"]], "trojanvision.marks": [[20, 0, 1, "", "Watermark"], [20, 2, 1, "", "add_argument"], [20, 2, 1, "", "create"]], "trojanvision.marks.Watermark": [[20, 1, 1, "", "add_argument"], [20, 1, 1, "", "add_mark"], [20, 1, 1, "", "load_mark"], [20, 1, 1, "", "scatter_mark"]], "trojanvision.models": [[24, 0, 1, "", "AlexNet"], [22, 0, 1, "", "DARTS"], [24, 0, 1, "", "DenseNet"], [22, 0, 1, "", "ENAS"], [24, 0, 1, "", "EfficientNet"], [21, 0, 1, "", "ImageModel"], [24, 0, 1, "", "MNASNet"], [23, 0, 1, "", "MagNet"], [24, 0, 1, "", "MobileNet"], [22, 0, 1, "", "NATSbench"], [22, 0, 1, "", "PNASNet"], [22, 0, 1, "", "ProxylessNAS"], [24, 0, 1, "", "ResNet"], [24, 0, 1, "", "ShuffleNetV2"], [24, 0, 1, "", "VGG"], [21, 2, 1, "", "add_argument"], [21, 2, 1, "", "create"], [21, 2, 1, "", "output_available_models"]], "trojanvision.models.ImageModel": [[21, 1, 1, "", "add_argument"], [21, 1, 1, "", "get_data"], [21, 1, 1, "", "get_heatmap"], [21, 1, 1, "", "get_name"]], "trojanzoo.attacks": [[28, 0, 1, "", "Attack"], [28, 2, 1, "", "add_argument"], [28, 2, 1, "", "create"]], "trojanzoo.attacks.Attack": [[28, 1, 1, "", "add_argument"], [28, 1, 1, "", "attack"], [28, 1, 1, "", "generate_target"]], "trojanzoo": [[29, 3, 0, "-", "configs"]], "trojanzoo.configs": [[29, 0, 1, "", "Config"]], "trojanzoo.configs.Config": [[29, 1, 1, "", "get_config"], [29, 1, 1, "", "load_config"], [29, 1, 1, "", "merge"], [29, 1, 1, "", "summary"]], "trojanzoo.datasets": [[30, 0, 1, "", "Dataset"], [30, 2, 1, "", "add_argument"], [30, 2, 1, "", "create"]], "trojanzoo.datasets.Dataset": [[30, 1, 1, "", "add_argument"], [30, 1, 1, "", "check_files"], [30, 1, 1, "", "get_class_subset"], [30, 1, 1, "", "get_data"], [30, 1, 1, "", "get_dataloader"], [30, 1, 1, "", "get_dataset"], [30, 1, 1, "", "get_loss_weights"], [30, 1, 1, "", "get_org_dataset"], [30, 1, 1, "", "get_transform"], [30, 1, 1, "", "initialize"], [30, 1, 1, "", "split_dataset"]], "trojanzoo.defenses": [[31, 0, 1, "", "Defense"], [31, 2, 1, "", "add_argument"], [31, 2, 1, "", "create"]], "trojanzoo.defenses.Defense": [[31, 1, 1, "", "add_argument"], [31, 1, 1, "", "detect"]], "trojanzoo.environ": [[32, 0, 1, "", "Env"], [32, 2, 1, "", "add_argument"], [32, 2, 1, "", "create"]], "trojanzoo.environ.Env": [[32, 1, 1, "", "add_argument"]], "trojanzoo.models": [[34, 0, 1, "", "Model"], [34, 0, 1, "", "_Model"], [34, 2, 1, "", "add_argument"], [34, 2, 1, "", "create"], [34, 2, 1, "", "output_available_models"]], "trojanzoo.models.Model": [[34, 1, 1, "", "_train"], [34, 1, 1, "", "_validate"], [34, 1, 1, "", "accuracy"], [34, 1, 1, "", "activate_params"], [34, 1, 1, "", "add_argument"], [34, 1, 1, "", "apply"], [34, 1, 1, "", "children"], [34, 1, 1, "", "cpu"], [34, 1, 1, "", "cuda"], [34, 1, 1, "", "define_criterion"], [34, 1, 1, "", "define_optimizer"], [34, 1, 1, "", "eval"], [34, 1, 1, "", "generate_target"], [34, 1, 1, "", "get_all_layer"], [34, 1, 1, "", "get_class"], [34, 1, 1, "", "get_data"], [34, 1, 1, "", "get_final_fm"], [34, 1, 1, "", "get_fm"], [34, 1, 1, "", "get_layer"], [34, 1, 1, "", "get_layer_name"], [34, 1, 1, "", "get_logits"], [34, 1, 1, "", "get_official_weights"], [34, 1, 1, "", "get_parallel_model"], [34, 1, 1, "", "get_prob"], [34, 1, 1, "", "get_target_prob"], [34, 1, 1, "", "load"], [34, 1, 1, "", "load_state_dict"], [34, 1, 1, "", "loss"], [34, 1, 1, "", "modules"], [34, 1, 1, "", "named_children"], [34, 1, 1, "", "named_modules"], [34, 1, 1, "", "named_parameters"], [34, 1, 1, "", "parameters"], [34, 1, 1, "", "remove_misclassify"], [34, 1, 1, "", "requires_grad_"], [34, 1, 1, "", "save"], [34, 1, 1, "", "state_dict"], [34, 1, 1, "", "summary"], [34, 1, 1, "", "train"], [34, 1, 1, "", "zero_grad"]], "trojanzoo.models._Model": [[34, 1, 1, "", "define_classifier"], [34, 1, 1, "", "define_features"], [34, 1, 1, "", "define_preprocess"], [34, 1, 1, "", "forward"], [34, 1, 1, "", "get_final_fm"], [34, 1, 1, "", "get_fm"]], "trojanzoo.optim": [[35, 0, 1, "", "Optimizer"]], "trojanzoo.optim.Optimizer": [[35, 1, 1, "", "early_stop_check"], [35, 1, 1, "", "optimize"], [35, 1, 1, "", "output_info"], [35, 1, 1, "", "preprocess_input"], [35, 1, 1, "", "update_input"]], "trojanzoo.trainer": [[36, 0, 1, "", "Trainer"], [36, 2, 1, "", "add_argument"], [36, 2, 1, "", "create"]], "trojanzoo.trainer.Trainer": [[36, 1, 1, "", "add_argument"], [36, 1, 1, "", "keys"]], "trojanzoo.utils.data": [[37, 0, 1, "", "TensorListDataset"], [37, 2, 1, "", "dataset_to_tensor"], [37, 2, 1, "", "get_class_subset"], [37, 2, 1, "", "sample_batch"], [37, 2, 1, "", "split_dataset"]], "trojanzoo.utils.fim": [[38, 0, 1, "", "BaseKFAC"], [38, 0, 1, "", "BaseState"], [38, 0, 1, "", "EKFAC"], [38, 0, 1, "", "KFAC"], [38, 0, 1, "", "KFACState"]], "trojanzoo.utils.lock": [[39, 0, 1, "", "Lock"]], "trojanzoo.utils.lock.Lock": [[39, 1, 1, "", "disable"], [39, 1, 1, "", "enable"]], "trojanzoo.utils.logger": [[40, 0, 1, "", "AverageMeter"], [40, 0, 1, "", "MetricLogger"], [40, 0, 1, "", "SmoothedValue"]], "trojanzoo.utils.logger.MetricLogger": [[40, 1, 1, "", "create_meters"], [40, 1, 1, "", "get_str"], [40, 1, 1, "", "log_every"], [40, 1, 1, "", "reset"], [40, 1, 1, "", "update"], [40, 1, 1, "", "update_list"]], "trojanzoo.utils.logger.SmoothedValue": [[40, 1, 1, "", "reset"], [40, 1, 1, "", "synchronize_between_processes"], [40, 1, 1, "", "update"], [40, 1, 1, "", "update_list"]], "trojanzoo.utils.memory": [[39, 2, 1, "", "empty_cache"], [39, 2, 1, "", "output_memory"]], "trojanzoo.utils.model": [[41, 0, 1, "", "ExponentialMovingAverage"], [41, 2, 1, "", "accuracy"], [41, 2, 1, "", "activate_params"], [41, 2, 1, "", "generate_target"], [41, 2, 1, "", "get_all_layer"], [41, 2, 1, "", "get_layer"], [41, 2, 1, "", "get_layer_name"], [41, 2, 1, "", "init_weights"], [41, 2, 1, "", "summary"]], "trojanzoo.utils.module": [[42, 0, 1, "", "BasicObject"], [42, 0, 1, "", "ModelProcess"], [42, 0, 1, "", "Module"], [42, 0, 1, "", "Param"], [42, 0, 1, "", "Process"]], "trojanzoo.utils.module.BasicObject": [[42, 1, 1, "", "summary"]], "trojanzoo.utils.module.Module": [[42, 1, 1, "", "clear"], [42, 1, 1, "", "copy"], [42, 1, 1, "", "items"], [42, 1, 1, "", "keys"], [42, 1, 1, "", "remove_none"], [42, 1, 1, "", "summary"], [42, 1, 1, "", "update"]], "trojanzoo.utils.module.Param": [[42, 1, 1, "", "clear"], [42, 1, 1, "", "remove_none"], [42, 1, 1, "", "update"]], "trojanzoo.utils.module.Process": [[42, 1, 1, "", "get_output"], [42, 1, 1, "", "get_output_int"], [42, 1, 1, "", "output_iter"]], "trojanzoo.utils.tensor": [[43, 2, 1, "", "add_noise"], [43, 2, 1, "", "atan_func"], [43, 2, 1, "", "repeat_to_batch"], [43, 2, 1, "", "tanh_func"]], "trojanzoo.utils.train": [[44, 2, 1, "", "train"], [44, 2, 1, "", "validate"]]}, "objtypes": {"0": "py:class", "1": "py:method", "2": "py:function", "3": "py:module"}, "objnames": {"0": ["py", "class", "Python class"], "1": ["py", "method", "Python method"], "2": ["py", "function", "Python function"], "3": ["py", "module", "Python module"]}, "titleterms": {"trojanzoo": [0, 33], "document": 0, "tutori": 0, "indic": 0, "tabl": 0, "adv": [1, 11], "clean_label": 2, "dynam": 3, "backdoor": [4, 13], "normal": [5, 10], "attack": [6, 28], "config": [7, 29], "folder": 8, "dataset": [9, 30], "attack_agnost": 12, "input_filt": 14, "model_inspect": 15, "training_filt": 16, "defens": [17, 31], "environ": [18, 32], "trojanvis": 19, "mark": 20, "model": [21, 34, 41], "na": 22, "other": 23, "torchvis": 24, "optim": [25, 35], "trainer": [26, 36], "util": [27, 39], "data": 37, "fim": 38, "logger": 40, "modul": 42, "tensor": 43, "train": 44, "basic": 45}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx": 60}, "alltitles": {"training_filtering": [[16, "training-filtering"]], "defenses": [[17, "defenses"], [31, "defenses"]], "trojanvision": [[19, "trojanvision"]], "input_filtering": [[14, "input-filtering"]], "backdoor": [[13, "backdoor"], [4, "backdoor"]], "adv": [[11, "adv"], [1, "adv"]], "model_inspection": [[15, "model-inspection"]], "normal": [[10, "normal"], [5, "normal"]], "environ": [[18, "module-trojanvision.environ"], [32, "environ"]], "attack_agnostic": [[12, "attack-agnostic"]], "datasets": [[30, "datasets"], [9, "datasets"]], "trainer": [[36, "trainer"], [26, "module-trojanvision.trainer"]], "utils": [[39, "utils"], [27, "utils"]], "optim": [[35, "optim"], [25, "optim"]], "data": [[37, "data"]], "fim": [[38, "fim"]], "models": [[34, "models"], [21, "models"]], "trojanzoo": [[33, "trojanzoo"]], "folder": [[8, "folder"]], "TrojanZoo documentation": [[0, "trojanzoo-documentation"]], "Tutorials": [[0, null]], "TrojanZoo Documentation": [[0, null]], "Indices and tables": [[0, "indices-and-tables"]], "dynamic": [[3, "dynamic"]], "attacks": [[6, "attacks"], [28, "attacks"]], "configs": [[7, "module-trojanvision.configs"], [29, "module-trojanzoo.configs"]], "clean_label": [[2, "clean-label"]], "torchvision": [[24, "torchvision"]], "marks": [[20, "marks"]], "others": [[23, "others"]], "nas": [[22, "nas"]], "logger": [[40, "logger"]], "train": [[44, "train"]], "tensor": [[43, "tensor"]], "basic": [[45, "basic"]], "model": [[41, "model"]], "module": [[42, "module"]]}, "indexentries": {"invisiblepoison (class in trojanvision.attacks)": [[2, "trojanvision.attacks.InvisiblePoison"]], "refool (class in trojanvision.attacks)": [[2, "trojanvision.attacks.Refool"]], "add_mark() (trojanvision.attacks.refool method)": [[2, "trojanvision.attacks.Refool.add_mark"]], "inputawaredynamic (class in trojanvision.attacks)": [[3, "trojanvision.attacks.InputAwareDynamic"]], "add_mark() (trojanvision.attacks.inputawaredynamic method)": [[3, "trojanvision.attacks.InputAwareDynamic.add_mark"]], "define_generator() (trojanvision.attacks.inputawaredynamic static method)": [[3, "trojanvision.attacks.InputAwareDynamic.define_generator"]], "get_data() (trojanvision.attacks.inputawaredynamic method)": [[3, "trojanvision.attacks.InputAwareDynamic.get_data"]], "get_filename() (trojanvision.attacks.inputawaredynamic method)": [[3, "trojanvision.attacks.InputAwareDynamic.get_filename"]], "get_mark() (trojanvision.attacks.inputawaredynamic method)": [[3, "trojanvision.attacks.InputAwareDynamic.get_mark"]], "get_mask() (trojanvision.attacks.inputawaredynamic method)": [[3, "trojanvision.attacks.InputAwareDynamic.get_mask"]], "load() (trojanvision.attacks.inputawaredynamic method)": [[3, "trojanvision.attacks.InputAwareDynamic.load"]], "save() (trojanvision.attacks.inputawaredynamic method)": [[3, "trojanvision.attacks.InputAwareDynamic.save"]], "train_mask_generator() (trojanvision.attacks.inputawaredynamic method)": [[3, "trojanvision.attacks.InputAwareDynamic.train_mask_generator"]], "badnet (class in trojanvision.attacks)": [[5, "trojanvision.attacks.BadNet"]], "imc (class in trojanvision.attacks)": [[5, "trojanvision.attacks.IMC"]], "latentbackdoor (class in trojanvision.attacks)": [[5, "trojanvision.attacks.LatentBackdoor"]], "trojannn (class in trojanvision.attacks)": [[5, "trojanvision.attacks.TrojanNN"]], "trojannet (class in trojanvision.attacks)": [[5, "trojanvision.attacks.TrojanNet"]], "denoise() (trojanvision.attacks.trojannn static method)": [[5, "trojanvision.attacks.TrojanNN.denoise"]], "get_avg_target_feats() (trojanvision.attacks.latentbackdoor method)": [[5, "trojanvision.attacks.LatentBackdoor.get_avg_target_feats"]], "get_neuron_idx() (trojanvision.attacks.trojannn method)": [[5, "trojanvision.attacks.TrojanNN.get_neuron_idx"]], "get_neuron_value() (trojanvision.attacks.trojannn method)": [[5, "trojanvision.attacks.TrojanNN.get_neuron_value"]], "optimize_mark() (trojanvision.attacks.imc method)": [[5, "trojanvision.attacks.IMC.optimize_mark"]], "preprocess_mark() (trojanvision.attacks.latentbackdoor method)": [[5, "trojanvision.attacks.LatentBackdoor.preprocess_mark"]], "preprocess_mark() (trojanvision.attacks.trojannn method)": [[5, "trojanvision.attacks.TrojanNN.preprocess_mark"]], "sample_data() (trojanvision.attacks.latentbackdoor method)": [[5, "trojanvision.attacks.LatentBackdoor.sample_data"]], "syn_random_noises() (trojanvision.attacks.trojannet method)": [[5, "trojanvision.attacks.TrojanNet.syn_random_noises"]], "syn_trigger_candidates() (trojanvision.attacks.trojannet method)": [[5, "trojanvision.attacks.TrojanNet.syn_trigger_candidates"]], "backdoorattack (class in trojanvision.attacks)": [[6, "trojanvision.attacks.BackdoorAttack"]], "cleanlabelbackdoor (class in trojanvision.attacks)": [[6, "trojanvision.attacks.CleanLabelBackdoor"]], "dynamicbackdoor (class in trojanvision.attacks)": [[6, "trojanvision.attacks.DynamicBackdoor"]], "add_argument() (in module trojanvision.attacks)": [[6, "trojanvision.attacks.add_argument"]], "add_mark() (trojanvision.attacks.backdoorattack method)": [[6, "trojanvision.attacks.BackdoorAttack.add_mark"]], "create() (in module trojanvision.attacks)": [[6, "trojanvision.attacks.create"]], "get_data() (trojanvision.attacks.backdoorattack method)": [[6, "trojanvision.attacks.BackdoorAttack.get_data"]], "get_filename() (trojanvision.attacks.backdoorattack method)": [[6, "trojanvision.attacks.BackdoorAttack.get_filename"]], "get_neuron_jaccard() (trojanvision.attacks.backdoorattack method)": [[6, "trojanvision.attacks.BackdoorAttack.get_neuron_jaccard"]], "get_poison_dataset() (trojanvision.attacks.backdoorattack method)": [[6, "trojanvision.attacks.BackdoorAttack.get_poison_dataset"]], "get_poison_dataset() (trojanvision.attacks.cleanlabelbackdoor method)": [[6, "trojanvision.attacks.CleanLabelBackdoor.get_poison_dataset"]], "load() (trojanvision.attacks.backdoorattack method)": [[6, "trojanvision.attacks.BackdoorAttack.load"]], "save() (trojanvision.attacks.backdoorattack method)": [[6, "trojanvision.attacks.BackdoorAttack.save"]], "validate_confidence() (trojanvision.attacks.backdoorattack method)": [[6, "trojanvision.attacks.BackdoorAttack.validate_confidence"]], "module": [[7, "module-trojanvision.configs"], [18, "module-trojanvision.environ"], [26, "module-trojanvision.trainer"], [29, "module-trojanzoo.configs"]], "trojanvision.configs": [[7, "module-trojanvision.configs"]], "cub200 (class in trojanvision.datasets)": [[8, "trojanvision.datasets.CUB200"]], "cub200_2011 (class in trojanvision.datasets)": [[8, "trojanvision.datasets.CUB200_2011"]], "gtsrb (class in trojanvision.datasets)": [[8, "trojanvision.datasets.GTSRB"]], "isic2018 (class in trojanvision.datasets)": [[8, "trojanvision.datasets.ISIC2018"]], "imagenet (class in trojanvision.datasets)": [[8, "trojanvision.datasets.ImageNet"]], "vggface2 (class in trojanvision.datasets)": [[8, "trojanvision.datasets.VGGface2"]], "imagefolder (class in trojanvision.datasets)": [[9, "trojanvision.datasets.ImageFolder"]], "imageset (class in trojanvision.datasets)": [[9, "trojanvision.datasets.ImageSet"]], "add_argument() (in module trojanvision.datasets)": [[9, "trojanvision.datasets.add_argument"]], "add_argument() (trojanvision.datasets.imagefolder class method)": [[9, "trojanvision.datasets.ImageFolder.add_argument"]], "add_argument() (trojanvision.datasets.imageset class method)": [[9, "trojanvision.datasets.ImageSet.add_argument"]], "create() (in module trojanvision.datasets)": [[9, "trojanvision.datasets.create"]], "get_data() (trojanvision.datasets.imageset static method)": [[9, "trojanvision.datasets.ImageSet.get_data"]], "get_transform() (trojanvision.datasets.imageset method)": [[9, "trojanvision.datasets.ImageSet.get_transform"]], "initialize() (trojanvision.datasets.imagefolder method)": [[9, "trojanvision.datasets.ImageFolder.initialize"]], "make_folder() (trojanvision.datasets.imageset method)": [[9, "trojanvision.datasets.ImageSet.make_folder"]], "sample() (trojanvision.datasets.imagefolder method)": [[9, "trojanvision.datasets.ImageFolder.sample"]], "cifar10 (class in trojanvision.datasets)": [[10, "trojanvision.datasets.CIFAR10"]], "cifar100 (class in trojanvision.datasets)": [[10, "trojanvision.datasets.CIFAR100"]], "imagenet16 (class in trojanvision.datasets)": [[10, "trojanvision.datasets.ImageNet16"]], "imagenet32 (class in trojanvision.datasets)": [[10, "trojanvision.datasets.ImageNet32"]], "mnist (class in trojanvision.datasets)": [[10, "trojanvision.datasets.MNIST"]], "stl10 (class in trojanvision.datasets)": [[10, "trojanvision.datasets.STL10"]], "get_transform() (trojanvision.datasets.stl10 method)": [[10, "trojanvision.datasets.STL10.get_transform"]], "advtrain (class in trojanvision.defenses)": [[12, "trojanvision.defenses.AdvTrain"]], "finepruning (class in trojanvision.defenses)": [[12, "trojanvision.defenses.FinePruning"]], "magnet (class in trojanvision.defenses)": [[12, "trojanvision.defenses.MagNet"]], "randomizedsmooth (class in trojanvision.defenses)": [[12, "trojanvision.defenses.RandomizedSmooth"]], "recompress (class in trojanvision.defenses)": [[12, "trojanvision.defenses.Recompress"]], "neo (class in trojanvision.defenses)": [[14, "trojanvision.defenses.Neo"]], "strip (class in trojanvision.defenses)": [[14, "trojanvision.defenses.Strip"]], "get_cls_diff() (trojanvision.defenses.neo method)": [[14, "trojanvision.defenses.Neo.get_cls_diff"]], "get_dominant_color() (trojanvision.defenses.neo method)": [[14, "trojanvision.defenses.Neo.get_dominant_color"]], "get_pred_label() (trojanvision.defenses.neo method)": [[14, "trojanvision.defenses.Neo.get_pred_label"]], "get_pred_labels() (trojanvision.defenses.strip method)": [[14, "trojanvision.defenses.Strip.get_pred_labels"]], "abs (class in trojanvision.defenses)": [[15, "trojanvision.defenses.ABS"]], "deepinspect (class in trojanvision.defenses)": [[15, "trojanvision.defenses.DeepInspect"]], "neuralcleanse (class in trojanvision.defenses)": [[15, "trojanvision.defenses.NeuralCleanse"]], "neuroninspect (class in trojanvision.defenses)": [[15, "trojanvision.defenses.NeuronInspect"]], "tabor (class in trojanvision.defenses)": [[15, "trojanvision.defenses.Tabor"]], "gen_seed_data() (trojanvision.defenses.abs method)": [[15, "trojanvision.defenses.ABS.gen_seed_data"]], "get_seed_data() (trojanvision.defenses.abs method)": [[15, "trojanvision.defenses.ABS.get_seed_data"]], "optimize_mark() (trojanvision.defenses.deepinspect method)": [[15, "trojanvision.defenses.DeepInspect.optimize_mark"]], "activationclustering (class in trojanvision.defenses)": [[16, "trojanvision.defenses.ActivationClustering"]], "analyze_by_distance() (trojanvision.defenses.activationclustering method)": [[16, "trojanvision.defenses.ActivationClustering.analyze_by_distance"]], "analyze_by_relative_size() (trojanvision.defenses.activationclustering method)": [[16, "trojanvision.defenses.ActivationClustering.analyze_by_relative_size"]], "analyze_by_silhouette_score() (trojanvision.defenses.activationclustering method)": [[16, "trojanvision.defenses.ActivationClustering.analyze_by_silhouette_score"]], "analyze_by_size() (trojanvision.defenses.activationclustering method)": [[16, "trojanvision.defenses.ActivationClustering.analyze_by_size"]], "backdoordefense (class in trojanvision.defenses)": [[17, "trojanvision.defenses.BackdoorDefense"]], "inputfiltering (class in trojanvision.defenses)": [[17, "trojanvision.defenses.InputFiltering"]], "modelinspection (class in trojanvision.defenses)": [[17, "trojanvision.defenses.ModelInspection"]], "trainingfiltering (class in trojanvision.defenses)": [[17, "trojanvision.defenses.TrainingFiltering"]], "add_argument() (in module trojanvision.defenses)": [[17, "trojanvision.defenses.add_argument"]], "check_early_stop() (trojanvision.defenses.modelinspection method)": [[17, "trojanvision.defenses.ModelInspection.check_early_stop"]], "create() (in module trojanvision.defenses)": [[17, "trojanvision.defenses.create"]], "get_datasets() (trojanvision.defenses.trainingfiltering method)": [[17, "trojanvision.defenses.TrainingFiltering.get_datasets"]], "get_filename() (trojanvision.defenses.backdoordefense method)": [[17, "trojanvision.defenses.BackdoorDefense.get_filename"]], "get_mark_loss_list() (trojanvision.defenses.modelinspection method)": [[17, "trojanvision.defenses.ModelInspection.get_mark_loss_list"]], "get_pred_labels() (trojanvision.defenses.inputfiltering method)": [[17, "trojanvision.defenses.InputFiltering.get_pred_labels"]], "get_pred_labels() (trojanvision.defenses.trainingfiltering method)": [[17, "trojanvision.defenses.TrainingFiltering.get_pred_labels"]], "get_test_data() (trojanvision.defenses.inputfiltering method)": [[17, "trojanvision.defenses.InputFiltering.get_test_data"]], "get_true_labels() (trojanvision.defenses.inputfiltering method)": [[17, "trojanvision.defenses.InputFiltering.get_true_labels"]], "get_true_labels() (trojanvision.defenses.trainingfiltering method)": [[17, "trojanvision.defenses.TrainingFiltering.get_true_labels"]], "load() (trojanvision.defenses.modelinspection method)": [[17, "trojanvision.defenses.ModelInspection.load"]], "loss() (trojanvision.defenses.modelinspection method)": [[17, "trojanvision.defenses.ModelInspection.loss"]], "optimize_mark() (trojanvision.defenses.modelinspection method)": [[17, "trojanvision.defenses.ModelInspection.optimize_mark"]], "trojanvision.environ": [[18, "module-trojanvision.environ"]], "watermark (class in trojanvision.marks)": [[20, "trojanvision.marks.Watermark"]], "add_argument() (in module trojanvision.marks)": [[20, "trojanvision.marks.add_argument"]], "add_argument() (trojanvision.marks.watermark static method)": [[20, "trojanvision.marks.Watermark.add_argument"]], "add_mark() (trojanvision.marks.watermark method)": [[20, "trojanvision.marks.Watermark.add_mark"]], "create() (in module trojanvision.marks)": [[20, "trojanvision.marks.create"]], "load_mark() (trojanvision.marks.watermark method)": [[20, "trojanvision.marks.Watermark.load_mark"]], "scatter_mark() (trojanvision.marks.watermark static method)": [[20, "trojanvision.marks.Watermark.scatter_mark"]], "imagemodel (class in trojanvision.models)": [[21, "trojanvision.models.ImageModel"]], "add_argument() (in module trojanvision.models)": [[21, "trojanvision.models.add_argument"]], "add_argument() (trojanvision.models.imagemodel class method)": [[21, "trojanvision.models.ImageModel.add_argument"]], "create() (in module trojanvision.models)": [[21, "trojanvision.models.create"]], "get_data() (trojanvision.models.imagemodel method)": [[21, "trojanvision.models.ImageModel.get_data"]], "get_heatmap() (trojanvision.models.imagemodel method)": [[21, "trojanvision.models.ImageModel.get_heatmap"]], "get_name() (trojanvision.models.imagemodel class method)": [[21, "trojanvision.models.ImageModel.get_name"]], "output_available_models() (in module trojanvision.models)": [[21, "trojanvision.models.output_available_models"]], "darts (class in trojanvision.models)": [[22, "trojanvision.models.DARTS"]], "enas (class in trojanvision.models)": [[22, "trojanvision.models.ENAS"]], "natsbench (class in trojanvision.models)": [[22, "trojanvision.models.NATSbench"]], "pnasnet (class in trojanvision.models)": [[22, "trojanvision.models.PNASNet"]], "proxylessnas (class in trojanvision.models)": [[22, "trojanvision.models.ProxylessNAS"]], "magnet (class in trojanvision.models)": [[23, "trojanvision.models.MagNet"]], "alexnet (class in trojanvision.models)": [[24, "trojanvision.models.AlexNet"]], "densenet (class in trojanvision.models)": [[24, "trojanvision.models.DenseNet"]], "efficientnet (class in trojanvision.models)": [[24, "trojanvision.models.EfficientNet"]], "mnasnet (class in trojanvision.models)": [[24, "trojanvision.models.MNASNet"]], "mobilenet (class in trojanvision.models)": [[24, "trojanvision.models.MobileNet"]], "resnet (class in trojanvision.models)": [[24, "trojanvision.models.ResNet"]], "shufflenetv2 (class in trojanvision.models)": [[24, "trojanvision.models.ShuffleNetV2"]], "vgg (class in trojanvision.models)": [[24, "trojanvision.models.VGG"]], "trojanvision.trainer": [[26, "module-trojanvision.trainer"]], "attack (class in trojanzoo.attacks)": [[28, "trojanzoo.attacks.Attack"]], "add_argument() (in module trojanzoo.attacks)": [[28, "trojanzoo.attacks.add_argument"]], "add_argument() (trojanzoo.attacks.attack class method)": [[28, "trojanzoo.attacks.Attack.add_argument"]], "attack() (trojanzoo.attacks.attack method)": [[28, "trojanzoo.attacks.Attack.attack"]], "create() (in module trojanzoo.attacks)": [[28, "trojanzoo.attacks.create"]], "generate_target() (trojanzoo.attacks.attack method)": [[28, "trojanzoo.attacks.Attack.generate_target"]], "config (class in trojanzoo.configs)": [[29, "trojanzoo.configs.Config"]], "get_config() (trojanzoo.configs.config method)": [[29, "trojanzoo.configs.Config.get_config"]], "load_config() (trojanzoo.configs.config static method)": [[29, "trojanzoo.configs.Config.load_config"]], "merge() (trojanzoo.configs.config method)": [[29, "trojanzoo.configs.Config.merge"]], "summary() (trojanzoo.configs.config method)": [[29, "trojanzoo.configs.Config.summary"]], "trojanzoo.configs": [[29, "module-trojanzoo.configs"]], "dataset (class in trojanzoo.datasets)": [[30, "trojanzoo.datasets.Dataset"]], "add_argument() (in module trojanzoo.datasets)": [[30, "trojanzoo.datasets.add_argument"]], "add_argument() (trojanzoo.datasets.dataset class method)": [[30, "trojanzoo.datasets.Dataset.add_argument"]], "check_files() (trojanzoo.datasets.dataset method)": [[30, "trojanzoo.datasets.Dataset.check_files"]], "create() (in module trojanzoo.datasets)": [[30, "trojanzoo.datasets.create"]], "get_class_subset() (trojanzoo.datasets.dataset static method)": [[30, "trojanzoo.datasets.Dataset.get_class_subset"]], "get_data() (trojanzoo.datasets.dataset method)": [[30, "trojanzoo.datasets.Dataset.get_data"]], "get_dataloader() (trojanzoo.datasets.dataset method)": [[30, "trojanzoo.datasets.Dataset.get_dataloader"]], "get_dataset() (trojanzoo.datasets.dataset method)": [[30, "trojanzoo.datasets.Dataset.get_dataset"]], "get_loss_weights() (trojanzoo.datasets.dataset method)": [[30, "trojanzoo.datasets.Dataset.get_loss_weights"]], "get_org_dataset() (trojanzoo.datasets.dataset method)": [[30, "trojanzoo.datasets.Dataset.get_org_dataset"]], "get_transform() (trojanzoo.datasets.dataset method)": [[30, "trojanzoo.datasets.Dataset.get_transform"]], "initialize() (trojanzoo.datasets.dataset method)": [[30, "trojanzoo.datasets.Dataset.initialize"]], "split_dataset() (trojanzoo.datasets.dataset static method)": [[30, "trojanzoo.datasets.Dataset.split_dataset"]], "defense (class in trojanzoo.defenses)": [[31, "trojanzoo.defenses.Defense"]], "add_argument() (in module trojanzoo.defenses)": [[31, "trojanzoo.defenses.add_argument"]], "add_argument() (trojanzoo.defenses.defense class method)": [[31, "trojanzoo.defenses.Defense.add_argument"]], "create() (in module trojanzoo.defenses)": [[31, "trojanzoo.defenses.create"]], "detect() (trojanzoo.defenses.defense method)": [[31, "trojanzoo.defenses.Defense.detect"]], "env (class in trojanzoo.environ)": [[32, "trojanzoo.environ.Env"]], "add_argument() (in module trojanzoo.environ)": [[32, "trojanzoo.environ.add_argument"]], "add_argument() (trojanzoo.environ.env class method)": [[32, "trojanzoo.environ.Env.add_argument"]], "create() (in module trojanzoo.environ)": [[32, "trojanzoo.environ.create"]], "model (class in trojanzoo.models)": [[34, "trojanzoo.models.Model"]], "_model (class in trojanzoo.models)": [[34, "trojanzoo.models._Model"]], "_train() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model._train"]], "_validate() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model._validate"]], "accuracy() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.accuracy"]], "activate_params() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.activate_params"]], "add_argument() (in module trojanzoo.models)": [[34, "trojanzoo.models.add_argument"]], "add_argument() (trojanzoo.models.model static method)": [[34, "trojanzoo.models.Model.add_argument"]], "apply() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.apply"]], "children() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.children"]], "cpu() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.cpu"]], "create() (in module trojanzoo.models)": [[34, "trojanzoo.models.create"]], "cuda() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.cuda"]], "define_classifier() (trojanzoo.models._model static method)": [[34, "trojanzoo.models._Model.define_classifier"]], "define_criterion() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.define_criterion"]], "define_features() (trojanzoo.models._model static method)": [[34, "trojanzoo.models._Model.define_features"]], "define_optimizer() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.define_optimizer"]], "define_preprocess() (trojanzoo.models._model class method)": [[34, "trojanzoo.models._Model.define_preprocess"]], "eval() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.eval"]], "forward() (trojanzoo.models._model method)": [[34, "trojanzoo.models._Model.forward"]], "generate_target() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.generate_target"]], "get_all_layer() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_all_layer"]], "get_class() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_class"]], "get_data() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_data"]], "get_final_fm() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_final_fm"]], "get_final_fm() (trojanzoo.models._model method)": [[34, "trojanzoo.models._Model.get_final_fm"]], "get_fm() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_fm"]], "get_fm() (trojanzoo.models._model method)": [[34, "trojanzoo.models._Model.get_fm"]], "get_layer() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_layer"]], "get_layer_name() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_layer_name"]], "get_logits() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_logits"]], "get_official_weights() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_official_weights"]], "get_parallel_model() (trojanzoo.models.model static method)": [[34, "trojanzoo.models.Model.get_parallel_model"]], "get_prob() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_prob"]], "get_target_prob() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.get_target_prob"]], "load() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.load"]], "load_state_dict() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.load_state_dict"]], "loss() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.loss"]], "modules() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.modules"]], "named_children() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.named_children"]], "named_modules() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.named_modules"]], "named_parameters() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.named_parameters"]], "output_available_models() (in module trojanzoo.models)": [[34, "trojanzoo.models.output_available_models"]], "parameters() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.parameters"]], "remove_misclassify() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.remove_misclassify"]], "requires_grad_() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.requires_grad_"]], "save() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.save"]], "state_dict() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.state_dict"]], "summary() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.summary"]], "train() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.train"]], "zero_grad() (trojanzoo.models.model method)": [[34, "trojanzoo.models.Model.zero_grad"]], "optimizer (class in trojanzoo.optim)": [[35, "trojanzoo.optim.Optimizer"]], "early_stop_check() (trojanzoo.optim.optimizer method)": [[35, "trojanzoo.optim.Optimizer.early_stop_check"]], "optimize() (trojanzoo.optim.optimizer method)": [[35, "trojanzoo.optim.Optimizer.optimize"]], "output_info() (trojanzoo.optim.optimizer method)": [[35, "trojanzoo.optim.Optimizer.output_info"]], "preprocess_input() (trojanzoo.optim.optimizer method)": [[35, "trojanzoo.optim.Optimizer.preprocess_input"]], "update_input() (trojanzoo.optim.optimizer method)": [[35, "trojanzoo.optim.Optimizer.update_input"]], "trainer (class in trojanzoo.trainer)": [[36, "trojanzoo.trainer.Trainer"]], "add_argument() (in module trojanzoo.trainer)": [[36, "trojanzoo.trainer.add_argument"]], "add_argument() (trojanzoo.trainer.trainer class method)": [[36, "trojanzoo.trainer.Trainer.add_argument"]], "create() (in module trojanzoo.trainer)": [[36, "trojanzoo.trainer.create"]], "keys() (trojanzoo.trainer.trainer method)": [[36, "trojanzoo.trainer.Trainer.keys"]], "tensorlistdataset (class in trojanzoo.utils.data)": [[37, "trojanzoo.utils.data.TensorListDataset"]], "dataset_to_tensor() (in module trojanzoo.utils.data)": [[37, "trojanzoo.utils.data.dataset_to_tensor"]], "get_class_subset() (in module trojanzoo.utils.data)": [[37, "trojanzoo.utils.data.get_class_subset"]], "sample_batch() (in module trojanzoo.utils.data)": [[37, "trojanzoo.utils.data.sample_batch"]], "split_dataset() (in module trojanzoo.utils.data)": [[37, "trojanzoo.utils.data.split_dataset"]], "basekfac (class in trojanzoo.utils.fim)": [[38, "trojanzoo.utils.fim.BaseKFAC"]], "basestate (class in trojanzoo.utils.fim)": [[38, "trojanzoo.utils.fim.BaseState"]], "ekfac (class in trojanzoo.utils.fim)": [[38, "trojanzoo.utils.fim.EKFAC"]], "kfac (class in trojanzoo.utils.fim)": [[38, "trojanzoo.utils.fim.KFAC"]], "kfacstate (class in trojanzoo.utils.fim)": [[38, "trojanzoo.utils.fim.KFACState"]], "lock (class in trojanzoo.utils.lock)": [[39, "trojanzoo.utils.lock.Lock"]], "disable() (trojanzoo.utils.lock.lock method)": [[39, "trojanzoo.utils.lock.Lock.disable"]], "empty_cache() (in module trojanzoo.utils.memory)": [[39, "trojanzoo.utils.memory.empty_cache"]], "enable() (trojanzoo.utils.lock.lock method)": [[39, "trojanzoo.utils.lock.Lock.enable"]], "output_memory() (in module trojanzoo.utils.memory)": [[39, "trojanzoo.utils.memory.output_memory"]], "averagemeter (class in trojanzoo.utils.logger)": [[40, "trojanzoo.utils.logger.AverageMeter"]], "metriclogger (class in trojanzoo.utils.logger)": [[40, "trojanzoo.utils.logger.MetricLogger"]], "smoothedvalue (class in trojanzoo.utils.logger)": [[40, "trojanzoo.utils.logger.SmoothedValue"]], "create_meters() (trojanzoo.utils.logger.metriclogger method)": [[40, "trojanzoo.utils.logger.MetricLogger.create_meters"]], "get_str() (trojanzoo.utils.logger.metriclogger method)": [[40, "trojanzoo.utils.logger.MetricLogger.get_str"]], "log_every() (trojanzoo.utils.logger.metriclogger method)": [[40, "trojanzoo.utils.logger.MetricLogger.log_every"]], "reset() (trojanzoo.utils.logger.metriclogger method)": [[40, "trojanzoo.utils.logger.MetricLogger.reset"]], "reset() (trojanzoo.utils.logger.smoothedvalue method)": [[40, "trojanzoo.utils.logger.SmoothedValue.reset"]], "synchronize_between_processes() (trojanzoo.utils.logger.smoothedvalue method)": [[40, "trojanzoo.utils.logger.SmoothedValue.synchronize_between_processes"]], "update() (trojanzoo.utils.logger.metriclogger method)": [[40, "trojanzoo.utils.logger.MetricLogger.update"]], "update() (trojanzoo.utils.logger.smoothedvalue method)": [[40, "trojanzoo.utils.logger.SmoothedValue.update"]], "update_list() (trojanzoo.utils.logger.metriclogger method)": [[40, "trojanzoo.utils.logger.MetricLogger.update_list"]], "update_list() (trojanzoo.utils.logger.smoothedvalue method)": [[40, "trojanzoo.utils.logger.SmoothedValue.update_list"]], "exponentialmovingaverage (class in trojanzoo.utils.model)": [[41, "trojanzoo.utils.model.ExponentialMovingAverage"]], "accuracy() (in module trojanzoo.utils.model)": [[41, "trojanzoo.utils.model.accuracy"]], "activate_params() (in module trojanzoo.utils.model)": [[41, "trojanzoo.utils.model.activate_params"]], "generate_target() (in module trojanzoo.utils.model)": [[41, "trojanzoo.utils.model.generate_target"]], "get_all_layer() (in module trojanzoo.utils.model)": [[41, "trojanzoo.utils.model.get_all_layer"]], "get_layer() (in module trojanzoo.utils.model)": [[41, "trojanzoo.utils.model.get_layer"]], "get_layer_name() (in module trojanzoo.utils.model)": [[41, "trojanzoo.utils.model.get_layer_name"]], "init_weights() (in module trojanzoo.utils.model)": [[41, "trojanzoo.utils.model.init_weights"]], "summary() (in module trojanzoo.utils.model)": [[41, "trojanzoo.utils.model.summary"]], "basicobject (class in trojanzoo.utils.module)": [[42, "trojanzoo.utils.module.BasicObject"]], "modelprocess (class in trojanzoo.utils.module)": [[42, "trojanzoo.utils.module.ModelProcess"]], "module (class in trojanzoo.utils.module)": [[42, "trojanzoo.utils.module.Module"]], "param (class in trojanzoo.utils.module)": [[42, "trojanzoo.utils.module.Param"]], "process (class in trojanzoo.utils.module)": [[42, "trojanzoo.utils.module.Process"]], "clear() (trojanzoo.utils.module.module method)": [[42, "trojanzoo.utils.module.Module.clear"]], "clear() (trojanzoo.utils.module.param method)": [[42, "trojanzoo.utils.module.Param.clear"]], "copy() (trojanzoo.utils.module.module method)": [[42, "trojanzoo.utils.module.Module.copy"]], "get_output() (trojanzoo.utils.module.process method)": [[42, "trojanzoo.utils.module.Process.get_output"]], "get_output_int() (trojanzoo.utils.module.process class method)": [[42, "trojanzoo.utils.module.Process.get_output_int"]], "items() (trojanzoo.utils.module.module method)": [[42, "trojanzoo.utils.module.Module.items"]], "keys() (trojanzoo.utils.module.module method)": [[42, "trojanzoo.utils.module.Module.keys"]], "output_iter() (trojanzoo.utils.module.process static method)": [[42, "trojanzoo.utils.module.Process.output_iter"]], "remove_none() (trojanzoo.utils.module.module method)": [[42, "trojanzoo.utils.module.Module.remove_none"]], "remove_none() (trojanzoo.utils.module.param method)": [[42, "trojanzoo.utils.module.Param.remove_none"]], "summary() (trojanzoo.utils.module.basicobject method)": [[42, "trojanzoo.utils.module.BasicObject.summary"]], "summary() (trojanzoo.utils.module.module method)": [[42, "trojanzoo.utils.module.Module.summary"]], "update() (trojanzoo.utils.module.module method)": [[42, "trojanzoo.utils.module.Module.update"]], "update() (trojanzoo.utils.module.param method)": [[42, "trojanzoo.utils.module.Param.update"]], "add_noise() (in module trojanzoo.utils.tensor)": [[43, "trojanzoo.utils.tensor.add_noise"]], "atan_func() (in module trojanzoo.utils.tensor)": [[43, "trojanzoo.utils.tensor.atan_func"]], "repeat_to_batch() (in module trojanzoo.utils.tensor)": [[43, "trojanzoo.utils.tensor.repeat_to_batch"]], "tanh_func() (in module trojanzoo.utils.tensor)": [[43, "trojanzoo.utils.tensor.tanh_func"]], "train() (in module trojanzoo.utils.train)": [[44, "trojanzoo.utils.train.train"]], "validate() (in module trojanzoo.utils.train)": [[44, "trojanzoo.utils.train.validate"]]}}) \ No newline at end of file diff --git a/trojanvision/attacks/adv.html b/trojanvision/attacks/adv.html new file mode 100644 index 00000000..2dff1ee5 --- /dev/null +++ b/trojanvision/attacks/adv.html @@ -0,0 +1,446 @@ + + + + + + + + + + + + + + + + adv — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

adv

+
+ + +
+ +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/attacks/backdoor/clean_label.html b/trojanvision/attacks/backdoor/clean_label.html new file mode 100644 index 00000000..2ae52f78 --- /dev/null +++ b/trojanvision/attacks/backdoor/clean_label.html @@ -0,0 +1,631 @@ + + + + + + + + + + + + + + + + clean_label — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

clean_label

+
+
+class trojanvision.attacks.InvisiblePoison(generator_mode='default', noise_coeff=0.35, train_generator_epochs=800, **kwargs)[source]
+

Invisible Poison Backdoor Attack proposed by Rui Ning +from Old Dominion University in INFOCOM 2021.

+

Based on trojanvision.attacks.CleanLabelBackdoor, +InvisiblePoison preprocesses the trigger by a generator (auto-encoder) +to amplify its feature activation and make it invisible.

+ +
+
Parameters:
+
    +
  • generator_mode (str) – Choose from ['default', 'resnet_comp', 'resnet'] +Defaults to 'default'.

  • +
  • noise_coeff (float) – Minify rate of adversarial features. +Defaults to 0.35.

  • +
  • train_generator_epochs (int) – Epochs of training generator (auto-encoder). +Defaults to 10.

  • +
+
+
+
+ +
+
+class trojanvision.attacks.Refool(candidate_num=100, rank_iter=16, refool_epochs=5, refool_lr=1e-3, refool_sample_percent=0.1, voc_root=None, efficient=False, **kwargs)[source]
+

Reflection Backdoor Attack (Refool) proposed by Yunfei Liu +from Beihang University in ECCV 2020.

+

It inherits trojanvision.attacks.CleanLabelBackdoor.

+
+

Note

+
    +
  • Trigger size must be the same as image size.

  • +
  • Currently, mark_alpha is forced to be -1.0, +which means to use mean of image and mark to blend them. +It should be possible to set a manual mark_alpha instead.

  • +
+
+

The attack has 3 procedures:

+
+
    +
  • Generate candidate_num reflect images from another public dataset (e.g., Pascal VOC) as trigger candidates.

    +
      +
    • Select a reflect class (e.g., 'cat') +and a background class (e.g., 'person')

    • +
    • Find all images of those 2 classes that +don’t have the object of the other class in them.

    • +
    • For image pairs from 2 classes, process and blend them using 'ghost effect' +or 'focal blur'.

    • +
    • Calculate difference between blended image and reflect image.

    • +
    • Calculate structure similarity (SSIM) between blended image and background image +by calling skimage.metrics.structural_similarity.

    • +
    • If the difference is relatively large enough, blended image is not very dark +and SSIM is around (0.7, 0.85), current reflect image is added to candidates.

    • +
    +
  • +
  • Rank candidate triggers by conducting tentative attack with multiple triggers injected together.

    +
      +
    • (Initialize, not repeated) Assign all candidate triggers with same sampling weights.

    • +
    • Sample certain amount (e.g., 40% in original code) of clean data from training set in target class.

    • +
    • Randomly attach a candidate trigger on each clean input according to their sampling weights.

    • +
    • Use the infected data as poison dataset to retrain a pretrained model +with refool_epochs and refool_lr.

    • +
    • Evaluate attack succ rate of each used trigger as their new sampling weights.

    • +
    • Set sampling weights of all unused triggers to the median of used ones.

    • +
    • Reset the model as pretrained state.

    • +
    • Repeat the ranking process for rank_iter times.

    • +
    +
  • +
  • Use the trigger with largest sampling weight for final attack +(with 'dataset' train_mode).

  • +
+
+ +
+

Note

+

There are differences between our implementation and original codes. +I’ve consulted first author to clarify that current implementation of TrojanZoo should work.

+
    +
  • +
    Author’s code allows repeat during generating candidate reflect images.
    +
    Our code has NO repeat.
    +
    +
  • +
  • +
    Author’s code generates 160 (actually usually not reaching this number) +candidate reflect images but requires 200 during attack, which causes more repeat.
    +
    Our code generate candidate_num (100 as default) unique candidates.
    +
    +
  • +
  • +
    Author’s code uses a very large refool_epochs (600), +which causes too much clean accuracy drop and is very slow.
    +
    Our code uses 5 as default.
    +
    +
  • +
  • +
    Author’s code uses a very large refool_sample_percent (0.4), +which causes too much clean accuracy drop.
    +
    Our code uses 0.1 as default.
    +
    +
  • +
  • +
    There should be a pretrained model that is reset at every ranking loop.
    +
    However, the paper and original code don’t mention that.
    +
    The author tells me that they load pretrained model from ImageNet.
    +
    +
  • +
  • There is no attack code provided by original author after ranking candidate reflect images.

  • +
+

There is also a conflict between codes and paper from original author.

+
    +
  • +
    Paper claims to use top-candidate_num selection at every ranking loop in Algorithm 1.
    +
    Author’s code uses random sampling according to W as sampling weights.
    +
    Our code follows author’s code.
    +
    +
  • +
+
+
+
Parameters:
+
    +
  • candidate_num (int) – Number of candidate reflect images. +Defaults to 100.

  • +
  • rank_iter (int) – Iteration to update sampling weights of candidate reflect images. +Defaults to 16.

  • +
  • refool_epochs (int) – Retraining epochs during trigger ranking. +Defaults to 5.

  • +
  • refool_lr (float) – Retraining learning rate during trigger ranking. +Defaults to 1e-3.

  • +
  • refool_sample_percent (float) – Percentage of retraining samples +by training set in target class during trigger ranking. +Defaults to 0.1.

  • +
  • voc_root (str) – Path to Pascal VOC dataset. +Defaults to '{data_dir}/image/voc'.

  • +
  • efficient (bool) – Whether to only use a subset (20%) to evaluate ASR during trigger ranking. +Defaults to False.

  • +
+
+
Variables:
+
    +
  • reflect_imgs (torch.Tensor) – Candidate reflect images with shape (candidate_num, C, H, W).

  • +
  • train_mode (str) – Training mode to inject backdoor. Forced to be ‘dataset’. +See detailed description in trojanvision.attacks.BadNet.

  • +
  • poison_set (torch.utils.data.Dataset) – Poison dataset (no clean data). +It is None at initialization because the best trigger keeps unknown.

  • +
  • refool_sample_num (int) – Number of retraining samples from training set +in target class during trigger ranking. +refool_sample_percent * len(target_set)

  • +
  • target_set (torch.utils.data.Dataset) – Training set in target class.

  • +
+
+
+
+
+add_mark(x, **kwargs)[source]
+

Add watermark to input tensor by calling +trojanvision.attacks.BadNet.add_mark().

+

If mark_alpha <0, use mean of x +and self.mark.mark as their weights.

+
+ +
+ +
+ + +
+ +
+ + +
+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/attacks/backdoor/dynamic.html b/trojanvision/attacks/backdoor/dynamic.html new file mode 100644 index 00000000..9a40884b --- /dev/null +++ b/trojanvision/attacks/backdoor/dynamic.html @@ -0,0 +1,663 @@ + + + + + + + + + + + + + + + + dynamic — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

dynamic

+
+
+class trojanvision.attacks.InputAwareDynamic(train_mask_epochs=25, lambda_div=1.0, lambda_norm=100.0, mask_density=0.032, cross_percent=0.1, natural=False, poison_percent=0.1, **kwargs)[source]
+

Input-Aware Dynamic Backdoor Attack proposed by Anh Nguyen and Anh Tran +from VinAI Research in NIPS 2020.

+

Based on trojanvision.attacks.BadNet, +InputAwareDynamic trains mark generator and mask generator +to synthesize unique watermark for each input.

+

In classification loss, besides attacking poison inputs and classifying clean inputs, +InputAwareDynamic also requires inputs attached +with triggers generated from other inputs +are still classified correctly (cross-trigger mode).

+ +
+# train mask generatoroptmask=Adam(Gmask.parameters(),lr=0.01,betas=(0.5,0.9))fore=1totrain_mask_epochsforx1intrain_setx2=sample_another_batch(train_set)Ldiv=x1x2Gmask(x1)Gmask(x2)Lnorm=ReLU(Gmask(x1)mask_density).mean()Lmask=λdivLdiv+λnormLnormoptmask.step()# train mark generator and modeloptmark=Adam(Gmark.parameters(),lr=0.01,betas=(0.5,0.9))fore=1toepochsfor(x1,y1)intrain_setx2=sample_another_batch(train_set)markpoison,maskpoison=Gmark,Gmask(x1[:npoison])markcross,maskcross=Gmark,Gmask(x2[npoison:npoison+ncross])xpoison=maskpoisonmarkpoison+(1maskpoison)x1[:npoison]xcross=maskcrossmarkcross+(1maskcross)x1[npoison:npoison+ncross]x=cat([xpoison,xcross,x1[npoison+ncross:]])y=cat([ypoison,y1[npoison:]])Ldiv=xpoisonxcrossmarkpoisonmarkcrossLce=cross_entropy(x,y)L=Lce+λdivLdivoptmark.step()optmodel.step()\begin{aligned} + &\textbf{\# train mask generator} \\ + &{opt}_{mask} = \text{Adam}(G_{mask}.parameters(), \text{lr}=0.01, \text{betas}=(0.5, 0.9)) \\ + &\textbf{for} \: e=1 \: \textbf{to} \: \text{train\_mask\_epochs} \\ + &\hspace{5mm}\textbf{for} \: x_1 \: \textbf{in} \: \text{train\_set} \\ + &\hspace{10mm}x_2 = \text{sample\_another\_batch}(\text{train\_set}) \\ + &\hspace{10mm}\mathcal{L}_{div} = \frac{\lVert x_1 - x_2 \rVert}{\lVert G_{mask}(x_1) - G_{mask}(x_2) \rVert} \\ + &\hspace{10mm}\mathcal{L}_{norm} = ReLU(G_{mask}(x_1) - \text{mask\_density}).mean() \\ + &\hspace{10mm}\mathcal{L}_{mask} = \lambda_{div} \mathcal{L}_{div} + \lambda_{norm} \mathcal{L}_{norm} \\ + &\hspace{10mm}{opt}_{mask}.step() \\ + &\rule{110mm}{0.4pt} \\ + &\textbf{\# train mark generator and model} \\ + &{opt}_{mark} = \text{Adam}(G_{mark}.parameters(), \text{lr}=0.01, \text{betas}=(0.5, 0.9)) \\ + &\textbf{for} \: e=1 \: \textbf{to} \: \text{epochs} \\ + &\hspace{5mm}\textbf{for} \: (x_1, y_1) \: \textbf{in} \: \text{train\_set} \\ + &\hspace{10mm}x_2 = \text{sample\_another\_batch}(\text{train\_set}) \\ + &\hspace{10mm}{mark}_{poison}, {mask}_{poison} = G_{mark}, G_{mask} (x_1[:n_{poison}]) \\ + &\hspace{10mm}{mark}_{cross}, {mask}_{cross} = G_{mark}, G_{mask} (x_2[n_{poison}: n_{poison} + n_{cross}]) \\ + &\hspace{10mm}x_{poison} = {mask}_{poison} \cdot {mark}_{poison} + (1 - {mask}_{poison}) \cdot x_1[:n_{poison}] \\ + &\hspace{10mm}x_{cross} = {mask}_{cross} \cdot {mark}_{cross} + (1 - {mask}_{cross}) \cdot x_1[n_{poison}: n_{poison} + n_{cross}] \\ + &\hspace{10mm}x = cat([x_{poison}, x_{cross}, x_1[n_{poison}+n_{cross}:]]) \\ + &\hspace{10mm}y = cat([y_{poison}, y_1[n_{poison}:]]) \\ + &\hspace{10mm}\mathcal{L}_{div} = \frac{\lVert x_{poison} - x_{cross} \rVert}{\lVert {mark}_{poison} - {mark}_{cross} \rVert} \\ + &\hspace{10mm}\mathcal{L}_{ce} = cross\_entropy(x, y) \\ + &\hspace{10mm}\mathcal{L} = \mathcal{L}_{ce} + \lambda_{div}\mathcal{L}_{div} \\ + &\hspace{10mm}{opt}_{mark}.step() \\ + &\hspace{10mm}{opt}_{model}.step() \\ +\end{aligned} + +
+
Parameters:
+
    +
  • train_mask_epochs (int) – Epoch to optimize mask generator. +Defaults to 25.

  • +
  • lambda_div (float) – Weight of diversity loss +during both optimization processes. +Defaults to 1.0.

  • +
  • lambda_norm (float) – Weight of norm loss +when optimizing mask generator. +Defaults to 100.0.

  • +
  • mask_density (float) – Threshold of mask values +when optimizing norm loss. +Defaults to 0.032.

  • +
  • cross_percent (float) – Percentage of cross inputs +in the whole training set. +Defaults to 0.1.

  • +
  • poison_percent (float) – Percentage of poison inputs +in the whole training set. +Defaults to 0.1.

  • +
  • natural (bool) – Whether to use natural backdoors. +If True, model parameters will be frozen. +Defaults to False.

  • +
+
+
Variables:
+
+
+
+
+

Note

+

Do NOT directly call self.mark_generator +or self.mask_generator. +Their raw outputs are not normalized into range [0, 1]. +Please call get_mark() and get_mask() instead.

+
+
+
+add_mark(x, **kwargs)[source]
+

Add watermark to input tensor by calling +get_mark() and get_mask().

+
+ +
+
+static define_generator(num_channels=[32, 64, 128], in_channels=3, out_channels=None)[source]
+

Define a generator used in self.mark_generator and self.mask_generator.

+

Similar to auto-encoders, the generator is composed of ['down', 'middle', 'up'].

+
    +
  • down: [conv-bn-relu(ci,ci+1),conv-bn-relu(ci+1,ci+1),maxpool(2)][\text{conv-bn-relu}(c_{i}, c_{i+1}), \text{conv-bn-relu}(c_{i+1}, c_{i+1}), \text{maxpool}(2)]

  • +
  • middle: [conv-bn-relu(c1,c1)][\text{conv-bn-relu}(c_{-1}, c_{-1})]

  • +
  • up: [upsample(2),conv-bn-relu(ci+1,ci+1),conv-bn-relu(ci+1,ci)][\text{upsample}(2), \text{conv-bn-relu}(c_{i+1}, c_{i+1}), \text{conv-bn-relu}(c_{i+1}, c_{i})]

  • +
+
+
Parameters:
+
    +
  • num_channels (list[int]) –

    List of intermediate feature numbers. +Each element serves as the in_channels of current layer +and out_features of preceding layer. +Defaults to [32, 64, 128].

    +
      +
    • MNIST: [16, 32]

    • +
    • CIFAR: [32, 64, 128]

    • +
    +

  • +
  • in_channels (int) – in_channels of first conv layer in down. +It should be image channels. +Defaults to 3.

  • +
  • out_channels (int) – out_channels of last conv layer in up. +Defaults to None (in_channels).

  • +
+
+
Returns:
+

torch.nn.Sequential

+
+
Generator instance with input shape (N, in_channels, H, W)

and output shape (N, out_channels, H, W).

+
+
+

+
+
+
+ +
+
+get_data(data, org=False, keep_org=True, poison_label=True, **kwargs)[source]
+

Get data.

+
+

Note

+

The difference between this and +trojanvision.attacks.BadNet.get_data() is:

+

This method replaces some clean data with poison version, +while BadNet’s keeps the clean data and append poison version.

+
+
+ +
+
+get_filename(target_class=None, **kwargs)[source]
+

Get filenames for current attack settings.

+
+ +
+
+get_mark(_input)[source]
+

Get mark with shape (N, C, H, W).

+
+raw=self.mark_generator(input)returntanh(raw)+12\begin{aligned} + &raw = \text{self.mark\_generator(input)} \\ + &\textbf{return} \frac{\tanh{(raw)} + 1}{2} +\end{aligned} + +
+ +
+
+get_mask(_input)[source]
+

Get mask with shape (N, 1, H, W).

+
+raw=self.mask_generator(input)returntanh[10tanh(raw)]+12\begin{aligned} + &raw = \text{self.mask\_generator(input)} \\ + &\textbf{return} \frac{\tanh{[10 \cdot \tanh{(raw)}]} + 1}{2} +\end{aligned} + +
+ +
+
+load(filename=None, **kwargs)[source]
+

Load attack results from previously saved files.

+
+ +
+
+save(filename=None, **kwargs)[source]
+

Save attack results to files.

+
+ +
+
+train_mask_generator(verbose=True)[source]
+

Train self.mask_generator.

+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/attacks/backdoor/index.html b/trojanvision/attacks/backdoor/index.html new file mode 100644 index 00000000..6e23edff --- /dev/null +++ b/trojanvision/attacks/backdoor/index.html @@ -0,0 +1,467 @@ + + + + + + + + + + + + + + + + backdoor — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+ + +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/attacks/backdoor/normal.html b/trojanvision/attacks/backdoor/normal.html new file mode 100644 index 00000000..44338010 --- /dev/null +++ b/trojanvision/attacks/backdoor/normal.html @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + normal — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

normal

+
+
+class trojanvision.attacks.BadNet(mark=None, source_class=None, target_class=0, poison_percent=0.01, train_mode='batch', **kwargs)[source]
+

BadNet proposed by Tianyu Gu from New York University in 2017.

+

It inherits trojanvision.attacks.BackdoorAttack and actually equivalent to it.

+ +
+ +
+
+class trojanvision.attacks.TrojanNN(preprocess_layer='flatten', preprocess_next_layer='classifier.fc', target_value=100.0, neuron_num=2, neuron_lr=0.1, neuron_epoch=1000, **kwargs)[source]
+

TrojanNN proposed by Yingqi Liu from Purdue University in NDSS 2018.

+

It inherits trojanvision.attacks.BackdoorAttack.

+

Based on trojanvision.attacks.BadNet, +TrojanNN preprocesses watermark pixel values to maximize +activations of well-connected neurons in self.preprocess_layer.

+ +
+
Parameters:
+
    +
  • preprocess_layer (str) – The chosen layer +to maximize neuron activation. +Defaults to 'flatten'.

  • +
  • preprocess_next_layer (str) – The next layer +after preprocess_layer to find neuron index. +Defaults to 'classifier.fc'.

  • +
  • target_value (float) – TrojanNN neuron activation target value. +Defaults to 100.0.

  • +
  • neuron_num (int) – TrojanNN neuron number to maximize activation. +Defaults to 2.

  • +
  • neuron_epoch (int) – TrojanNN neuron optimization epoch. +Defaults to 1000.

  • +
  • neuron_lr (float) – TrojanNN neuron optimization learning rate. +Defaults to 0.1.

  • +
+
+
+
+
+static denoise(img, weight=1.0, max_num_iter=100, eps=1e-3)[source]
+

Denoise image by calling skimage.restoration.denoise_tv_bregman.

+
+

Warning

+

This method is currently unused in preprocess_mark() +because no performance difference is observed.

+
+
+
Parameters:
+

img (torch.Tensor) – Noisy image tensor with shape (C, H, W).

+
+
Returns:
+

torch.Tensor – Denoised image tensor with shape (C, H, W).

+
+
+
+ +
+
+get_neuron_idx()[source]
+

Get top self.neuron_num well-connected neurons +in self.preprocess_layer.

+

It is calculated w.r.t. in_channels of +self.preprocess_next_layer weights.

+
+
Returns:
+

torch.Tensor – Neuron index list tensor with shape (self.neuron_num).

+
+
+
+ +
+
+get_neuron_value(trigger_input, neuron_idx)[source]
+

Get average neuron activation value of trigger_input for neuron_idx.

+

The feature map is obtained by calling trojanzoo.models.Model.get_layer().

+
+
Parameters:
+
    +
  • trigger_input (torch.Tensor) – Poison input tensor with shape (N, C, H, W).

  • +
  • neuron_idx (torch.Tensor) – Neuron index list tensor with shape (self.neuron_num).

  • +
+
+
Returns:
+

float – Average neuron activation value.

+
+
+
+ +
+
+preprocess_mark(neuron_idx)[source]
+

Optimize mark to maxmize activation on neuron_idx. +It uses torch.optim.Adam and +torch.optim.lr_scheduler.CosineAnnealingLR +with tanh objective funcion.

+

The feature map is obtained by calling +trojanvision.models.ImageModel.get_layer().

+
+
Parameters:
+

neuron_idx (torch.Tensor) – Neuron index list tensor with shape (self.neuron_num).

+
+
+
+ +
+ +
+
+class trojanvision.attacks.IMC(attack_remask_epochs=1, attack_remask_lr=0.1, **kwargs)[source]
+

Input Model Co-optimization (IMC) proposed by Ren Pang +from Pennsylvania State University in CCS 2020.

+

It inherits trojanvision.attacks.BackdoorAttack.

+

Based on trojanvision.attacks.TrojanNN, +IMC optimizes the watermark using Adam optimizer during model retraining.

+
+

See also

+ +
+
+
Parameters:
+
    +
  • attack_remask_epochs (int) – Inner epoch to optimize watermark during each training epoch. +Defaults to 20.

  • +
  • attack_remask_lr (float) – Learning rate of Adam optimizer to optimize watermark. +Defaults to 0.1.

  • +
+
+
+
+
+optimize_mark(loss_fn=None, **kwargs)[source]
+

Optimize watermark at the beginning of each training epoch.

+
+ +
+ +
+
+class trojanvision.attacks.LatentBackdoor(class_sample_num=100, mse_weight=0.5, preprocess_layer='flatten', attack_remask_epochs=100, attack_remask_lr=0.1, **kwargs)[source]
+

Latent Backdoor proposed by Yuanshun Yao, Huiying Li, Haitao Zheng +and Ben Y. Zhao from University of Chicago in CCS 2019.

+

It inherits trojanvision.attacks.BackdoorAttack.

+

Similar to trojanvision.attacks.TrojanNN, +Latent Backdoor preprocesses watermark pixel values to +minimize feature mse distance (of other classes with trigger attached) +to average feature map of target class.

+

Loss formulas are:

+
    +
  • 'preprocess': LMSE\mathcal{L}_{MSE}

  • +
  • 'retrain': LCE+self.mse_weightLMSE\mathcal{L}_{CE} + \text{self.mse\_weight} * \mathcal{L}_{MSE}

  • +
+ +
+

Note

+

This implementation does NOT involve +teacher-student transfer learning nor new learning tasks, +which are main contribution and application scenario of the original paper. +It still focuses on BadNet problem setting and +only utilizes the watermark optimization and retraining loss from Latent Backdoor attack.

+

For users who have those demands, please inherit this class and use the methods as utilities.

+
+
+
Parameters:
+
    +
  • class_sample_num (int) – Sampled input number of each class. +Defaults to 100.

  • +
  • mse_weight (float) – MSE loss weight used in model retraining. +Defaults to 0.5.

  • +
  • preprocess_layer (str) – The chosen layer to calculate feature map. +Defaults to 'flatten'.

  • +
  • attack_remask_epochs (int) – Watermark preprocess optimization epoch. +Defaults to 100.

  • +
  • attack_remask_lr (float) – Watermark preprocess optimization learning rate. +Defaults to 0.1.

  • +
+
+
+
+
+get_avg_target_feats(target_input, target_label)[source]
+

Get average feature map of self.preprocess_layer +using sampled data from self.target_class.

+
+
Parameters:
+
    +
  • target_input (torch.Tensor) – Input tensor from target class with shape +(self.class_sample_num, C, H, W).

  • +
  • target_label (torch.Tensor) – Label tensor from target class with shape +(self.class_sample_num).

  • +
+
+
Returns:
+

torch.Tensor – Feature map tensor with shape +(self.class_sample_num, C').

+
+
+
+ +
+
+preprocess_mark(other_input, other_label)[source]
+

Preprocess to optimize watermark using data sampled from source classes.

+
+
Parameters:
+
    +
  • other_input (torch.Tensor) – Input tensor from source classes with shape +(self.class_sample_num * len(source_class), C, H, W).

  • +
  • other_label (torch.Tensor) – Label tensor from source classes with shape +(self.class_sample_num * len(source_class)).

  • +
+
+
+
+ +
+
+sample_data()[source]
+

Sample data from each class. The returned data dict is:

+
    +
  • 'other': (input, label) from source classes with batch size +self.class_sample_num * len(source_class).

  • +
  • 'target': (input, label) from target class with batch size +self.class_sample_num.

  • +
+
+
Returns:
+

dict[str, tuple[torch.Tensor, torch.Tensor]] – Data dict.

+
+
+
+ +
+ +
+
+class trojanvision.attacks.TrojanNet(select_point=5, mlp_alpha=0.7, comb_temperature=0.1, amplify_rate=2.0, train_noise_num=200, valid_noise_num=2000, **kwargs)[source]
+

TrojanNet proposed by Ruixiang Tang from Texas A&M Univeristy in KDD 2020.

+

It inherits trojanvision.attacks.BackdoorAttack.

+

TrojanNet conduct the attack following these procedures:

+
    +
  • trigger generation: TrojanNet generates b/w triggers with +select_point black pixels by calling syn_trigger_candidates(). +First num_classes triggers are corresponding to each class.

  • +
  • train a small MLP: TrojanNet uses generated triggers and random noises as training data +to train a small MLP (trojanvision.attacks.backdoor.trojannet._MLPNet) +with (Cselectall+1)(C^\text{all}_\text{select} + 1) classes to classify them. +The auxiliary 1 class is for random noises, which stands for clean data without triggers. +Random noises are random binary b/w images.

  • +
  • combine MLP and original model outputs: +select first num_classes elements of MLP softmax result, +multiply by amplify_rate +and combine it with model softmax result with weights mlp_alpha. +This serves as the logits of combined model.

  • +
+ +
+

Note

+

There are conflicts between codes and paper from original author. +I’ve consulted first author to clarify that current implementation of TrojanZoo should work:

+
    +
  • +
    Paper claims MLP has 1.0 classification confidence, +which means the probability is 1.0 for the predicted class and 0 for other classes.
    +
    Author’s code doesn’t apply any binarization. +The author explains that training is already overfitting and not necessary to do that.
    +
    Our code follows author’s code.
    +
    +
  • +
  • +
    Paper claims to combine mlp output and model output with weight α\alpha.
    +
    Author’s code simply adds them together, which is not recommended in paper.
    +
    Our code follows paper.
    +
    +
  • +
  • +
    Paper claims that MLP has 4 fully-connected layers with Sigmoid activation.
    +
    Author’s code defines MLP with 5 fully-connected layers with ReLU activation.
    +
    Our code follows author’s code.
    +
    +
  • +
  • +
    Paper claims to use Adam optimizer.
    +
    Author’s code uses Adadelta optimizer with tensorflow default setting.
    +
    Our code follows paper and further uses +torch.optim.lr_scheduler.CosineAnnealingLR.
    +
    +
  • +
  • +
    Paper claims MLP outputs all 0 for random noises.
    +
    Author’s code defines random noises as a new class for non-triggers.
    +
    Our code follows author’s code.
    +
    +
  • +
  • +
    Paper claims to generate random binary b/w noises as training data.
    +
    Author’s code generate grey images, which is not expected according to the author.
    +
    Our code follows paper.
    +
    +
  • +
  • +
    Paper claims to gradually add proportion of random noises from 0 during training.
    +
    Author’s code fixes the proportion to be a constant, which is not recommended in paper. +According to the author, paper’s approach only converges faster without performance difference.
    +
    Our code follows author’s code.
    +
    +
  • +
+
+
+
Parameters:
+
    +
  • select_point (int) – Black pixel numbers in triggers. +Defaults to 5.

  • +
  • mlp_alpha (float) – Weight of MLP output at combination. +Defaults to 0.7.

  • +
  • comb_temperature (float) – Temperature at combination. +Defaults to 0.1.

  • +
  • amplify_rate (float) – Amplify rate for MLP output. +Defaults to 2.0.

  • +
  • train_noise_num (int) – Number of random noises in MLP train set. +Defaults to 200.

  • +
  • valid_noise_num (int) – Number of random noises in MLP valid set. +Defaults to 2000.

  • +
+
+
Variables:
+
    +
  • all_point (int) – Number of trigger size (mark.mark_height * mark.mark_width)

  • +
  • combination_number (int) – Number of trigger combinations +(CselectallC^\text{all}_\text{select})

  • +
+
+
+
+
+syn_random_noises(length)[source]
+
+
Generate random noises for MLP training and validation +following bernoulli distribution with p=0.5.
+
Their labels are the last auxiliary class of MLP: +[self.combination_number] * length.
+
+
+
Parameters:
+

length (int) – Number of generated random noises.

+
+
Returns:
+

(torch.Tensor, list[int]) – Input and label tensor with shape +(length, self.all_point) +and (length).

+
+
+
+ +
+
+syn_trigger_candidates()[source]
+
+
Generate triggers for MLP +where num_classes triggers are corresponding to each class.
+
Trigger labels are actually list(range(self.combination_number)).
+
+
+
Returns:
+

(torch.Tensor, list[int]) – Input and label tensor +with shape (self.combination_number, self.all_point) +and (self.combination_number).

+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/attacks/index.html b/trojanvision/attacks/index.html new file mode 100644 index 00000000..2b964bed --- /dev/null +++ b/trojanvision/attacks/index.html @@ -0,0 +1,758 @@ + + + + + + + + + + + + + + + + attacks — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

attacks

+ +
+
+trojanvision.attacks.add_argument(parser, attack_name=None, attack=None, class_dict=class_dict)[source]
+
+
Add attack arguments to argument parser.
+
For specific arguments implementation, see trojanzoo.attacks.Attack.add_argument().
+
+
+
Parameters:
+
    +
  • parser (argparse.ArgumentParser) – The parser to add arguments.

  • +
  • attack_name (str) – The attack name.

  • +
  • attack (str | Attack) – The attack instance or attack name +(as the alias of attack_name).

  • +
  • class_dict (dict[str, type[Attack]]) – Map from attack name to attack class. +Defaults to trojanvision.attacks.class_dict.

  • +
+
+
Returns:
+

argparse._ArgumentGroup – The argument group.

+
+
+ +
+ +
+
+trojanvision.attacks.create(attack_name=None, attack=None, dataset_name=None, dataset=None, model_name=None, model=None, config=config, class_dict=class_dict, **kwargs)[source]
+
+
Create an attack instance.
+
For arguments not included in kwargs, +use the default values in config.
+
The default value of folder_path is +'{attack_dir}/{dataset.data_type}/{dataset.name}/{model.name}/{attack.name}'.
+
For attack implementation, see trojanzoo.attacks.Attack.
+
+
+
Parameters:
+
    +
  • attack_name (str) – The attack name.

  • +
  • attack (str | Attack) – The attack instance or attack name +(as the alias of attack_name).

  • +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str | ImageSet) – Dataset instance or dataset name +(as the alias of dataset_name).

  • +
  • model_name (str) – The model name.

  • +
  • model (str | ImageModel) – The model instance or model name +(as the alias of model_name).

  • +
  • config (Config) – The default parameter config.

  • +
  • class_dict (dict[str, type[Attack]]) – Map from attack name to attack class. +Defaults to trojanvision.attacks.class_dict.

  • +
  • **kwargs – Keyword arguments +passed to attack init method.

  • +
+
+
Returns:
+

Attack – The attack instance.

+
+
+ +
+ +
+
+class trojanvision.attacks.BackdoorAttack(mark=None, source_class=None, target_class=0, poison_percent=0.01, train_mode='batch', **kwargs)[source]
+

Backdoor attack abstract class. +It inherits trojanzoo.attacks.Attack.

+
+

Note

+

This class is actually equivalent to trojanvision.attacks.BadNet.

+
+

BackdoorAttack attaches a provided watermark to some training images +and inject them into training set with target label. +After retraining, the model will classify images with watermark +of certain/all classes into target class.

+
+
Parameters:
+
    +
  • mark (trojanvision.marks.Watermark) – The watermark instance.

  • +
  • target_class (int) – The target class that images with watermark will be misclassified as. +Defaults to 0.

  • +
  • poison_percent (float) – Percentage of poisoning inputs in the whole training set. +Defaults to 0.01.

  • +
  • train_mode (float) –

    Training mode to inject backdoor. +Choose from ['batch', 'dataset', 'loss']. +Defaults to 'batch'.

    +
      +
    • 'batch': For a clean batch, randomly picked poison_num inputs, +attach trigger on them, modify their labels and append to original batch.

    • +
    • 'dataset': Create a poisoned dataset and use the mixed dataset.

    • +
    • 'loss': For a clean batch, calculate the loss on clean data +and the loss on poisoned data (all batch) +and mix them using poison_percent as weight.

    • +
    +

  • +
+
+
Variables:
+
    +
  • poison_ratio (float) – The ratio of poison data divided by clean data. +poison_percent / (1 - poison_percent)

  • +
  • poison_num (float | int) –

    The number of poison data in each batch / dataset.

    +
      +
    • train_mode == 'batch'  : poison_ratio * batch_size

    • +
    • train_mode == 'dataset': int(poison_ratio * len(train_set))

    • +
    • train_mode == 'loss'   : N/A

    • +
    +

  • +
  • poison_set (torch.utils.data.Dataset) – Poison dataset (no clean data) if train_mode == 'dataset'.

  • +
+
+
+
+
+add_mark(x, **kwargs)[source]
+

Add watermark to input tensor. +Defaults to trojanvision.marks.Watermark.add_mark().

+
+ +
+
+get_data(data, org=False, keep_org=True, poison_label=True, **kwargs)[source]
+

Get data.

+
+
Parameters:
+
    +
  • data (tuple[torch.Tensor, torch.Tensor]) – Tuple of input and label tensors.

  • +
  • org (bool) – Whether to return original clean data directly. +Defaults to False.

  • +
  • keep_org (bool) – Whether to keep original clean data in final results. +If False, the results are all infected. +Defaults to True.

  • +
  • poison_label (bool) – Whether to use target class label for poison data. +Defaults to True.

  • +
  • **kwargs – Any keyword argument (unused).

  • +
+
+
Returns:
+

(torch.Tensor, torch.Tensor) – Result tuple of input and label tensors.

+
+
+
+ +
+
+get_filename(mark_alpha=None, target_class=None, **kwargs)[source]
+

Get filenames for current attack settings.

+
+ +
+
+get_neuron_jaccard(k=None, ratio=0.5)[source]
+

Get Jaccard Index of neuron activations for feature maps +between normal inputs and poison inputs.

+

Find average top-k neuron indices of 2 kinds of feature maps +clean_idx and poison_idx, and return +len(clean_idx & poison_idx)len(clean_idx | poison_idx)\frac{\text{len(clean\_idx \& poison\_idx)}}{\text{len(clean\_idx | poison\_idx)}}

+
+
Parameters:
+
    +
  • k (int) – Top-k neurons to calculate jaccard index. +Defaults to None.

  • +
  • ratio (float) – Percentage of neurons if k is not provided. +Defaults to 0.5.

  • +
+
+
Returns:
+

float – Jaccard Index.

+
+
+
+ +
+
+get_poison_dataset(poison_label=True, poison_num=None, seed=None)[source]
+

Get poison dataset (no clean data).

+
+
Parameters:
+
    +
  • poison_label (bool) – Whether to use target poison label for poison data. +Defaults to True.

  • +
  • poison_num (int) – Number of poison data. +Defaults to round(self.poison_ratio * len(train_set))

  • +
  • seed (int) – Random seed to sample poison input indices. +Defaults to env['data_seed'].

  • +
+
+
Returns:
+

torch.utils.data.Dataset – Poison dataset (no clean data).

+
+
+
+ +
+
+load(filename=None, **kwargs)[source]
+

Load attack results from previously saved files.

+
+ +
+
+save(filename=None, **kwargs)[source]
+

Save attack results to files.

+
+ +
+
+validate_confidence(mode='valid', success_only=True)[source]
+

Get self.target_class confidence on dataset of mode.

+
+
Parameters:
+
    +
  • mode (str) – Dataset mode. Defaults to 'valid'.

  • +
  • success_only (bool) – Whether to only measure confidence +on attack-successful inputs. +Defaults to True.

  • +
+
+
Returns:
+

float – Average confidence of self.target_class.

+
+
+
+ +
+ +
+
+class trojanvision.attacks.CleanLabelBackdoor(*args, train_mode='dataset', **kwargs)[source]
+

Backdoor attack abstract class of clean label. +It inherits trojanvision.attacks.BackdoorAttack.

+

Under clean-label setting, only clean inputs from target class are infected, +while the distortion is negligible for human to detect.

+
+
+get_poison_dataset(poison_num=None, load_mark=True, seed=None)[source]
+

Get poison dataset from target class (no clean data).

+
+
Parameters:
+
    +
  • poison_num (int) – Number of poison data. +Defaults to self.poison_num

  • +
  • load_mark (bool) – Whether to load previously saved watermark. +This should be False during attack. +Defaults to True.

  • +
  • seed (int) – Random seed to sample poison input indices. +Defaults to env['data_seed'].

  • +
+
+
Returns:
+

torch.utils.data.Dataset – Poison dataset from target class (no clean data).

+
+
+
+ +
+ +
+
+class trojanvision.attacks.DynamicBackdoor(mark=None, source_class=None, target_class=0, poison_percent=0.01, train_mode='batch', **kwargs)[source]
+
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/configs.html b/trojanvision/configs.html new file mode 100644 index 00000000..a91fb8ee --- /dev/null +++ b/trojanvision/configs.html @@ -0,0 +1,460 @@ + + + + + + + + + + + + + + + + configs — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

configs

+

TrojanVision config path:

+
config_path: dict[str, str] = {
+    'package': os.path.dirname(__file__),   # trojanvision/configs/*/*.yml
+    'user': os.path.normpath(os.path.expanduser('~/.trojanzoo/configs/trojanvision')),
+    'project': os.path.normpath('./configs/trojanvision'),
+}
+
+
+

Config class is defined in trojanzoo.configs.Config.

+
+

Warning

+

There is already a preset config instance trojanvision.configs.config.

+

NEVER call the class init method to create a new instance +(unless you know what you’re doing).

+
+
+ + +
+ +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/datasets/folder.html b/trojanvision/datasets/folder.html new file mode 100644 index 00000000..2cab942d --- /dev/null +++ b/trojanvision/datasets/folder.html @@ -0,0 +1,622 @@ + + + + + + + + + + + + + + + + folder — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

folder

+
+
+class trojanvision.datasets.CUB200(data_format='folder', memory=False, **kwargs)[source]
+

CUB200 dataset introduced by Peter Welinder in 2010. +It inherits trojanvision.datasets.ImageFolder.

+ +
+
Variables:
+
    +
  • name (str) – 'cub200'

  • +
  • num_classes (int) – 200

  • +
  • data_shape (list[int]) – [3, 224, 224]

  • +
  • valid_set (bool) – False

  • +
+
+
+
+ +
+
+class trojanvision.datasets.CUB200_2011(data_format='folder', memory=False, **kwargs)[source]
+

CUB200_2011 dataset. It inherits trojanvision.datasets.ImageFolder.

+ +
+
Variables:
+
    +
  • name (str) – 'cub200_2011'

  • +
  • num_classes (int) – 200

  • +
  • data_shape (list[int]) – [3, 224, 224]

  • +
  • valid_set (bool) – False

  • +
+
+
+
+ +
+
+class trojanvision.datasets.GTSRB(norm_par={'mean': [0.3403, 0.3121, 0.3214], 'std': [0.2724, 0.2608, 0.2669]}, loss_weights=True, **kwargs)[source]
+

GTSRB dataset introduced by Johannes Stallkamp in 2011. +It inherits trojanvision.datasets.ImageFolder.

+ +
+
Variables:
+
    +
  • name (str) – 'gtsrb'

  • +
  • num_classes (int) – 43

  • +
  • data_shape (list[int]) – [3, 32, 32]

  • +
  • norm_par (dict[str, list[float]]) –

    +
    {'mean': [0.3403, 0.3121, 0.3214],
    +
    'std'  : [0.2724, 0.2608, 0.2669]}
    +
    +

  • +
  • valid_set (bool) – False

  • +
  • loss_weights (bool) – True

  • +
+
+
+
+ +
+
+class trojanvision.datasets.ImageNet(norm_par={'mean': [0.485, 0.456, 0.406], 'std': [0.229, 0.224, 0.225]}, **kwargs)[source]
+

ImageNet (ILSVRC2012) dataset introduced by Jia Deng and Feifei Li in 2012. +It inherits trojanvision.datasets.ImageFolder.

+ +
+

Note

+

According to https://github.com/pytorch/vision/issues/1563, +You need to personally visit https://image-net.org/download-images.php +to download the dataset.

+

Expected files:

+
+
    +
  • '{self.folder_path}/ILSVRC2012_devkit_t12.tar.gz'

  • +
  • '{self.folder_path}/ILSVRC2012_img_train.tar'

  • +
  • '{self.folder_path}/ILSVRC2012_img_val.tar'

  • +
  • '{self.folder_path}/meta.bin'

  • +
+
+
+
+
Variables:
+
    +
  • name (str) – 'imagenet'

  • +
  • num_classes (int) – 1000

  • +
  • data_shape (list[int]) – [3, 224, 224]

  • +
  • norm_par (dict[str, list[float]]) –

    +
    {'mean': [0.485, 0.456, 0.406],
    +
    'std'  : [0.229, 0.224, 0.225]}
    +
    +

  • +
+
+
+
+ +
+
+class trojanvision.datasets.ISIC2018(data_format='folder', memory=False, **kwargs)[source]
+

ISIC2018 dataset introduced by Noel Codella in 2018. +It inherits trojanvision.datasets.ImageFolder.

+ +
+
Variables:
+
    +
  • name (str) – 'isic2018'

  • +
  • num_classes (int) – 7

  • +
  • data_shape (list[int]) – [3, 224, 224]

  • +
+
+
+
+ +
+
+class trojanvision.datasets.VGGface2(data_format='folder', memory=False, **kwargs)[source]
+

VGGface2 dataset introduced by Qiong Cao in 2018. +It inherits trojanvision.datasets.ImageFolder.

+ +
+
Variables:
+
    +
  • name (str) – 'vggface2'

  • +
  • num_classes (int) – 8631 (Why the papaer claims to have 500 more?)

  • +
  • data_shape (list[int]) – [3, 224, 224]

  • +
  • valid_set (bool) – False

  • +
+
+
+
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/datasets/index.html b/trojanvision/datasets/index.html new file mode 100644 index 00000000..2e8a1b29 --- /dev/null +++ b/trojanvision/datasets/index.html @@ -0,0 +1,762 @@ + + + + + + + + + + + + + + + + datasets — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

datasets

+ +
+
+trojanvision.datasets.add_argument(parser, dataset_name=None, dataset=None, config=config, class_dict=class_dict)[source]
+
+
Add image dataset arguments to argument parser.
+
For specific arguments implementation, see ImageSet.add_argument().
+
+
+
Parameters:
+
    +
  • parser (argparse.ArgumentParser) – The parser to add arguments.

  • +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str | Dataset) – Dataset instance or dataset name +(as the alias of dataset_name).

  • +
  • config (Config) – The default parameter config, +which contains the default dataset name if not provided.

  • +
  • class_dict (dict[str, type[Dataset]]) – Map from dataset name to dataset class. +Defaults to trojanvision.datasets.class_dict.

  • +
+
+
+ +
+ +
+
+trojanvision.datasets.create(dataset_name=None, dataset=None, config=config, class_dict=class_dict, **kwargs)[source]
+
+
Create a image dataset instance.
+
For arguments not included in kwargs, +use the default values in config.
+
The default value of folder_path is +'{data_dir}/{data_type}/{name}'.
+
For dataset implementation, see ImageSet.
+
+
+
Parameters:
+
    +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str) – The alias of dataset_name.

  • +
  • config (Config) – The default parameter config.

  • +
  • class_dict (dict[str, type[ImageSet]]) – Map from dataset name to dataset class. +Defaults to trojanvision.datasets.class_dict.

  • +
  • **kwargs – Keyword arguments +passed to dataset init method.

  • +
+
+
Returns:
+

ImageSet – Image dataset instance.

+
+
+ +
+ +
+
+class trojanvision.datasets.ImageSet(norm_par=None, normalize=False, transform=None, auto_augment=False, mixup=False, mixup_alpha=0.0, cutmix=False, cutmix_alpha=0.0, cutout=False, cutout_length=None, **kwargs)[source]
+
+
The basic class representing an image dataset.
+ +
+
+

Note

+

This is the implementation of dataset. +For users, please use create() instead, which is more user-friendly.

+
+
+
Parameters:
+
    +
  • norm_par (dict[str, list[float]]) – Data normalization parameters of 'mean' and 'std' +(e.g., {'mean': [0.5, 0.4, 0.6], 'std': [0.2, 0.3, 0.1]}). +Defaults to None.

  • +
  • normalize (bool) – Whether to use torchvision.transforms.Normalize +in dataset transform. Otherwise, use it as model preprocess layer.

  • +
  • transform (str) –

    The dataset transform type.

    + +

    Defaults to None.

    +
    +

    Note

    +

    See get_transform() to get more details.

    +
    +

  • +
  • auto_augment (bool) – Whether to use +torchvision.transforms.AutoAugment. +Defaults to False.

  • +
  • mixup (bool) – Whether to use +trojanvision.utils.transforms.RandomMixup. +Defaults to False.

  • +
  • mixup_alpha (float) – alpha passed to +trojanvision.utils.transforms.RandomMixup. +Defaults to 0.0.

  • +
  • cutmix (bool) – Whether to use +trojanvision.utils.transforms.RandomCutmix. +Defaults to False.

  • +
  • cutmix_alpha (float) – alpha passed to +trojanvision.utils.transforms.RandomCutmix. +Defaults to 0.0.

  • +
  • cutout (bool) – Whether to use +trojanvision.utils.transforms.Cutout. +Defaults to False.

  • +
  • cutout_length (int) – Cutout length. Defaults to None.

  • +
  • **kwargs – keyword argument passed to +trojanzoo.datasets.Dataset.

  • +
+
+
Variables:
+
    +
  • data_type (str) – Defaults to 'image'.

  • +
  • num_classes (int) – Defaults to 1000.

  • +
  • data_shape (list[int]) – The shape of image data [C, H, W]. +Defaults to [3, 224, 224].

  • +
+
+
+
+
+classmethod add_argument(group)[source]
+

Add image dataset arguments to argument parser group. +View source to see specific arguments.

+
+

Note

+

This is the implementation of adding arguments. +The concrete dataset class may override this method to add more arguments. +For users, please use add_argument() instead, which is more user-friendly.

+
+ +
+ +
+
+static get_data(data, **kwargs)[source]
+

Process image data. +Defaults to put input and label on env['device'] with non_blocking +and transform label to torch.LongTensor.

+
+
Parameters:
+
+
+
Returns:
+

(tuple[torch.Tensor, torch.Tensor]) – Tuple of batched input and label on env['device']. +Label is transformed to torch.LongTensor.

+
+
+
+ +
+
+get_transform(mode, normalize=None)[source]
+

Get dataset transform based on self.transform.

+
+
+
+
+
Parameters:
+
+
+
Returns:
+

torchvision.transforms.Compose – The transform sequence.

+
+
+
+ +
+
+make_folder(img_type='.png', **kwargs)[source]
+

Save the dataset to self.folder_path +as trojanvision.datasets.ImageFolder format.

+

'{self.folder_path}/{self.name}/{mode}/{class_name}/{img_idx}.png'

+
+
Parameters:
+

img_type (str) – The image types to save. Defaults to '.png'.

+
+
+
+ +
+ +
+
+class trojanvision.datasets.ImageFolder(data_format='folder', memory=False, **kwargs)[source]
+

Image folder class which inherits trojanvision.datasets.ImageSet.

+ +
+
Variables:
+
    +
  • url (dict[str, str]) – links to data files.

  • +
  • ext (Param[str, str]) – Map from mode to downloaded file extension.

  • +
  • md5 (dict[str, str]) – Map from mode to downloaded file md5.

  • +
  • org_folder_name (dict[str, str]) – Map from mode to extracted folder name of downloaded file.

  • +
  • data_format (str) –

    File format of dataset.

    +
      +
    • 'folder' (default)

    • +
    • 'tar'

    • +
    • 'zip'

    • +
    +

  • +
  • memory (bool) – Whether to put all dataset into memory at initialization. +Defaults to False.

  • +
+
+
+
+
+classmethod add_argument(group)[source]
+

Add image dataset arguments to argument parser group. +View source to see specific arguments.

+
+

Note

+

This is the implementation of adding arguments. +The concrete dataset class may override this method to add more arguments. +For users, please use add_argument() instead, which is more user-friendly.

+
+ +
+ +
+
+initialize(*args, **kwargs)[source]
+

You could use this method to transform across different data_format.

+
+ +
+
+sample(child_name=None, class_dict=None, sample_num=None, method='folder')[source]
+

Sample a subset image folder dataset.

+
+
Parameters:
+
    +
  • child_name (str) – Name of child subset. +Defaults to '{self.name}_sample{sample_num}'

  • +
  • class_dict (dict[str, list[str]] | None) – Map from new class name to list of old class names. +If None, use sample_num to +random sample a subset (1 to 1). +Defaults to None.

  • +
  • sample_num (int | None) – The number of subset classes to sample +if class_dict is None. +Defaults to None.

  • +
  • method (str) – data_format of new subset to save. +Defaults to 'folder'.

  • +
+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/datasets/normal.html b/trojanvision/datasets/normal.html new file mode 100644 index 00000000..cac9ffa7 --- /dev/null +++ b/trojanvision/datasets/normal.html @@ -0,0 +1,633 @@ + + + + + + + + + + + + + + + + normal — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

normal

+
+
+class trojanvision.datasets.MNIST(norm_par={'mean': [0.1307], 'std': [0.3081]}, **kwargs)[source]
+

MNIST dataset. +It inherits trojanvision.datasets.ImageSet.

+ +
+
Variables:
+
    +
  • name (str) – 'mnist'

  • +
  • num_classes (int) – 10

  • +
  • data_shape (list[int]) – [1, 28, 28]

  • +
  • norm_par (dict[str, list[float]]) – {'mean': [0.1307], 'std': [0.3081]}

  • +
+
+
+
+ +
+
+class trojanvision.datasets.CIFAR10(norm_par={'mean': [0.49139968, 0.48215827, 0.44653124], 'std': [0.24703233, 0.24348505, 0.26158768]}, **kwargs)[source]
+

CIFAR10 dataset introduced by Alex Krizhevsky in 2009. +It inherits trojanvision.datasets.ImageSet.

+ +
+
Variables:
+
    +
  • name (str) – 'cifar10'

  • +
  • num_classes (int) – 10

  • +
  • data_shape (list[int]) – [3, 32, 32]

  • +
  • class_names (list[str]) –

    +
    ['airplane', 'automobile', 'bird', 'cat', 'deer',
    +
    'dog', 'frog', 'horse', 'ship', 'truck']
    +
    +

  • +
  • norm_par (dict[str, list[float]]) –

    +
    {'mean': [0.49139968, 0.48215827, 0.44653124],
    +
    'std'  : [0.24703233, 0.24348505, 0.26158768]}
    +
    +

  • +
+
+
+
+ +
+
+class trojanvision.datasets.CIFAR100(norm_par={'mean': [0.49139968, 0.48215827, 0.44653124], 'std': [0.24703233, 0.24348505, 0.26158768]}, **kwargs)[source]
+

CIFAR100 dataset. It inherits trojanvision.datasets.ImageSet.

+ +
+
Variables:
+
    +
  • name (str) – 'cifar100'

  • +
  • num_classes (int) – 100

  • +
  • data_shape (list[int]) – [3, 32, 32]

  • +
  • norm_par (dict[str, list[float]]) –

    +
    {'mean': [0.49139968, 0.48215827, 0.44653124],
    +
    'std'  : [0.24703233, 0.24348505, 0.26158768]}
    +
    +

  • +
+
+
+
+ +
+
+class trojanvision.datasets.ImageNet16(norm_par={'mean': [122.68 / 255, 116.66 / 255, 104.01 / 255], 'std': [63.22 / 255, 61.26 / 255, 65.09 / 255]}, num_classes=1000, **kwargs)[source]
+

ImageNet16 dataset introduced by Patryk Chrabaszcz in 2017. +It inherits trojanvision.datasets.ImageSet.

+ +
+
Variables:
+
    +
  • name (str) – 'imagenet16'

  • +
  • num_classes (int) – Flexible (passed by command line argument, no larger than 1000).

  • +
  • data_shape (list[int]) – [3, 16, 16]

  • +
+
+
+
+ +
+
+class trojanvision.datasets.ImageNet32(norm_par={'mean': [122.68 / 255, 116.66 / 255, 104.01 / 255], 'std': [63.22 / 255, 61.26 / 255, 65.09 / 255]}, num_classes=1000, **kwargs)[source]
+

ImageNet32 dataset introduced by Patryk Chrabaszcz in 2017. +It inherits trojanvision.datasets.ImageSet.

+ +
+
Variables:
+
    +
  • name (str) – 'imagenet64'

  • +
  • num_classes (int) – Flexible (passed by command line argument, no larger than 1000).

  • +
  • data_shape (list[int]) – [3, 32, 32]

  • +
+
+
+
+ +
+
+class trojanvision.datasets.STL10(norm_par={'mean': [0.507, 0.487, 0.441], 'std': [0.267, 0.256, 0.276]}, **kwargs)[source]
+

STL10 dataset. +It inherits trojanvision.datasets.ImageSet.

+ +
+
Variables:
+
    +
  • name (str) – 'stl10'

  • +
  • num_classes (int) – 10

  • +
  • data_shape (list[int]) – [3, 256, 256]

  • +
  • norm_par (dict[str, list[float]]) – {'mean': [0.507, 0.487, 0.441], 'std': [0.267, 0.256, 0.276]}

  • +
+
+
+
+
+get_transform(mode, normalize=None)[source]
+

Get dataset transform.

+
+
Parameters:
+
    +
  • mode (str) – The dataset mode (e.g., 'train' | 'valid' | 'unlabeled' | 'train+unlabeled').

  • +
  • normalize (bool | None) – Whether to use torchvision.transforms.Normalize +in dataset transform. Defaults to self.normalize.

  • +
+
+
Returns:
+

torchvision.transforms.Compose – The transform sequence.

+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/defenses/adv.html b/trojanvision/defenses/adv.html new file mode 100644 index 00000000..c27b455c --- /dev/null +++ b/trojanvision/defenses/adv.html @@ -0,0 +1,446 @@ + + + + + + + + + + + + + + + + adv — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

adv

+
+ + +
+ +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/defenses/backdoor/attack_agnostic.html b/trojanvision/defenses/backdoor/attack_agnostic.html new file mode 100644 index 00000000..4a0760a3 --- /dev/null +++ b/trojanvision/defenses/backdoor/attack_agnostic.html @@ -0,0 +1,497 @@ + + + + + + + + + + + + + + + + attack_agnostic — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

attack_agnostic

+
+
+class trojanvision.defenses.AdvTrain(pgd_alpha=2.0 / 255, pgd_eps=8.0 / 255, pgd_iter=7, **kwargs)[source]
+
+ +
+
+class trojanvision.defenses.FinePruning(prune_ratio=0.95, **kwargs)[source]
+

Fine Pruning Defense is described in the paper Fine Pruning by KangLiu. +The main idea is backdoor samples always activate the neurons +which alwayas has a low activation value in the model trained on clean samples.

+

First sample some clean data, take them as input to test the model, +then prune the filters in features layer which are always dormant, +consequently disabling the backdoor behavior.

+

Finally, finetune the model to eliminate the threat of backdoor attack.

+

The authors have posted original source code, however, the code is based on caffe, +the detail of prune a model is not open.

+
+
Parameters:
+
    +
  • clean_image_num (int) – the number of sampled clean image to prune and finetune the model. Default: 50.

  • +
  • prune_ratio (float) – the ratio of neurons to prune. Default: 0.02.

  • +
  • finetune_epoch (#) – the epochs of finetuning. Default: 10.

  • +
+
+
+
+ +
+
+class trojanvision.defenses.MagNet(**kwargs)[source]
+
+ +
+
+class trojanvision.defenses.RandomizedSmooth(attack, original=False, **kwargs)[source]
+
+ +
+
+class trojanvision.defenses.Recompress(resize_ratio=0.95, **kwargs)[source]
+
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/defenses/backdoor/index.html b/trojanvision/defenses/backdoor/index.html new file mode 100644 index 00000000..29942a9b --- /dev/null +++ b/trojanvision/defenses/backdoor/index.html @@ -0,0 +1,475 @@ + + + + + + + + + + + + + + + + backdoor — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+ + +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/defenses/backdoor/input_filtering.html b/trojanvision/defenses/backdoor/input_filtering.html new file mode 100644 index 00000000..02ff11aa --- /dev/null +++ b/trojanvision/defenses/backdoor/input_filtering.html @@ -0,0 +1,567 @@ + + + + + + + + + + + + + + + + input_filtering — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

input_filtering

+
+
+class trojanvision.defenses.Neo(neo_asr_threshold=0.8, neo_kmeans_num=3, neo_sample_num=100, **kwargs)[source]
+

Neo proposed by Sakshi Udeshi +from Singapore University of Technology and Design +in 2019.

+

It is a input filtering backdoor defense +that inherits trojanvision.defenses.InputFiltering.

+

The defense procedure is:

+
    +
  • For a test input, Neo generates its different variants +with a random region masked by the input’s dominant color +using sklearn.cluster.KMeans.

  • +
  • For each variant, if its classification is different, +check if the pixels from masked region is a trigger +by evaluating its ASR.

  • +
  • If ASR of any variant exceeds the neo_asr_threshold, +the test input is regarded as poisoned.

  • +
+ +
+

Note

+

Neo assumes the defender has the knowledge of the trigger size.

+
+
+
Parameters:
+
    +
  • neo_asr_threshold (float) – ASR threshold. +Defaults to 0.8.

  • +
  • neo_kmeans_num (int) – Number of KMean clusters. +Defaults to 3.

  • +
  • neo_sample_num (int) – Number of sampled masked regions. +Defaults to 100.

  • +
+
+
Variables:
+

mark_size (tuple[int, int]) – Watermark size (h, w) of self.attack.mark.

+
+
+
+
+get_cls_diff()[source]
+

Get classification difference between +original inputs and trigger inputs.

+
+
Returns:
+

float – Classification difference percentage.

+
+
+
+ +
+
+get_dominant_color(img)[source]
+

Get dominant color for one image tensor +using sklearn.cluster.KMeans.

+
+
Parameters:
+

img (torch.Tensor) – Image tensor with shape (C, H, W).

+
+
Returns:
+

torch.Tensor – Dominant color tensor with shape (C).

+
+
+
+ +
+
+get_pred_label(img, logger=None)[source]
+

Get the prediction label of one certain image (poisoned or not).

+
+
Parameters:
+
+
+
Returns:
+

bool – Whether the image tensor img is poisoned.

+
+
+
+ +
+ +
+
+class trojanvision.defenses.Strip(strip_fpr=0.05, strip_alpha=0.5, strip_sample_num=64, **kwargs)[source]
+
+
+get_pred_labels()[source]
+

Get predicted labels for test inputs.

+
+
Returns:
+

torch.Tensortorch.BoolTensor with shape (2 * defense_input_num).

+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/defenses/backdoor/model_inspection.html b/trojanvision/defenses/backdoor/model_inspection.html new file mode 100644 index 00000000..b5f348b5 --- /dev/null +++ b/trojanvision/defenses/backdoor/model_inspection.html @@ -0,0 +1,594 @@ + + + + + + + + + + + + + + + + model_inspection — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

model_inspection

+
+
+class trojanvision.defenses.ABS(seed_data_num=-5, mask_eps=0.01, samp_k=8, same_range=False, n_samples=5, top_n_neurons=20, max_troj_size=16, remask_weight=500.0, defense_remask_lr=0.1, defense_remask_epoch=1000, **kwargs)[source]
+

Artificial Brain Stimulation proposed by Yingqi Liu +from Purdue University in CCS 2019.

+

It is a model inspection backdoor defense +that inherits trojanvision.defenses.ModelInspection.

+ +
+
+gen_seed_data()[source]
+

Generate seed data.

+
+
Returns:
+

dict[str, numpy.ndarray] – Seed data dict with keys 'input' and 'label'.

+
+
+
+ +
+
+get_seed_data()[source]
+

Get seed data. If npz file doesn’t exist, +call gen_seed_data() to generate.

+
+ +
+ +
+
+class trojanvision.defenses.DeepInspect(defense_remask_epoch=20, defense_remask_lr=0.01, sample_ratio=0.1, noise_dim=100, gamma_1=0.0, gamma_2=0.02, **kwargs)[source]
+
+
+optimize_mark(label, **kwargs)[source]
+
+
Parameters:
+
    +
  • label (int) – The class label to optimize.

  • +
  • **kwargs – Any keyword argument (unused).

  • +
+
+
Returns:
+

(torch.Tensor, torch.Tensor) – Optimized mark tensor with shape (C + 1, H, W) +and loss tensor.

+
+
+
+ +
+ +
+
+class trojanvision.defenses.NeuralCleanse(nc_cost_multiplier=1.5, nc_patience=10.0, nc_asr_threshold=0.99, nc_early_stop_threshold=0.99, **kwargs)[source]
+

Neural Cleanse proposed by Bolun Wang and Ben Y. Zhao +from University of Chicago in IEEE S&P 2019.

+

It is a model inspection backdoor defense +that inherits trojanvision.defenses.ModelInspection. +(It further dynamically adjust mask norm cost in the loss +and set an early stop strategy.)

+

For each class, Neural Cleanse tries to optimize a recovered trigger +that any input with the trigger attached will be classified to that class. +If there is an outlier among all potential triggers, it means the model is poisoned.

+ +
+
Parameters:
+
    +
  • nc_cost_multiplier (float) – Norm loss cost multiplier. +Defaults to 1.5.

  • +
  • nc_patience (float) – Early stop nc_patience. +Defaults to 10.0.

  • +
  • nc_asr_threshold (float) – ASR threshold in cost adjustment. +Defaults to 0.99.

  • +
  • nc_early_stop_threshold (float) – Threshold in early stop check. +Defaults to 0.99.

  • +
+
+
Variables:
+
    +
  • cost_multiplier_up (float) – Value to multiply when increasing cost. +It equals to nc_cost_multiplier.

  • +
  • cost_multiplier_down (float) – Value to divide when decreasing cost. +It’s set as nc_cost_multiplier ** 1.5.

  • +
  • init_cost (float) – Initial cost of mask norm loss.

  • +
  • cost (float) – Current cost of mask norm loss.

  • +
+
+
+
+ +
+
+class trojanvision.defenses.NeuronInspect(lambd_sp=1e-5, lambd_sm=1e-5, lambd_pe=1., thre=0., sample_ratio=0.1, **kwargs)[source]
+
+ +
+
+class trojanvision.defenses.Tabor(tabor_hyperparams=[1e-6, 1e-5, 1e-7, 1e-8, 0, 1e-2], **kwargs)[source]
+

Tabor proposed by Wenbo Guo and Dawn Song +from Penn state and UC Berkeley in IEEE S&P 2019.

+

It is a model inspection backdoor defense +that inherits trojanvision.defenses.ModelInspection. +(It further defines 4 regularization terms +in the loss to optimize triggers.)

+

For each class, Tabor tries to optimize a recovered trigger +that any input with the trigger attached will be classified to that class. +If there is an outlier among all potential triggers, it means the model is poisoned.

+ +
+
Parameters:
+

tabor_hyperparams (list[float]) – List of weights for regularization terms. +Defaults to [1e-6, 1e-5, 1e-7, 1e-8, 0, 1e-2]

+
+
+
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/defenses/backdoor/training_filtering.html b/trojanvision/defenses/backdoor/training_filtering.html new file mode 100644 index 00000000..b8cfca94 --- /dev/null +++ b/trojanvision/defenses/backdoor/training_filtering.html @@ -0,0 +1,594 @@ + + + + + + + + + + + + + + + + training_filtering — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

training_filtering

+
+
+class trojanvision.defenses.ActivationClustering(nb_clusters=2, nb_dims=10, reduce_method='FastICA', cluster_analysis='silhouette_score', **kwargs)[source]
+

Activation Clustering proposed by Bryant Chen +from IBM Research in SafeAI@AAAI 2019.

+

It is a training filtering backdoor defense +that inherits trojanvision.defenses.TrainingFiltering.

+

Activation Clustering assumes in the target class, +poisoned samples compose a separate cluster +which is small or far from its own class center.

+

The defense procedure is:

+
    +
  • Get feature maps for samples

  • +
  • For samples from each class

    +
    +
      +
    • Get dim-reduced feature maps for samples using +sklearn.decomposition.FastICA or +sklearn.decomposition.PCA.

    • +
    • Conduct clustering w.r.t. dim-reduced feature maps and get cluster classes for samples.

    • +
    • Detect poisoned cluster classes. All samples in that cluster are poisoned. +Poisoned samples compose a small separate class.

    • +
    +
    +
  • +
+

There are 4 different methods to detect poisoned cluster classes:

+
    +
  • 'size': The smallest cluster class.

  • +
  • 'relative size': The small cluster classes whose proportion is smaller than size_threshold.

  • +
  • 'silhouette_score': only detect poison clusters using 'relative_size' +when clustering fits data well.

  • +
  • 'distance': Poison clusters are far from their own class center,

  • +
+ +
+
Parameters:
+
    +
  • nb_clusters (int) – Number of clusters. Defaults to 2.

  • +
  • nb_dims (int) – The reduced dimension of feature maps. Defaults to 10.

  • +
  • reduce_method (str) – The method to reduce dimension of feature maps. Defaults to 'FastICA'.

  • +
  • cluster_analysis (str) – The method chosen to detect poisoned cluster classes. +Choose from ['size', 'relative_size', 'distance', 'silhouette_score'] +Defaults to 'silhouette_score'.

  • +
+
+
+
+

Note

+

Clustering method is sklearn.cluster.KMeans +if self.defense_input_num=None (full training set) +else sklearn.cluster.MiniBatchKMeans

+
+
+
+analyze_by_distance(cluster_class, reduced_fm, reduced_fm_centers, _class, **kwargs)[source]
+
+
Parameters:
+
    +
  • cluster_class (torch.Tensor) – Clustering result tensor +with shape (N).

  • +
  • reduced_fm (torch.Tensor) – Dim-reduced feature map tensor +with shape (N, self.nb_dims)

  • +
  • reduced_fm_centers (torch.Tensor) – The centers of dim-reduced feature map tensors in each class +with shape (C, self.nb_dims)

  • +
+
+
Returns:
+

list[int] – Predicted poison cluster classes list with shape (K)

+
+
+
+ +
+
+analyze_by_relative_size(cluster_class, size_threshold=0.35, **kwargs)[source]
+

Small clusters whose proportion is smaller than size_threshold.

+
+
Parameters:
+
    +
  • cluster_class (torch.Tensor) – Clustering result tensor +with shape (N).

  • +
  • size_threshold (float) – Defaults to 0.35.

  • +
+
+
Returns:
+

list[int] – Predicted poison cluster classes list with shape (K)

+
+
+
+ +
+
+analyze_by_silhouette_score(cluster_class, reduced_fm, silhouette_threshold=0.1, **kwargs)[source]
+

Return analyze_by_relative_size() +if sklearn.metrics.silhouette_score is high, +which means clustering fits data well.

+
+
Parameters:
+
+
+
Returns:
+

list[int] – Predicted poison cluster classes list with shape (K)

+
+
+
+ +
+
+analyze_by_size(cluster_class, **kwargs)[source]
+

The smallest cluster.

+
+
Parameters:
+

cluster_class (torch.Tensor) – Clustering result tensor +with shape (N).

+
+
Returns:
+

list[int] – Predicted poison cluster classes list with shape (1)

+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/defenses/index.html b/trojanvision/defenses/index.html new file mode 100644 index 00000000..4efb5f8b --- /dev/null +++ b/trojanvision/defenses/index.html @@ -0,0 +1,779 @@ + + + + + + + + + + + + + + + + defenses — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

defenses

+ +
+
+trojanvision.defenses.add_argument(parser, defense_name=None, defense=None, class_dict=class_dict)[source]
+
+ +
+
+trojanvision.defenses.create(defense_name=None, defense=None, dataset_name=None, dataset=None, config=config, class_dict=class_dict, **kwargs)[source]
+
+ +
+
+class trojanvision.defenses.BackdoorDefense(attack, original=False, **kwargs)[source]
+

Backdoor defense abstract class. +It inherits trojanzoo.defenses.Defense.

+
+
Parameters:
+

original (bool) – Whether to load original clean model. +If False, load attack poisoned model +by calling self.attack.load().

+
+
Variables:
+
    +
  • real_mark (torch.Tensor) – Watermark that the attacker uses +with shape (C+1, H, W).

  • +
  • real_mask (torch.Tensor) – Mask of the watermark +by calling trojanvision.marks.Watermark.get_mask().

  • +
+
+
+
+
+get_filename(**kwargs)[source]
+

Get filenames for current defense settings.

+
+ +
+ +
+
+class trojanvision.defenses.InputFiltering(defense_input_num=100, **kwargs)[source]
+

Backdoor defense abstract class of input filtering. +It inherits trojanvision.defenses.BackdoorDefense.

+

It detects whether a test input is poisoned.

+

The defense tests defense_input_num clean test inputs +and their corresponding poison version +(2 * defense_input_num in total).

+
+
Parameters:
+

defense_input_num (int) – Number of test inputs. +Defaults to 100.

+
+
Variables:
+

test_set (torch.utils.data.Dataset) – Test dataset +with length defense_input_num.

+
+
+
+
+get_pred_labels()[source]
+

Get predicted labels for test inputs (need overriding).

+
+
Returns:
+

torch.Tensortorch.BoolTensor with shape (2 * defense_input_num).

+
+
+
+ +
+
+get_test_data()[source]
+

Get test data.

+
+
Returns:
+

(torch.Tensor, torch.Tensor) – Input and label tensors +with length defense_input_num.

+
+
+
+ +
+
+get_true_labels()[source]
+

Get ground-truth labels for test inputs.

+

Defaults to return [False] * defense_input_num + [True] * defense_input_num.

+
+
Returns:
+

torch.Tensortorch.BoolTensor with shape (2 * defense_input_num).

+
+
+
+ +
+ +
+
+class trojanvision.defenses.TrainingFiltering(defense_input_num=None, **kwargs)[source]
+

Backdoor defense abstract class of training data filtering. +It inherits trojanvision.defenses.BackdoorDefense.

+

Provided defense_input_num training data, +it detects which training data is poisoned.

+

The defense evaluates clean and poison training inputs.

+
    +
  • If defense_input_num is None, use full training data.

  • +
  • Else, sample defense_input_num * poison_percent poison training data +and defense_input_num * (1 - poison_percent) clean training data.

  • +
+

If dataset is not using train_mode == 'dataset', +construct poison dataset using all clean data with watermark attached. +(If defense_input_num is None as well, +the defense will evaluate the whole clean training set and its poisoned version.)

+
+
Parameters:
+

defense_input_num (int) – Number of training inputs to evaluate. +Defaults to None (all training set).

+
+
Variables:
+
+
+
+
+
+get_datasets()[source]
+

Get clean and poison datasets.

+
+
Returns:
+

(torch.utils.data.Dataset, torch.utils.data.Dataset) – Clean training dataset and poison training dataset.

+
+
+
+ +
+
+abstract get_pred_labels()[source]
+

Get predicted labels for training inputs (need overriding).

+
+
Returns:
+

torch.Tensortorch.BoolTensor with shape (defense_input_num).

+
+
+
+ +
+
+get_true_labels()[source]
+

Get ground-truth labels for training inputs.

+

Defaults to return [False] * len(self.clean_set) + [True] * len(self.poison_set).

+
+
Returns:
+

torch.Tensortorch.BoolTensor with shape (defense_input_num).

+
+
+
+ +
+ +
+
+class trojanvision.defenses.ModelInspection(defense_remask_epoch=10, defense_remask_lr=0.1, cost=1e-3, **kwargs)[source]
+

Backdoor defense abstract class of model inspection. +It inherits trojanvision.defenses.BackdoorDefense.

+

Provided a model, it tries to search for a trigger. +If trigger exists, that means the model is poisoned.

+
+
Parameters:
+
    +
  • defense_remask_epoch (int) – Defense watermark optimizing epochs. +Defaults to 10.

  • +
  • defense_remask_lr (float) – Defense watermark optimizing learning rate. +Defaults to 0.1.

  • +
  • cost (float) – Cost of mask norm loss. +Defaults to 1e-3.

  • +
+
+
Variables:
+
+
+
+
+
+check_early_stop(*args, **kwargs)[source]
+

Check whether to early stop at the end of each remask epoch.

+
+
Returns:
+

bool – Whether to early stop. Defaults to False.

+
+
+
+ +
+
+get_mark_loss_list(verbose=True, **kwargs)[source]
+

Get list of mark, loss, asr of recovered trigger for each class.

+
+
Parameters:
+
    +
  • verbose (bool) – Whether to output jaccard index for each trigger. +It’s also passed to optimize_mark().

  • +
  • **kwargs – Keyword arguments passed to optimize_mark().

  • +
+
+
Returns:
+

(torch.Tensor, list[float], list[float]) – list of mark, loss, asr with length num_classes.

+
+
+
+ +
+
+load(path=None)[source]
+

Load recovered mark from path.

+
+
Parameters:
+

path (str) – npz path of recovered mark. +Defaults to '{folder_path}/{self.get_filename()}.npz'.

+
+
+
+ +
+
+loss(_input, _label, target, trigger_output=None, **kwargs)[source]
+

Loss function to optimize recovered trigger.

+
+
Parameters:
+
    +
  • _input (torch.Tensor) – Clean input tensor +with shape (N, C, H, W).

  • +
  • _label (torch.Tensor) – Clean label tensor +with shape (N).

  • +
  • target (int) – Target class.

  • +
  • trigger_output (torch.Tensor) – Output tensor of input tensor with trigger. +Defaults to None.

  • +
+
+
Returns:
+

torch.Tensor – Scalar loss tensor.

+
+
+
+ +
+
+optimize_mark(label, loader=None, logger_header='', verbose=True, **kwargs)[source]
+
+
Parameters:
+
    +
  • label (int) – The class label to optimize.

  • +
  • loader (collections.abc.Iterable) – Data loader to optimize trigger. +Defaults to self.dataset.loader['train'].

  • +
  • logger_header (str) – Header string of logger. +Defaults to ''.

  • +
  • verbose (bool) – Whether to use logger for output. +Defaults to True.

  • +
  • **kwargs – Keyword arguments passed to loss().

  • +
+
+
Returns:
+

(torch.Tensor, torch.Tensor) – Optimized mark tensor with shape (C + 1, H, W) +and loss tensor.

+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/environ.html b/trojanvision/environ.html new file mode 100644 index 00000000..5a5ebde1 --- /dev/null +++ b/trojanvision/environ.html @@ -0,0 +1,451 @@ + + + + + + + + + + + + + + + + environ — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+ + +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/index.html b/trojanvision/index.html new file mode 100644 index 00000000..6b5aa8a5 --- /dev/null +++ b/trojanvision/index.html @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + + + trojanvision — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+ + +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/marks.html b/trojanvision/marks.html new file mode 100644 index 00000000..bf1132d5 --- /dev/null +++ b/trojanvision/marks.html @@ -0,0 +1,730 @@ + + + + + + + + + + + + + + + + marks — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

marks

+
+
+trojanvision.marks.add_argument(parser)[source]
+
+
Add watermark arguments to argument parser.
+
For specific arguments implementation, see Watermark.add_argument().
+
+
+
Parameters:
+

parser (argparse.ArgumentParser) – The parser to add arguments.

+
+
+
+ +
+
+trojanvision.marks.create(mark_path=None, data_shape=None, dataset_name=None, dataset=None, config=config, **kwargs)[source]
+
+
Create a watermark instance.
+
For arguments not included in kwargs, +use the default values in config.
+
For watermark implementation, see Watermark.
+
+
+
Parameters:
+
    +
  • mark_path (str) –

    +
    Path to watermark image or npy file. +There are some preset marks in the package.
    +
    Defaults to 'square_white.png'.
    +
    +

  • +
  • data_shape (list[int]) – The shape of image data [C, H, W].

  • +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str) – The alias of dataset_name.

  • +
  • config (Config) – The default parameter config.

  • +
  • **kwargs – Keyword arguments +passed to dataset init method.

  • +
+
+
Returns:
+

Watermark – Watermark instance.

+
+
+
+ +
+
+class trojanvision.marks.Watermark(mark_path='square_white.png', data_shape=None, mark_background_color='auto', mark_alpha=1.0, mark_height=3, mark_width=3, mark_height_offset=0, mark_width_offset=0, mark_random_init=False, mark_random_pos=False, mark_scattered=False, mark_scattered_height=None, mark_scattered_width=None, add_mark_fn=None, **kwargs)[source]
+

Watermark class that is used for backdoor attacks.

+
+

Note

+

Images with alpha channel are supported. +In this case, mark_alpha will be multiplied.

+
+
+

Warning

+

mark_random_init and mark_scattered can’t be used together.

+
+
+
Parameters:
+
    +
  • mark_path (str) –

    +
    Path to watermark image or npy file. +There are some preset marks in the package.
    +
    Defaults to 'square_white.png'.
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    mark_path

    mark image

    'apple_black.png'

    apple_black

    'apple_white.png'

    apple_white

    'square_black.png'

    square_black

    'square_white.png'

    square_white

    'watermark_black.png'

    watermark_black

    'watermark_white.png'

    watermark_white

    +

  • +
  • data_shape (list[int]) –

    The shape of image data [C, H, W].

    +
    +

    See also

    +

    Usually passed by dataset.data_shape. +See data_shape from +trojanvision.datasets.ImageSet.

    +
    +

  • +
  • mark_background_color (str | torch.Tensor) – Mark background color. +If str, choose from ['auto', 'black', 'white']; +else, it shall be 1-dim tensor ranging in [0, 1]. +It’s ignored when alpha channel in watermark image. +Defaults to 'auto'.

  • +
  • mark_alpha (float) – Mark opacity. Defaults to 1.0.

  • +
  • mark_height (int) – Mark resize height. Defaults to 3.

  • +
  • mark_width (int) –

    Mark resize width. Defaults to 3.

    +
    +

    Note

    +

    self.mark_height and self.mark_width will be different +from the passed argument values +when mark_scattered is True.

    +
    +

  • +
  • mark_height_offset (int) – Mark height offset. Defaults to 0.

  • +
  • mark_width_offset (int) –

    Mark width offset. Defaults to 0.

    +
    +

    Note

    +

    mark_height_offset and +mark_width_offset will be ignored +when mark_random_pos is True.

    +
    +

  • +
  • mark_random_init (bool) – Whether to randomly set pixel values of watermark, +which means only using the mark shape from the watermark image. +Defaults to False.

  • +
  • mark_random_pos (bool) – Whether to add mark at random location when calling add_mark(). +If True, mark_height_offset and mark_height_offset will be ignored. +Defaults to False.

  • +
  • mark_scattered (bool) – Random scatter mark pixels +in the entire image to get the watermark. Defaults to False.

  • +
  • mark_scattered_height (int | None) – Scattered mark height. Defaults to data_shape[1].

  • +
  • mark_scattered_width (int | None) –

    Scattered mark width. Defaults to data_shape[2].

    +
    +

    Note

    +
      +
    • The random scatter process only occurs once at watermark initialization. +add_mark() will still add the same scattered mark to images.

    • +
    • Mark image will first resize to (mark_height, mark_width) and then +scattered to (mark_scattered_height, mark_scattered_width). +If they are the same, it’s actually pixel shuffling.

    • +
    • self.mark_height and self.mark_width will be set to scattered version.

    • +
    +
    +

  • +
  • add_mark_fn (Callable | None) – Customized function to add mark to images for add_mark() to call. +add_mark_fn(_input, mark_random_pos=mark_random_pos, mark_alpha=mark_alpha, **kwargs) +Defaults to None.

  • +
+
+
Variables:
+
    +
  • mark (torch.Tensor) – Mark float tensor with shape +(data_shape[0] + 1, mark_height, mark_width) +(last dimension is alpha channel).

  • +
  • mark_alpha (float) – Mark opacity. Defaults to 1.0.

  • +
  • mark_height (int) – Mark resize height. Defaults to 3.

  • +
  • mark_width (int) –

    Mark resize width. Defaults to 3.

    +
    +

    Note

    +

    self.mark_height and self.mark_width will be different +from the passed argument values +when mark_scattered is True.

    +
    +

  • +
  • mark_height_offset (int) – Mark height offset. Defaults to 0.

  • +
  • mark_width_offset (int) –

    Mark width offset. Defaults to 0.

    +
    +

    Note

    +

    mark_height_offset and +mark_width_offset will be ignored +when mark_random_pos is True.

    +
    +

  • +
  • mark_random_init (bool) – Whether to randomly set pixel values of watermark, +which means only using the mark shape from the watermark image. +Defaults to False.

  • +
  • mark_random_pos (bool) – Whether to add mark at random location when calling add_mark(). +If True, mark_height_offset and mark_height_offset will be ignored. +Defaults to False.

  • +
  • mark_scattered (bool) – Random scatter mark pixels +in the entire image to get the watermark. Defaults to False.

  • +
  • mark_scattered_height (int) – Scattered mark height. Defaults to data_shape[1].

  • +
  • mark_scattered_width (int) – Scattered mark width. Defaults to data_shape[2].

  • +
  • add_mark_fn (Callable | None) – Customized function to add mark to images for add_mark() to call. +add_mark_fn(_input, mark_random_pos=mark_random_pos, mark_alpha=mark_alpha, **kwargs) +Defaults to None.

  • +
+
+
+
+
+static add_argument(group)[source]
+

Add watermark arguments to argument parser group. +View source to see specific arguments.

+
+

Note

+

This is the implementation of adding arguments. +For users, please use add_argument() instead, which is more user-friendly.

+
+
+ +
+
+add_mark(_input, mark_random_pos=None, mark_alpha=None, mark=None, **kwargs)[source]
+

Main method to add watermark to a batched input image tensor ranging in [0, 1].

+

Call self.add_mark_fn() instead if it’s not None.

+
+
Parameters:
+
    +
  • _input (torch.Tensor) – Batched input tensor +ranging in [0, 1] with shape (N, C, H, W).

  • +
  • mark_random_pos (bool | None) – Whether to add mark at random location. +Defaults to self.mark_random_pos.

  • +
  • mark_alpha (float | None) – Mark opacity. Defaults to self.mark_alpha.

  • +
  • mark (torch.Tensor | None) – Mark tensor. Defaults to self.mark.

  • +
  • **kwargs – Keyword arguments passed to self.add_mark_fn().

  • +
+
+
+
+ +
+
+load_mark(mark_img, mark_background_color='auto', already_processed=False)[source]
+

Load watermark tensor from image mark_img, +scale by calling PIL.Image.Image.resize +and transform to (channel + 1, height, width) with alpha channel.

+
+
Parameters:
+
    +
  • mark_img (PIL.Image.Image | str) – Pillow image instance or file path.

  • +
  • mark_background_color (str | torch.Tensor | None) – Mark background color. +If str, choose from ['auto', 'black', 'white']; +else, it shall be 1-dim tensor ranging in [0, 1]. +It’s ignored when alpha channel in watermark image. +Defaults to 'auto'.

  • +
  • already_processed (bool) – If True, will just load mark_img as self.mark. +Defaults to False.

  • +
+
+
Returns:
+

torch.Tensor – Watermark tensor ranging in [0, 1] +with shape (channel + 1, height, width) with alpha channel.

+
+
+
+ +
+
+static scatter_mark(mark_unscattered, mark_scattered_shape)[source]
+

Scatter the original mark tensor to a provided shape.

+

If the shape are the same, it becomes a pixel shuffling process.

+
+
Parameters:
+
    +
  • mark_unscattered (torch.Tensor) – The unscattered mark tensor +with shape (data_shape[0] + 1, mark_height, mark_width)

  • +
  • mark_scattered_shape (list[int]) – The scattered mark shape +(data_shape[0] + 1, mark_scattered_height, mark_scattered_width)

  • +
+
+
Returns:
+

torch.Tensor – The scattered mark with shape mark_scattered_shape.

+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/models/index.html b/trojanvision/models/index.html new file mode 100644 index 00000000..6d89d3b6 --- /dev/null +++ b/trojanvision/models/index.html @@ -0,0 +1,807 @@ + + + + + + + + + + + + + + + + models — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

models

+ +
+
+trojanvision.models.add_argument(parser, model_name=None, model=None, config=config, class_dict=class_dict)[source]
+
+
Add image model arguments to argument parser.
+
For specific arguments implementation, see ImageModel.add_argument().
+
+
+
Parameters:
+
    +
  • parser (argparse.ArgumentParser) – The parser to add arguments.

  • +
  • model_name (str) – The model name.

  • +
  • model (str | ImageModel) – Model instance or model name +(as the alias of model_name).

  • +
  • config (Config) – The default parameter config, +which contains the default dataset and model name if not provided.

  • +
  • class_dict (dict[str, type[ImageModel]]) – Map from model name to model class. +Defaults to trojanvision.models.class_dict.

  • +
+
+
+ +
+ +
+
+trojanvision.models.create(model_name=None, model=None, dataset_name=None, dataset=None, config=config, class_dict=class_dict, **kwargs)[source]
+
+
Create a model instance.
+
For arguments not included in kwargs, +use the default values in config.
+
The default value of folder_path is +'{model_dir}/{dataset.data_type}/{dataset.name}'.
+
For model implementation, see ImageModel.
+
+
+
Parameters:
+
    +
  • model_name (str) – The model name.

  • +
  • model (str | ImageModel) – The model instance or model name +(as the alias of model_name).

  • +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str | trojanvision.datasets.ImageSet) – Dataset instance or dataset name +(as the alias of dataset_name).

  • +
  • config (Config) – The default parameter config.

  • +
  • class_dict (dict[str, type[ImageModel]]) – Map from model name to model class. +Defaults to trojanvision.models.class_dict.

  • +
  • **kwargs – Keyword arguments +passed to model init method.

  • +
+
+
Returns:
+

ImageModel – The image model instance.

+
+
+ +
+ +
+
+trojanvision.models.output_available_models(class_dict=class_dict, indent=0)[source]
+

Output all available model names.

+
+
Parameters:
+
    +
  • class_dict (dict[str, type[ImageModel]]) – Map from model name to model class. +Defaults to trojanvision.models.class_dict.

  • +
  • indent (int) – The space indent for the entire string. +Defaults to 0.

  • +
+
+
+ +
+ +
+
+class trojanvision.models.ImageModel(name='imagemodel', layer='', model=_ImageModel, dataset=None, data_shape=None, adv_train=None, adv_train_random_init=False, adv_train_eval_random_init=None, adv_train_iter=7, adv_train_alpha=2 / 255, adv_train_eps=8 / 255, adv_train_eval_iter=None, adv_train_eval_alpha=None, adv_train_eval_eps=None, adv_train_trades_beta=6.0, norm_layer='bn', sgm=False, sgm_gamma=1.0, norm_par=None, suffix=None, modify_first_layer_channel=True, **kwargs)[source]
+
+
A basic image model wrapper class, which should be the most common interface for users.
+
It inherits trojanzoo.models.Model and further extend +adversarial training and Skip Gradient Method (SGM).
+
+ +
+
Parameters:
+

layer (int | str) – Default layer when it’s not provided in name. +Defaults to ''.

+
+
Variables:
+
    +
  • pgd (trojanvision.attacks.PGD) – PGD attacker using eval settings without early stop. +It’s only constructed when adv_train is not None.

  • +
  • adv_train (str | None) –

    Adversarial training strategy. +Choose from [None, 'pgd', 'free', 'trades']. +Defaults to None.

    +
    +

    Note

    +

    If adv_train is not None and suffix is None, +set suffix = f'_at-{adv_train}'.

    +
    +

  • +
  • adv_train_random_init (bool) – Whether to random initialize adversarial noise +using normal distribution with adv_train_eps. +Otherwise, attack starts from the benign inputs. +Defaults to False.

  • +
  • adv_train_iter (int) – Adversarial training PGD iteration. +Defaults to 7.

  • +
  • adv_train_alpha (float) – Adversarial training PGD alpha. +Defaults to 2255\frac{2}{255}.

  • +
  • adv_train_eps (float) – Adversarial training PGD eps. +Defaults to 8255\frac{8}{255}.

  • +
  • adv_train_eval_iter (int) – Adversarial training PGD iteration at evaluation. +Defaults to adv_train_iter.

  • +
  • adv_train_eval_alpha (float) – Adversarial training PGD alpha at evaluation. +Defaults to adv_train_alpha.

  • +
  • adv_train_eval_eps (float) – Adversarial training PGD eps at evaluation. +Defaults to adv_train_eps.

  • +
  • adv_train_trades_beta (float) – regularization factor +(1λ\frac{1}{\lambda} in TRADES) +Defaults to 6.0.

  • +
  • norm_layer (str) – The normalization layer type. +Choose from ['bn', 'gn']. +Defaults to ['bn'].

  • +
  • sgm (bool) – Whether to use Skip Gradient Method. Defaults to False.

  • +
  • sgm_gamma (float) – The gradient factor γ\gamma used in SGM. +Defaults to 1.0.

  • +
+
+
+
+
+classmethod add_argument(group)[source]
+

Add image model arguments to argument parser group. +View source to see specific arguments.

+
+

Note

+

This is the implementation of adding arguments. +The concrete model class may override this method to add more arguments. +For users, please use add_argument() instead, which is more user-friendly.

+
+ +
+ +
+
+get_data(data, adv_train=False, **kwargs)[source]
+
+
Parameters:
+
+
+
+
+ +
+
+get_heatmap(_input, _label, method='grad_cam', cmap=jet, mode='bicubic')[source]
+

Use colormap cmap to get heatmap tensor of _input +w.r.t. _label with method.

+
+
Parameters:
+
+
+
Returns:
+

torch.Tensor – The heatmap tensor with shape ([N], C, H, W).

+
+
+
+

Note

+

Most matplotlib.colors.Colormap will return +a 4-channel heatmap with alpha channel.

+
+ +
+
Example:
+
import trojanvision
+from trojanvision.utils import superimpose
+import torchvision
+import torchvision.transforms as transforms
+import PIL.Image as Image
+import os
+import wget
+
+env = trojanvision.environ.create(device='cpu')
+model = trojanvision.models.create(
+    'resnet152', data_shape=[3, 224, 224], official=True,
+    norm_par={'mean': [0.485, 0.456, 0.406],
+              'std': [0.229, 0.224, 0.225]})
+transform = transforms.Compose([
+    transforms.Resize(256),
+    transforms.CenterCrop(224),
+    transforms.PILToTensor(),
+    transforms.ConvertImageDtype(torch.float)])
+url = 'https://i.imgur.com/Bvro0YD.png'
+if not os.path.isfile('african_elephant.png'):
+    wget.download(url, 'african_elephant.png')
+
+img = Image.open('african_elephant.png').convert(mode='RGB')
+
+_input = transform(img).unsqueeze(0).to(env['device'])
+_prob = model.get_prob(_input).squeeze()
+label = _prob.argmax().item()
+conf = _prob[label].item()
+print(f'{label=:}  {conf=:.2%}')
+
+grad_cam = model.get_heatmap(_input, label)[:, :3]
+saliency_map = model.get_heatmap(_input, label,
+                                 method='saliency_map')[:, :3]
+grad_cam_impose = (grad_cam * 0.4 + _input)
+saliency_map_impose = (saliency_map * 0.4 + _input)
+grad_cam_impose = grad_cam_impose.div(grad_cam_impose.max())
+saliency_map_impose = saliency_map_impose.div(saliency_map_impose.max())
+
+torchvision.utils.save_image(_input, './center_cropped.png')
+torchvision.utils.save_image(grad_cam, './grad_cam.png')
+torchvision.utils.save_image(saliency_map, './saliency_map.png')
+torchvision.utils.save_image(grad_cam_impose, './grad_cam_impose.png')
+torchvision.utils.save_image(saliency_map_impose, './saliency_map_impose.png')
+
+
+

label=386  conf=77.74%

+ +++++ + + + + + + + + + + + + + + +

original

original

center_cropped

grad_cam

grad_cam

grad_cam_impose

saliency_map

saliency_map

saliency_map_impose

+
+
+
+ +
+
+classmethod get_name(name, layer='')[source]
+

A useful function to combine name and layer.

+
+

Note

+
    +
  • If there is already layer claimed in name, +layer will be ignored.

  • +
  • You may override this method for concrete model class +on demand.

  • +
+
+
+
Parameters:
+
    +
  • name (str) – Model name string.

  • +
  • layer (int | str) – Model layer. Defaults to ''.

  • +
+
+
Example:
+
>>> from trojanvision.models import ImageModel
+>>>
+>>> ImageModel.get_name('vgg_comp', layer=13)
+'vgg13_comp'
+>>> ImageModel.get_name('vgg16_comp', layer=13)
+'vgg16_comp'
+
+
+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/models/nas.html b/trojanvision/models/nas.html new file mode 100644 index 00000000..153ac7a4 --- /dev/null +++ b/trojanvision/models/nas.html @@ -0,0 +1,662 @@ + + + + + + + + + + + + + + + + nas — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

nas

+
+
+class trojanvision.models.DARTS(name='darts', model_arch='darts', layers=20, init_channels=36, dropout_p=0.2, auxiliary=False, auxiliary_weight=0.4, genotype=None, model=_DARTS, supernet=False, arch_search=False, use_full_train_set=False, arch_lr=3e-4, arch_weight_decay=1e-3, arch_unrolled=False, primitives=PRIMITIVES, **kwargs)[source]
+

DARTS-like models used in Neural Architecture Search.

+
+
Available model names:
+
{'darts'}
+
+
+
+
+ +
+
Parameters:
+
    +
  • supernet (bool) – Whether to use supernet (mixed operations). +Defaults to False.

  • +
  • model_arch (str) –

    Genotype name in trojanvision.utils.model_archs.genotypes to use. +Defaults to 'darts'.

    +
      +
    • 'amoebanet', 'amoebanet_adapt'

    • +
    • 'darts_v1', 'darts_v2'('darts')

    • +
    • 'drnas_cifar10'('drnas'), 'drnas_imagenet'

    • +
    • 'enas', 'enas_adapt'

    • +
    • 'nasnet', 'nasnet_adapt'

    • +
    • 'pc_darts_cifar'('pc_darts'), 'pc_darts_image'

    • +
    • 'pdarts'

    • +
    • 'robust_darts'

    • +
    • 'sgas'

    • +
    • 'snas_mild', 'snas_adapt'

    • +
    • 'random'

    • +
    • 'diy_deep', 'diy_noskip', 'diy_deep_noskip'

    • +
    +

  • +
  • layers (int) – Total number of layers. Defaults to 20.

  • +
  • init_channels (int) – out_channel of stem conv layer. +Defaults to 36.

  • +
  • dropout_p (float) – Dropout probability. +Defaults to 0.2.

  • +
  • auxiliary (bool) – Whether to use auxiliary classifier. +Defaults to False.

  • +
  • auxiliary_weight (float) – Loss weight of auxiliary classifier. +Defaults to 0.4.

  • +
  • arch_search (bool) – Whether to search supernet architecture weight parameters. +Defaults to False.

  • +
  • use_full_train_set (bool) – Whether to use full training data during architecture search. +Defaults to False.

  • +
  • arch_lr (float) – Learning rate for architecture optimizer. +Defaults to 3e-4

  • +
  • arch_weight_decay (float) – Weight decay for architecture optimizer. +Defaults to 1e-3.

  • +
  • arch_unrolled (bool) – Whether to use one-step unrolled validation loss (darts-v2). +Defaults to False.

  • +
+
+
Variables:
+

genotype (Genotype) – Genotype of cell architecture.

+
+
+
+

Note

+

The implementation of DARTS model is in trojanvision.utils.model_archs.darts

+
+
+ +
+
+class trojanvision.models.ENAS(name='enas', model=_ENAS, folder_path=None, **kwargs)[source]
+

This is yet another ENAS implementation based on Microsoft Neural Network Intelligence (NNI) library. +You need to first generate 'enas_macro.pt' using NNI library and put it under folder_path.

+
+

Warning

+

It is highly recommended to use trojanvision.models.DARTS with model_arch='enas' instead.

+
+
+
Available model names:
+
{'enas'}
+
+
+
+
+ +
+ +
+
+class trojanvision.models.NATSbench(name='nats_bench', model=_NATSbench, model_index=0, model_seed=777, hp=200, dataset=None, dataset_name=None, nats_path=None, search_space='tss', **kwargs)[source]
+

NATS-Bench proposed by Xuanyi Dong from University of Technology Sydney.

+
+
Available model names:
+
{'nats_bench'}
+
+
+
+
+
+

Note

+

There are prerequisites to use the benchmark:

+
    +
  • pip install nats_bench.

  • +
  • git clone https://github.com/D-X-Y/AutoDL-Projects.git and pip install .

  • +
  • Extract NATS-tss-v1_0-3ffb9-full to nats_path.

  • +
+
+ +
+
Parameters:
+
    +
  • model_index (int) – model_index passed to +api.get_net_config(). +Ranging from 0 -- 15624. +Defaults to 0.

  • +
  • model_seed (int) – model_seed passed to +api.get_net_param(). +Choose from [777, 888, 999]. +Defaults to 777.

  • +
  • hp (int) – Training epochs. +hp passed to api.get_net_param(). +Choose from [12, 200]. +Defaults to 200.

  • +
  • nats_path (str) – NATS benchmark file path. +It should be set as format like +'**/NATS-tss-v1_0-3ffb9-full'

  • +
  • search_space (str) – Search space of topology or size. +Choose from ['tss', 'sss'].

  • +
  • dataset_name (str) – Dataset name. +Choose from ['cifar10', 'cifar10-valid', 'cifar100', 'imagenet16-120'].

  • +
+
+
+
+ +
+
+class trojanvision.models.PNASNet(name='pnasnet', layer='_b', model=_PNASNet, **kwargs)[source]
+

PNASNet proposed by Chenxi Liu from Johns Hopkins University in ECCV 2018.

+
+

Note

+

The implementation is imported from a third-party github repo. The correctness can’t be guaranteed. +It might be better to reimplement according to tensorflow codes: +https://github.com/tensorflow/models/blob/master/research/slim/nets/nasnet/pnasnet.py

+
+
+
Available model names:
+
{'pnasnet', 'pnasnet_a', 'pnasnet_b'}
+
+
+
+
+ +
+ +
+
+class trojanvision.models.ProxylessNAS(name='proxylessnas', target_platform='proxyless_cifar', model=_ProxylessNAS, **kwargs)[source]
+

ProxylessNAS proposed by Han Cai from MIT in ICLR 2019.

+
+
Available model names:
+
{'proxylessnas'}
+
+
+
+
+ +
+
Parameters:
+

target_platform (str) – Target platform to load using torch.hub.load. +Choose from ['proxyless_cpu', 'proxyless_gpu', 'proxyless_mobile', 'proxyless_mobile_14', 'proxyless_cifar'] +Defaults to 'proxyless_cifar'.

+
+
+
+ +
+ + +
+ +
+ + +
+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/models/others.html b/trojanvision/models/others.html new file mode 100644 index 00000000..16afb11a --- /dev/null +++ b/trojanvision/models/others.html @@ -0,0 +1,488 @@ + + + + + + + + + + + + + + + + others — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

others

+
+
+class trojanvision.models.MagNet(name='magnet', dataset=None, model=_MagNet, structure=None, activation=None, v_noise=0.1, **kwargs)[source]
+

MagNet proposed by Dongyu Meng from Shanghai Tech University in CCS 2017. +It is an autoencoder for input images to defend against adversarial attacks.

+
+
Available model names:
+
{'magnet'}
+
+
+
+
+ +
+
Parameters:
+
    +
  • structure (list[int | str]) –

    The MagNet model structure. +Defaults to

    +
      +
    • 1-channel images: [3, 'average', 3] (e.g, MNIST)

    • +
    • 3-channel images: [32]

    • +
    +

  • +
  • activation (str) – The activation layer in MagNet model. +Choose from ['sigmoid', 'relu']. +Defaults to 'sigmoid' for 1-channel images (e.g, MNIST) +and 'relu' for 3-channel images.

  • +
  • v_noise (float) – The std of random Gaussian noise added to training data. +Defaults to 0.1.

  • +
+
+
+
+ +
+ + +
+ +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/models/torchvision.html b/trojanvision/models/torchvision.html new file mode 100644 index 00000000..4593f60e --- /dev/null +++ b/trojanvision/models/torchvision.html @@ -0,0 +1,760 @@ + + + + + + + + + + + + + + + + torchvision — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

torchvision

+
+
+class trojanvision.models.AlexNet(name='alexnet', model=_AlexNet, **kwargs)[source]
+

AlexNet proposed by Alex Krizhevsky from Google in 2014.

+
+
Available model names:
+
{'alexnet'}
+
+
+
+
+ +
self.features = nn.Sequential(
+    nn.Conv2d(3, 64, kernel_size=11, stride=4, padding=2),
+    nn.ReLU(inplace=True),
+    nn.MaxPool2d(kernel_size=3, stride=2),
+    nn.Conv2d(64, 192, kernel_size=5, padding=2),
+    nn.ReLU(inplace=True),
+    nn.MaxPool2d(kernel_size=3, stride=2),
+    nn.Conv2d(192, 384, kernel_size=3, padding=1),
+    nn.ReLU(inplace=True),
+    nn.Conv2d(384, 256, kernel_size=3, padding=1),
+    nn.ReLU(inplace=True),
+    nn.Conv2d(256, 256, kernel_size=3, padding=1),
+    nn.ReLU(inplace=True),
+    nn.MaxPool2d(kernel_size=3, stride=2),
+)
+
+self.pool = nn.AdaptiveAvgPool2d((6, 6))
+self.flatten = nn.Flatten(1)
+
+self.classifier = nn.Sequential(
+    nn.Dropout(),
+    nn.Linear(256 * 6 * 6, 4096),
+    nn.ReLU(inplace=True),
+    nn.Dropout(),
+    nn.Linear(4096, 4096),
+    nn.ReLU(inplace=True),
+    nn.Linear(4096, num_classes),
+)
+
+
+
+ +
+
+class trojanvision.models.DenseNet(name='densenet', layer=121, model=_DenseNet, **kwargs)[source]
+

DenseNet proposed by Gao Huang from Cornell University in CVPR 2017.

+
+
Available model names:
+
{'densenet', 'densenet_comp',
+ 'densenet121', 'densenet169', 'densenet201', 'densenet161',
+ 'densenet121_comp', 'densenet169_comp', 'densenet201_comp', 'densenet161_comp'}
+
+
+
+
+ +
+

Note

+

_comp reduces the first convolutional layer +from kernel_size=7, stride=2, padding=3

+

to kernel_size=3, stride=1, padding=1, +and removes following norm0, relu0, pool0 +(pool0 is torch.nn.MaxPool2d) +before block layers.

+
+
+ +
+
+class trojanvision.models.EfficientNet(name='efficientnet', layer='_b0', model=_EfficientNet, **kwargs)[source]
+

EfficientNet proposed by Mingxing Tan from Google in ICML 2019.

+
+
Available model names:
+
{'efficientnet', 'efficientnet_comp',
+ 'efficientnet_b0', 'efficientnet_b1', 'efficientnet_b2',
+ 'efficientnet_b3', 'efficientnet_b4', 'efficientnet_b5',
+ 'efficientnet_b6', 'efficientnet_b7',
+ 'efficientnet_b0_comp', 'efficientnet_b1_comp', 'efficientnet_b2_comp',
+ 'efficientnet_b3_comp', 'efficientnet_b4_comp', 'efficientnet_b5_comp',
+ 'efficientnet_b6_comp', 'efficientnet_b7_comp'}
+
+
+
+
+ +
+

Note

+

_comp reduces the first convolutional layer +from kernel_size=7, stride=2, padding=3

+

to kernel_size=3, stride=1, padding=1.

+
+
+ +
+
+class trojanvision.models.MNASNet(name='mnasnet', mnas_alpha=1.0, model=_MNASNet, **kwargs)[source]
+

MNASNet proposed by Mingxing Tan from Google in CVPR 2019.

+
+
Available model names:
+
{'mnasnet', 'mnasnet0_5', 'mnasnet0_75', 'mnasnet1_0', 'mnasnet1_3'}
+
+
+
+
+ +
+ +
+
+class trojanvision.models.MobileNet(name='mobilenet_v2', model=_MobileNet, **kwargs)[source]
+

MobileNets proposed by Andrew Howard and Liang-Chieh Chen from Google in CVPR 2018.

+
+
Available model names:
+
['mobilenet_v2', 'mobilenet_v3_large', 'mobilenet_v3_small',
+ 'mobilenet_v2_comp', 'mobilenet_v3_large_comp', 'mobilenet_v3_small_comp']
+
+
+
+
+
+

See also

+ +
+
+

Note

+

_comp uses a small inverted_residual_setting +and set first conv layer stride=1.

+
+
+ +
+
+class trojanvision.models.ResNet(name='resnet', layer=18, model=_ResNet, **kwargs)[source]
+

ResNet model series including ResNet, ResNext and WideResNet.

+
+
Available model names:
+
{'resnet', 'resnet_comp', 'resnet_s',
+ 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152',
+ 'resnet18_comp', 'resnet34_comp', 'resnet50_comp', 'resnet101_comp', 'resnet152_comp',
+ 'resnext50_32x4d', 'resnext101_32x8d',
+ 'resnext50_32x4d_comp', 'resnext101_32x8d_comp',
+ 'wide_resnet50_2', 'wide_resnet101_2',
+ 'wide_resnet50_2_comp', 'wide_resnet101_2_comp',
+
+ 'resnet18_s', 'resnet34_s', 'resnet50_s', 'resnet101_s', 'resnet152_s',
+ 'resnet18_ap_comp'}
+
+
+
+
+ +
+

Note

+ +
+
+ +
+
+class trojanvision.models.ShuffleNetV2(name='shufflenetv2', layer='_x0_5', model=_ShuffleNetV2, **kwargs)[source]
+

ShuffleNet v2 proposed by Ningning Ma from Megvii in ECCV 2018.

+
+
Available model names:
+
{'shufflenetv2', 'shufflenetv2_comp',
+ 'shufflenetv2_x0_5', 'shufflenetv2_x1_0',
+ 'shufflenetv2_x1_5', 'shufflenetv2_x2_0',
+ 'shufflenetv2_x0_5_comp', 'shufflenetv2_x1_0_comp',
+ 'shufflenetv2_x1_5_comp', 'shufflenetv2_x2_0_comp'}
+
+
+
+
+ +
+

Note

+

_comp reduces the first convolutional layer +from kernel_size=7, stride=2, padding=3

+

to kernel_size=3, stride=1, padding=1, +and removes the maxpool layer before block layers.

+
+
+ +
+
+class trojanvision.models.VGG(name='vgg', layer=13, model=_VGG, **kwargs)[source]
+

VGG model proposed by Karen Simonyan from University of Oxford in ICLR 2015.

+
+
Available model names:
+
{'vgg', 'vgg_bn', 'vgg_comp', 'vgg_bn_comp', 'vgg_s', 'vgg_bn_s',
+ 'vgg11', 'vgg13', 'vgg16', 'vgg19',
+ 'vgg11_bn', 'vgg13_bn', 'vgg16_bn', 'vgg19_bn',
+ 'vgg11_comp', 'vgg13_comp', 'vgg16_comp', 'vgg19_comp',
+ 'vgg11_bn_comp', 'vgg13_bn_comp', 'vgg16_bn_comp', 'vgg19_bn_comp'
+ 'vgg11_s', 'vgg13_s', 'vgg16_s', 'vgg19_s',
+ 'vgg11_bn_s', 'vgg13_bn_s', 'vgg16_bn_s', 'vgg19_bn_s'}
+
+
+
+
+ +
+

Note

+
    +
  • _comp sets torch.nn.AdaptiveAvgPool2d from (7, 7) to (1, 1), +update the intermediate feature dimension from 4096 to 512 in self.classifier.

  • +
  • _s further makes self.classifier only one single linear layer based on _comp.

  • +
+
+
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/optim.html b/trojanvision/optim.html new file mode 100644 index 00000000..62a0d319 --- /dev/null +++ b/trojanvision/optim.html @@ -0,0 +1,445 @@ + + + + + + + + + + + + + + + + optim — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

optim

+
+ + +
+ +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/trainer.html b/trojanvision/trainer.html new file mode 100644 index 00000000..794ca8ee --- /dev/null +++ b/trojanvision/trainer.html @@ -0,0 +1,451 @@ + + + + + + + + + + + + + + + + trainer — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+ + +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanvision/utils.html b/trojanvision/utils.html new file mode 100644 index 00000000..094b7075 --- /dev/null +++ b/trojanvision/utils.html @@ -0,0 +1,442 @@ + + + + + + + + + + + + + + + + utils — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

utils

+
+ + +
+ +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/attacks.html b/trojanzoo/attacks.html new file mode 100644 index 00000000..2b9c518f --- /dev/null +++ b/trojanzoo/attacks.html @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + + attacks — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

attacks

+
+
+trojanzoo.attacks.add_argument(parser, attack_name=None, attack=None, class_dict={})[source]
+
+
Add attack arguments to argument parser.
+
For specific arguments implementation, see Attack.add_argument().
+
+
+
Parameters:
+
    +
  • parser (argparse.ArgumentParser) – The parser to add arguments.

  • +
  • attack_name (str) – The attack name.

  • +
  • attack (str | Attack) – The attack instance or attack name +(as the alias of attack_name).

  • +
  • class_dict (dict[str, type[Attack]]) – Map from attack name to attack class. +Defaults to {}.

  • +
+
+
Returns:
+

argparse._ArgumentGroup – The argument group.

+
+
+
+ +
+
+trojanzoo.attacks.create(attack_name=None, attack=None, dataset_name=None, dataset=None, model_name=None, model=None, config=config, class_dict={}, **kwargs)[source]
+
+
Create an attack instance.
+
For arguments not included in kwargs, +use the default values in config.
+
The default value of folder_path is +'{attack_dir}/{dataset.data_type}/{dataset.name}/{model.name}/{attack.name}'.
+
For attack implementation, see Attack.
+
+
+
Parameters:
+
    +
  • attack_name (str) – The attack name.

  • +
  • attack (str | Attack) – The attack instance or attack name +(as the alias of attack_name).

  • +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str | Dataset) – Dataset instance or dataset name +(as the alias of dataset_name).

  • +
  • model_name (str) – The model name.

  • +
  • model (str | Model) – The model instance or model name +(as the alias of model_name).

  • +
  • config (Config) – The default parameter config.

  • +
  • class_dict (dict[str, type[Attack]]) – Map from attack name to attack class. +Defaults to {}.

  • +
  • **kwargs – The keyword arguments +passed to attack init method.

  • +
+
+
Returns:
+

Attack – The attack instance.

+
+
+
+ +
+
+class trojanzoo.attacks.Attack(dataset=None, model=None, folder_path=None, **kwargs)[source]
+
+
An abstract class representing an attack.
+ +
+
+

Note

+

This is the implementation of attack. +For users, please use create() instead, which is more user-friendly.

+
+
+
+classmethod add_argument(group)[source]
+

Add attack arguments to argument parser group. +View source to see specific arguments.

+
+

Note

+

This is the implementation of adding arguments. +The concrete attack class may override this method to add more arguments. +For users, please use add_argument() instead, which is more user-friendly.

+
+
+ +
+
+abstract attack(**kwargs)[source]
+

Main attack method (need overriding).

+
+ +
+
+generate_target(_input, idx=1, same=False, **kwargs)[source]
+

Generate target labels of a batched input based on +the classification confidence ranking index.

+
+
Parameters:
+
    +
  • _input (torch.Tensor) – The input tensor.

  • +
  • idx (int) – The classification confidence +rank of target class. +Defaults to 1.

  • +
  • same (bool) – Generate the same label +for all samples using mod. +Defaults to False.

  • +
+
+
Returns:
+

torch.Tensor – The generated target label with shape (N).

+
+
+
+

See also

+

This method calls +trojanzoo.models.Model.generate_target().

+

The implementation is in +trojanzoo.utils.model.generate_target().

+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/configs.html b/trojanzoo/configs.html new file mode 100644 index 00000000..075dc858 --- /dev/null +++ b/trojanzoo/configs.html @@ -0,0 +1,583 @@ + + + + + + + + + + + + + + + + configs — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

configs

+

TrojanZoo config path:

+
config_path: dict[str, str] = {
+    'package': os.path.dirname(__file__),   # trojanzoo/configs/*/*.yml
+    'user': os.path.normpath(os.path.expanduser(
+        '~/.trojanzoo/configs/trojanzoo')),
+    'project': os.path.normpath('./configs/trojanzoo'),
+    }
+
+
+
+
+class trojanzoo.configs.Config(cmd_config_path=None, _base=None, **kwargs)[source]
+

Configuration class.

+
+

Warning

+

There is already a preset config instance trojanzoo.configs.config.

+

NEVER call the class init method to create a new instance +(unless you know what you’re doing).

+
+
+

Note

+

ConfigType is Module[str, Module[str, Any]]

+

value = config[config_file][key][dataset_name] +where dataset_name is optional

+

(config[config_file][key] is trojanzoo.utils.module.Param +and has default values).

+
+
+
Parameters:
+
    +
  • _base (Config) – The base config instance. +config_dict of current config instance +will inherit _base.config_dict +and update based on self.config_path. +It’s usually the config in father library +(e.g., trojanvision config inherits trojanzoo config). +Defaults to None.

  • +
  • **kwargs (dict[str, str]) – Map of config paths.

  • +
+
+
Variables:
+
    +
  • cmd_config_path (str) – Path to cmd_config. Defaults to None.

  • +
  • cmd_config (ConfigType) – Config loaded from path cmd_config_path.

  • +
  • config_path (dict[str, str]) – Map from config name +(e.g., 'package', 'user', 'project') +to path string.

  • +
  • config_dict (dict[str, ConfigType]) – Map from config name +(e.g., 'package', 'user', 'project') +to its config.

  • +
  • full_config (ConfigType) – Full config with parameters for all datasets +by calling merge() to merge different configs +in self.config_dict. +value = full_config[config_file][key][dataset_name].

  • +
+
+
+
+
+get_config(dataset_name, config=None, **kwargs)[source]
+

Get config for specific dataset.

+
+
Parameters:
+
    +
  • dataset_name (str) – Dataset name.

  • +
  • config – (ConfigType): The config for all datasets. +value = full_config[config_file][key][dataset_name]. +Defaults to self.full_config.

  • +
+
+
Returns:
+

Param[str, Module[str, Any]] – Config for dataset_name. +value = full_config[config_file][key].

+
+
+
+ +
+
+static load_config(path)[source]
+

Load yaml or json configs from path.

+
+
Parameters:
+

path (str) – Path to config file.

+
+
Returns:
+

ConfigType – Config loaded from path.

+
+
+
+ +
+
+merge(keys=['package', 'user', 'project'])[source]
+

Merge different configs of keys in self.config_dict.

+
+
Parameters:
+

keys (list[str]) – Keys of self.config_dict to merge.

+
+
Returns:
+

ConfigType – Merged config.

+
+
+
+ +
+
+summary(keys=['final'], config=None, indent=0)[source]
+

Summary the config information.

+
+
Parameters:
+
    +
  • keys (list[str] | str) –

    keys of configs to summary.

    +
      +
    • 'final': self.full_config

    • +
    • 'cmd': self.cmd_config

    • +
    • key in self.config_dict.keys()

    • +
    +

    Defaults to ['final'].

    +

  • +
  • indent (int) – The space indent of entire string. +Defaults to 0.

  • +
+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/datasets.html b/trojanzoo/datasets.html new file mode 100644 index 00000000..e5accd84 --- /dev/null +++ b/trojanzoo/datasets.html @@ -0,0 +1,863 @@ + + + + + + + + + + + + + + + + datasets — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

datasets

+
+
+trojanzoo.datasets.add_argument(parser, dataset_name=None, dataset=None, config=config, class_dict={})[source]
+
+
Add dataset arguments to argument parser.
+
For specific arguments implementation, see Dataset.add_argument().
+
+
+
Parameters:
+
    +
  • parser (argparse.ArgumentParser) – The parser to add arguments.

  • +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str | Dataset) – Dataset instance or dataset name +(as the alias of dataset_name).

  • +
  • config (Config) – The default parameter config, +which contains the default dataset name if not provided.

  • +
  • class_dict (dict[str, type[Dataset]]) – Map from dataset name to dataset class. +Defaults to {}.

  • +
+
+
+
+ +
+
+trojanzoo.datasets.create(dataset_name=None, dataset=None, config=config, class_dict={}, **kwargs)[source]
+
+
Create a dataset instance.
+
For arguments not included in kwargs, +use the default values in config.
+
The default value of folder_path is +'{data_dir}/{data_type}/{name}'.
+
For dataset implementation, see Dataset.
+
+
+
Parameters:
+
    +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str) – The alias of dataset_name.

  • +
  • config (Config) – The default parameter config.

  • +
  • class_dict (dict[str, type[Dataset]]) – Map from dataset name to dataset class. +Defaults to {}.

  • +
  • **kwargs – Keyword arguments +passed to dataset init method.

  • +
+
+
Returns:
+

Dataset – Dataset instance.

+
+
+
+ +
+
+class trojanzoo.datasets.Dataset(batch_size=100, valid_batch_size=100, folder_path=None, download=False, split_ratio=0.8, num_workers=4, loss_weights=False, **kwargs)[source]
+
+
An abstract class representing a dataset.
+ +
+
+

Note

+

This is the implementation of dataset. +For users, please use create() instead, which is more user-friendly.

+
+
+
Parameters:
+
    +
  • batch_size (int) – Batch size of training set +(negative number means batch size for each gpu). +Defaults to 100.

  • +
  • valid_batch_size (int) – Batch size of validation set. +Defaults to 100.

  • +
  • folder_path (str) –

    Folder path to store dataset. +Defaults to None.

    +
    +

    Note

    +

    folder_path is usually +'{data_dir}/{data_type}/{name}', +which is claimed as the default value of create().

    +
    +

  • +
  • download (bool) – Download dataset if not exist. Defaults to False.

  • +
  • split_ratio (float) –

    +
    Split training set for training and validation +if valid_set is False.
    +
    The ratio stands for +# training subset# total training set\frac{\text{\# training\ subset}}{\text{\# total\ training\ set}}.
    +
    Defaults to 0.8.
    +
    +

  • +
  • num_workers (int) – Used in get_dataloader(). +Defaults to 4.

  • +
  • loss_weights (bool | np.ndarray | torch.Tensor) –

    +
    The loss weights w.r.t. each class.
    +
    if numpy.ndarray or torch.Tensor, +directly set as loss_weights (cpu tensor).
    +
    if True, set loss_weights as get_loss_weights();
    +
    if False, set loss_weights as None.
    +
    +

  • +
  • **kwargs – Any keyword argument (unused).

  • +
+
+
Variables:
+
    +
  • name (str) – Dataset Name. (need overriding)

  • +
  • loader (dict[str, DataLoader]) –

    +
    Preset dataloader for users at dataset initialization.
    +
    It contains 'train' and 'valid' loaders.
    +
    +

  • +
  • batch_size (int) – Batch size of training set (always positive). +Defaults to 100.

  • +
  • valid_batch_size (int) – Batch size of validation set. +Defaults to 100.

  • +
  • num_classes (int) – Number of classes. (need overriding)

  • +
  • folder_path (str) – Folder path to store dataset. +Defaults to None.

  • +
  • data_type (str) – Data type (e.g., 'image'). (need overriding)

  • +
  • label_names (list[int]) – Number of classes. (optional)

  • +
  • valid_set (bool) – Whether having a native validation set. +Defaults to True.

  • +
  • split_ratio (float) –

    +
    Split training set for training and validation +if valid_set is False.
    +
    The ratio stands for +# training subset# total training set\frac{\text{\# training\ subset}}{\text{\# total\ training\ set}}.
    +
    Defaults to 0.8.
    +
    +

  • +
  • loss_weights (torch.Tensor | None) – The loss weights w.r.t. each class.

  • +
  • num_workers (int) – Used in get_dataloader(). +Defaults to 4.

  • +
  • collate_fn (Callable | None) – Used in get_dataloader(). +Defaults to None.

  • +
+
+
+
+
+classmethod add_argument(group)[source]
+

Add dataset arguments to argument parser group. +View source to see specific arguments.

+
+

Note

+

This is the implementation of adding arguments. +The concrete dataset class may override this method to add more arguments. +For users, please use add_argument() instead, which is more user-friendly.

+
+
+ +
+
+check_files(**kwargs)[source]
+

Check if the dataset files are prepared.

+
+
Parameters:
+

**kwargs – Keyword arguments passed to get_org_dataset().

+
+
Returns:
+

bool – Whether the dataset files are prepared.

+
+
+
+ +
+
+static get_class_subset(dataset, class_list)[source]
+

Get a subset from dataset with certain classes.

+
+
Parameters:
+
+
+
Returns:
+

torch.utils.data.Subset – The subset with labels in class_list.

+
+
Example:
+
>>> from trojanzoo.utils.data import TensorListDataset
+>>> from trojanzoo.utils.data import get_class_subset
+>>> import torch
+>>>
+>>> data = torch.ones(11, 3, 32, 32)
+>>> targets = list(range(11))
+>>> dataset = TensorListDataset(data, targets)
+>>> subset = get_class_subset(dataset, class_list=[2, 3])
+>>> len(subset)
+2
+
+
+
+
+
+

See also

+

The implementation is in +trojanzoo.utils.data.get_class_subset().

+
+
+ +
+
+get_data(data, **kwargs)[source]
+

Process data. Defaults to directly return data.

+
+
Parameters:
+
    +
  • data (Any) – Unprocessed data.

  • +
  • **kwargs – Keyword arguments to process data.

  • +
+
+
Returns:
+

Any – Processed data.

+
+
+
+ +
+
+get_dataloader(mode=None, dataset=None, batch_size=None, shuffle=None, num_workers=None, pin_memory=True, drop_last=False, collate_fn=None, **kwargs)[source]
+

Get dataloader. Call get_dataset() if dataset is not provided.

+
+
Parameters:
+
    +
  • mode (str) – Dataset mode (e.g., 'train' or 'valid').

  • +
  • dataset (torch.utils.data.Dataset) – The pytorch dataset.

  • +
  • batch_size (int) – Defaults to self.batch_size for 'train' mode +and self.valid_batch_size for 'valid' mode.

  • +
  • shuffle (bool) – Whether to shuffle. +Defaults to True for 'train' mode +and False for 'valid' mode.

  • +
  • num_workers (int) – Number of workers for dataloader. +Defaults to self.num_workers.

  • +
  • pin_memory (bool) – Whether to use pin memory. +Defaults to True if there is any GPU available.

  • +
  • drop_last (bool) – Whether drop the last batch if not full size. +Defaults to False.

  • +
  • collate_fn (Callable) – Passed to torch.utils.data.DataLoader.

  • +
  • **kwargs – Keyword arguments passed to get_dataset() +if dataset is not provided.

  • +
+
+
Returns:
+

torch.utils.data.DataLoader – The pytorch dataloader.

+
+
+
+ +
+
+get_dataset(mode=None, seed=None, class_list=None, **kwargs)[source]
+

Get dataset. Call split_dataset() to split the training set +if valid_set is False.

+
+
Parameters:
+
    +
  • mode (str) – Dataset mode (e.g., 'train' or 'valid').

  • +
  • seed (int) – The random seed to split dataset +using numpy.random.shuffle. +Defaults to env['data_seed'].

  • +
  • class_list (int | list[int]) – The class list to pick. Defaults to None.

  • +
  • **kwargs – Keyword arguments passed to get_org_dataset().

  • +
+
+
Returns:
+

torch.utils.data.Dataset – The original dataset.

+
+
+
+ +
+
+get_loss_weights(file_path=None, verbose=True)[source]
+

Calculate loss_weights as reciprocal of data size of each class +(to mitigate data imbalance).

+
+
Parameters:
+
    +
  • file_path (str) –

    +
    The file path of saved weights file.
    +
    If exist, just load the file and return;
    +
    else, calculate the weights, save and return.
    +
    Defaults to {folder_path}/loss_weights.npy
    +
    +

  • +
  • verbose (bool) – Whether to print verbose information. +Defaults to True.

  • +
+
+
Returns:
+

torch.Tensor – The tensor of loss weights w.r.t. each class.

+
+
+
+ +
+
+get_org_dataset(mode, **kwargs)[source]
+

Get original dataset that is not splitted.

+
+

Note

+

This is a wrapper and the specific implementation +is in _get_org_dataset(), which needs overriding.

+
+
+
Parameters:
+
    +
  • mode (str) – Dataset mode (e.g., 'train' or 'valid').

  • +
  • transform (Callable) – The transform applied on dataset. +Defaults to get_transform().

  • +
  • **kwargs – Keyword arguments passed to _get_org_dataset().

  • +
+
+
Returns:
+

torch.utils.data.Dataset – The original dataset.

+
+
+
+

See also

+

get_dataset()

+
+
+ +
+
+abstract get_transform(mode)[source]
+

Get dataset transform for mode.

+
+
Parameters:
+

mode (str) – Dataset mode (e.g., 'train' or 'valid').

+
+
Returns:
+

~collections.abc.Callable – A callable transform.

+
+
+
+ +
+
+initialize(*args, **kwargs)[source]
+

Initialize the dataset (download and extract) if it’s not prepared yet +(need overriding).

+
+ +
+
+static split_dataset(dataset, length=None, percent=None, shuffle=True, seed=None)[source]
+

Split a dataset into two subsets.

+
+
Parameters:
+
    +
  • dataset (torch.utils.data.Dataset) – The dataset to split.

  • +
  • length (int) – The length of the first subset. +This argument cannot be used together with percent. +If None, use percent to calculate length instead. +Defaults to None.

  • +
  • percent (float) – The split ratio for the first subset. +This argument cannot be used together with length. +length = percent * len(dataset). +Defaults to None.

  • +
  • shuffle (bool) – Whether to shuffle the dataset. +Defaults to True.

  • +
  • seed (bool) – The random seed to split dataset +using numpy.random.shuffle. +Defaults to env['data_seed'].

  • +
+
+
Returns:
+

(torch.utils.data.Subset, torch.utils.data.Subset) – The two splitted subsets.

+
+
Example:
+
>>> from trojanzoo.utils.data import TensorListDataset
+>>> from trojanzoo.datasets import Dataset
+>>> import torch
+>>>
+>>> data = torch.ones(11, 3, 32, 32)
+>>> targets = list(range(11))
+>>> dataset = TensorListDataset(data, targets)
+>>> set1, set2 = Dataset.split_dataset(dataset, length=3)
+>>> len(set1), len(set2)
+(3, 8)
+>>> set3, set4 = split_dataset(dataset, percent=0.5)
+>>> len(set3), len(set4)
+(5, 6)
+
+
+
+
+
+

See also

+

The implementation is in +trojanzoo.utils.data.split_dataset(). +The difference is that this method will set seed +as env['data_seed'] when it is None.

+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/defenses.html b/trojanzoo/defenses.html new file mode 100644 index 00000000..53ac4025 --- /dev/null +++ b/trojanzoo/defenses.html @@ -0,0 +1,552 @@ + + + + + + + + + + + + + + + + defenses — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

defenses

+
+
+trojanzoo.defenses.add_argument(parser, defense_name=None, defense=None, class_dict={})[source]
+
+
Add defense arguments to argument parser.
+
For specific arguments implementation, see Defense.add_argument().
+
+
+
Parameters:
+
    +
  • parser (argparse.ArgumentParser) – The parser to add arguments.

  • +
  • defense_name (str) – The defense name.

  • +
  • defense (str | Defense) – The defense instance or defense name +(as the alias of defense_name).

  • +
  • class_dict (dict[str, type[Defense]]) – Map from defense name to defense class. +Defaults to {}.

  • +
+
+
Returns:
+

argparse._ArgumentGroup – The argument group.

+
+
+
+ +
+
+trojanzoo.defenses.create(defense_name=None, defense=None, folder_path=None, dataset_name=None, dataset=None, model_name=None, model=None, config=config, class_dict={}, **kwargs)[source]
+
+
Create a defense instance.
+
For arguments not included in kwargs, +use the default values in config.
+
The default value of folder_path is +'{defense_dir}/{dataset.data_type}/{dataset.name}/{model.name}/{defense.name}'.
+
For defense implementation, see Defense.
+
+
+
Parameters:
+
    +
  • defense_name (str) – The defense name.

  • +
  • defense (str | Defense) – The defense instance or defense name +(as the alias of defense_name).

  • +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str | trojanzoo.datasets.Dataset) – Dataset instance or dataset name +(as the alias of dataset_name).

  • +
  • model_name (str) – The model name.

  • +
  • model (str | Model) – The model instance or model name +(as the alias of model_name).

  • +
  • config (Config) – The default parameter config.

  • +
  • class_dict (dict[str, type[Defense]]) – Map from defense name to defense class. +Defaults to {}.

  • +
  • **kwargs – The keyword arguments +passed to defense init method.

  • +
+
+
Returns:
+

Defense – The defense instance.

+
+
+
+ +
+
+class trojanzoo.defenses.Defense(attack=None, **kwargs)[source]
+
+
An abstract class representing a defense.
+ +
+
+

Note

+

This is the implementation of defense. +For users, please use create() instead, which is more user-friendly.

+
+
+
Variables:
+

attack (trojanzoo.attacks.Attack | None) – The attack instance.

+
+
+
+
+classmethod add_argument(group)[source]
+

Add defense arguments to argument parser group. +View source to see specific arguments.

+
+

Note

+

This is the implementation of adding arguments. +The concrete defense class may override this method to add more arguments. +For users, please use add_argument() instead, which is more user-friendly.

+
+
+ +
+
+abstract detect(*args, **kwargs)[source]
+

Main detect method (need overriding).

+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/environ.html b/trojanzoo/environ.html new file mode 100644 index 00000000..139bc430 --- /dev/null +++ b/trojanzoo/environ.html @@ -0,0 +1,554 @@ + + + + + + + + + + + + + + + + environ — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

environ

+
+
+trojanzoo.environ.add_argument(parser)[source]
+
+
Add environ arguments to argument parser.
+
For specific arguments implementation, see Env.add_argument().
+
+
+
Parameters:
+

parser (argparse.ArgumentParser) – The parser to add arguments.

+
+
Returns:
+

argparse._ArgumentGroup – The argument group.

+
+
+
+ +
+
+trojanzoo.environ.create(cmd_config_path=None, dataset_name=None, dataset=None, seed=None, data_seed=None, cudnn_benchmark=None, config=config, cache_threshold=None, verbose=None, color=None, device=None, tqdm=None, **kwargs)[source]
+
+
Load env values from config and command line.
+
+
+
Parameters:
+
    +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str | trojanzoo.datasets.Dataset) – Dataset instance +(required for model_ema) +or dataset name +(as the alias of dataset_name).

  • +
  • model (trojanzoo.models.Model) – Model instance.

  • +
  • config (Config) – The default parameter config.

  • +
  • **kwargs – The keyword arguments in keys of +['optim_args', 'train_args', 'writer_args'].

  • +
+
+
Returns:
+

Env – The env instance.

+
+
+
+ +
+
+class trojanzoo.environ.Env(*args, device='auto', **kwargs)[source]
+

The dict-like environment class that inherits trojanzoo.utils.module.Param. +It should be singleton in most cases.

+
+

Warning

+

There is already an environ instance trojanzoo.environ.env. +call create() to set its value.

+

NEVER call the class init method to create a new instance +(unless you know what you’re doing).

+
+
+
Parameters:
+

device (str | device) –

Defaults to 'auto'.

+
    +
  • 'auto' (use gpu if available)

  • +
  • 'cpu'

  • +
  • 'gpu' | 'cuda'

  • +
+

+
+
Variables:
+
    +
  • color (bool) – Whether to show colorful outputs in console +using ASNI escape characters. +Defaults to False.

  • +
  • num_gpus (int) – Number of available GPUs.

  • +
  • tqdm (bool) – Whether to use tqdm.tqdm to show progress bar. +Defaults to False.

  • +
  • verbose (int) – The output level. Defaults to 0.

  • +
  • cudnn_benchmark (bool) – Whether to use torch.backends.cudnn.benchmark +to accelerate without deterministic. +Defaults to False.

  • +
  • cache_threshold (float) – the threshold (MB) to call torch.cuda.empty_cache. +Defaults to None (never).

  • +
  • seed (int) – The random seed for numpy, torch and cuda.

  • +
  • data_seed (int) – Seed to process data +(e.g., trojanzoo.datasets.Dataset.split_dataset())

  • +
  • device (device) – The default device to store tensors.

  • +
  • world_size (int) – Number of distributed machines. Defaults to 1.

  • +
+
+
+
+
+classmethod add_argument(group)[source]
+

Add environ arguments to argument parser group. +View source to see specific arguments.

+
+

Note

+

This is the implementation of adding arguments. +For users, please use add_argument() instead, which is more user-friendly.

+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/index.html b/trojanzoo/index.html new file mode 100644 index 00000000..766c869e --- /dev/null +++ b/trojanzoo/index.html @@ -0,0 +1,466 @@ + + + + + + + + + + + + + + + + trojanzoo — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+ + +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/models.html b/trojanzoo/models.html new file mode 100644 index 00000000..37af4c83 --- /dev/null +++ b/trojanzoo/models.html @@ -0,0 +1,1571 @@ + + + + + + + + + + + + + + + + models — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

models

+
+
+trojanzoo.models.add_argument(parser, model_name=None, model=None, config=config, class_dict={})[source]
+
+
Add model arguments to argument parser.
+
For specific arguments implementation, see Model.add_argument().
+
+
+
Parameters:
+
    +
  • parser (argparse.ArgumentParser) – The parser to add arguments.

  • +
  • model_name (str) – The model name.

  • +
  • model (str | Model) – The model instance or model name +(as the alias of model_name).

  • +
  • config (Config) – The default parameter config, +which contains the default dataset and model name if not provided.

  • +
  • class_dict (dict[str, type[Model]]) – Map from model name to model class. +Defaults to {}.

  • +
+
+
Returns:
+

argparse._ArgumentGroup – The argument group.

+
+
+
+ +
+
+trojanzoo.models.create(model_name=None, model=None, dataset_name=None, dataset=None, config=config, class_dict={}, **kwargs)[source]
+
+
Create a model instance.
+
For arguments not included in kwargs, +use the default values in config.
+
The default value of folder_path is +'{model_dir}/{dataset.data_type}/{dataset.name}'.
+
For model implementation, see Model.
+
+
+
Parameters:
+
    +
  • model_name (str) – The model name.

  • +
  • model (str | Model) – The model instance or model name +(as the alias of model_name).

  • +
  • dataset_name (str) – The dataset name.

  • +
  • dataset (str | trojanzoo.datasets.Dataset) – Dataset instance or dataset name +(as the alias of dataset_name).

  • +
  • config (Config) – The default parameter config.

  • +
  • class_dict (dict[str, type[Model]]) – Map from model name to model class. +Defaults to {}.

  • +
  • **kwargs – The keyword arguments +passed to model init method.

  • +
+
+
Returns:
+

Model – The model instance.

+
+
+
+ +
+
+trojanzoo.models.output_available_models(class_dict={}, indent=0)[source]
+

Output all available model names.

+
+
Parameters:
+
    +
  • class_dict (dict[str, type[Model]]) – Map from model name to model class. +Defaults to {}.

  • +
  • indent (int) – The space indent for the entire string. +Defaults to 0.

  • +
+
+
+
+ +
+
+class trojanzoo.models.Model(name='model', suffix=None, model=_Model, dataset=None, num_classes=None, folder_path=None, official=False, pretrained=False, randomized_smooth=False, rs_sigma=0.01, rs_n=100, **kwargs)[source]
+
+
A general model wrapper class, which should be the most common interface for users.
+ +
+
+
Parameters:
+
    +
  • name (str) – Name of model.

  • +
  • suffix (str) –

    +
    Suffix of local model weights file (e.g., '_adv_train'). +Defaults to empty string ''.
    +
    The location of local pretrained weights is +'{folder_path}/{self.name}{self.suffix}.pth'
    +
    +

  • +
  • model (type[_Model] | _Model) – Type of model or a specific model instance.

  • +
  • dataset (trojanzoo.datasets.Dataset | None) – Corresponding dataset (optional). +Defaults to None.

  • +
  • num_classes (int | None) – Number of classes. +If it’s None, fetch the value from dataset. +Defaults to None.

  • +
  • folder_path (str) –

    Folder path to save model weights. +Defaults to None.

    +
    +

    Note

    +

    folder_path is usually +'{model_dir}/{dataset.data_type}/{dataset.name}', +which is claimed as the default value of create().

    +
    +

  • +
  • official (bool) – Whether to use official pretrained weights. +Defaults to False.

  • +
  • pretrained (bool) – Whether to use local pretrained weights +from '{folder_path}/{self.name}{self.suffix}.pth' +Defaults to False.

  • +
  • randomized_smooth (bool) – Whether to use randomized smoothing. +Defaults to False.

  • +
  • rs_sigma (float) – Randomized smoothing sampling std σ\sigma. +Defaults to 0.01.

  • +
  • rs_n (int) – Randomized smoothing sampling number. Defaults to 100.

  • +
+
+
Variables:
+
    +
  • available_models (set[str]) – The list of available model names.

  • +
  • weights (WeightsEnum) – The pretrained weights to use.

  • +
  • name (str) – Name of model.

  • +
  • suffix (str) –

    +
    Suffix of local model weights file (e.g., '_adv_train'). +Defaults to empty string ''.
    +
    The location of local pretrained weights is +'{folder_path}/{self.name}{self.suffix}.pth'
    +
    +

  • +
  • _model (_Model) – torch.nn.Module model instance.

  • +
  • model (torch.nn.DataParallel | _Model) – Parallel version of _model if there is more than 1 GPU available. +Generated by get_parallel_model().

  • +
  • dataset (trojanzoo.datasets.Dataset | None) – Corresponding dataset (optional). +Defaults to None.

  • +
  • num_classes (int | None) – Number of classes. +If it’s None, fetch the value from dataset. +Defaults to None.

  • +
  • folder_path (str) – Folder path to save model weights. +Defaults to None.

  • +
  • randomized_smooth (bool) – Whether to use randomized smoothing. +Defaults to False.

  • +
  • rs_sigma (float) – Randomized smoothing sampling std σ\sigma.

  • +
  • rs_n (int) – Randomized smoothing sampling number. Defaults to 100.

  • +
  • criterion (Callable) – The criterion used to calculate loss().

  • +
  • criterion_noreduction (Callable) – The criterion used to calculate loss() +when reduction='none'.

  • +
  • softmax (torch.nn.Module) – torch.nn.Softmax (dim=1). +Used in get_prob().

  • +
+
+
+
+
+_train(epochs, optimizer, module=None, num_classes=None, lr_scheduler=None, lr_warmup_epochs=0, model_ema=None, model_ema_steps=32, grad_clip=None, pre_conditioner=None, print_prefix='Train', start_epoch=0, resume=0, validate_interval=10, save=False, amp=False, loader_train=None, loader_valid=None, epoch_fn=None, get_data_fn=None, loss_fn=None, after_loss_fn=None, validate_fn=None, save_fn=None, file_path=None, folder_path=None, suffix=None, writer=None, main_tag='train', tag='', metric_fn=None, verbose=True, indent=0, **kwargs)[source]
+

Train the model

+
+ +
+
+_validate(module=None, num_classes=None, loader=None, print_prefix='Validate', indent=0, verbose=True, get_data_fn=None, loss_fn=None, writer=None, main_tag='valid', tag='', _epoch=None, metric_fn=None, **kwargs)[source]
+

Evaluate the model.

+
+
Returns:
+

(float, float) – Accuracy and loss.

+
+
+
+ +
+
+accuracy(_output, _label, topk=(1, 5), **kwargs)[source]
+

Computes the accuracy over the k top predictions +for the specified values of k.

+
+
Parameters:
+
+
+
Returns:
+

dict[str, float] – Top-k accuracies.

+
+
+
+

Note

+

The implementation is in trojanzoo.utils.model.accuracy().

+
+
+ +
+
+activate_params(params=[])[source]
+

Set requires_grad=True for selected params of module. +All other params are frozen.

+
+
Parameters:
+

params (Iterator[torch.nn.parameter.Parameter]) – The parameters to requires_grad. +Defaults to [].

+
+
+
+ +
+
+static add_argument(group)[source]
+

Add model arguments to argument parser group. +View source to see specific arguments.

+
+

Note

+

This is the implementation of adding arguments. +The concrete model class may override this method to add more arguments. +For users, please use add_argument() instead, which is more user-friendly.

+
+
+ +
+
+apply(fn)[source]
+

Applies fn recursively to every submodule (as returned by .children()) +as well as self. Typical use includes initializing the parameters of a model

+
+

See also

+

torch.nn.Module.apply.

+
+
+ +
+
+children()[source]
+

Returns an iterator over immediate children modules.

+ +
+ +
+
+cpu()[source]
+

Moves all model parameters and buffers to the CPU.

+
+

See also

+

torch.nn.Module.cpu.

+
+
+ +
+
+cuda(device=None)[source]
+

Moves all model parameters and buffers to the GPU.

+
+

See also

+

torch.nn.Module.cuda.

+
+
+ +
+
+define_criterion(**kwargs)[source]
+

Define criterion to calculate loss. +Defaults to use torch.nn.CrossEntropyLoss.

+
+
Parameters:
+
+
+
+
+ +
+
+define_optimizer(parameters='full', OptimType='SGD', lr=0.1, momentum=0.0, weight_decay=0.0, lr_scheduler=False, lr_scheduler_type='CosineAnnealingLR', lr_step_size=30, lr_gamma=0.1, epochs=None, lr_min=0.0, lr_warmup_epochs=0, lr_warmup_method='constant', lr_warmup_decay=0.01, **kwargs)[source]
+

Define optimizer and lr_scheduler.

+
+
Parameters:
+
    +
  • parameters (str | Iterable[torch.nn.parameter.Parameter]) –

    The parameters to optimize while other model parameters are frozen. +If str, set parameters as:

    +
    +
      +
    • 'features': self._model.features

    • +
    • 'classifier' | 'partial': self._model.classifier

    • +
    • 'full': self._model

    • +
    +
    +

    Defaults to 'full'.

    +

  • +
  • OptimType (str | type[Optimizer]) – The optimizer type. +If str, load from module torch.optim. +Defaults to 'SGD'.

  • +
  • lr (float) – The learning rate of optimizer. Defaults to 0.1.

  • +
  • momentum (float) – The momentum of optimizer. Defaults to 0.0.

  • +
  • weight_decay (float) – The momentum of optimizer. Defaults to 0.0.

  • +
  • lr_scheduler (bool) – Whether to enable lr_scheduler. Defaults to False.

  • +
  • lr_scheduler_type (str) –

    The type of lr_scheduler. +Defaults to 'CosineAnnealingLR'.

    +

    Available lr_scheduler types (use string rather than type):

    +
    +
    +

  • +
  • lr_step_size (int) – step_size for torch.optim.lr_scheduler.StepLR. +Defaults to 30.

  • +
  • lr_gamma (float) – gamma for torch.optim.lr_scheduler.StepLR +or torch.optim.lr_scheduler.ExponentialLR. +Defaults to 0.1.

  • +
  • epochs (int) – Total training epochs. +epochs - lr_warmup_epochs is passed as T_max +to any:torch.optim.lr_scheduler.CosineAnnealingLR. +Defaults to None.

  • +
  • lr_min (float) – The minimum of learning rate. +It’s passed as eta_min +to any:torch.optim.lr_scheduler.CosineAnnealingLR. +Defaults to 0.0.

  • +
  • lr_warmup_epochs (int) – Learning rate warmup epochs. +Passed as total_iters to lr_scheduler. +Defaults to 0.

  • +
  • lr_warmup_method (str) – Learning rate warmup methods. +Choose from ['constant', 'linear']. +Defaults to 'constant'.

  • +
  • lr_warmup_decay (float) – Learning rate warmup decay factor. +Passed as factor (start_factor) to lr_scheduler. +Defaults to 0.01.

  • +
  • **kwargs – Keyword arguments passed to optimizer init method.

  • +
+
+
Returns:
+

(torch.optim.Optimizer, torch.optim.lr_scheduler._LRScheduler) – The tuple of optimizer and lr_scheduler.

+
+
+
+ +
+
+eval()[source]
+

Sets the module in evaluation mode.

+
+

See also

+

torch.nn.Module.eval.

+
+
+ +
+
+generate_target(_input, idx=1, same=False)[source]
+
+
Generate target labels of a batched input based on

the classification confidence ranking index.

+
+
+
+
Parameters:
+
    +
  • _input (torch.Tensor) – The input tensor.

  • +
  • idx (int) – The classification confidence +rank of target class. +Defaults to 1.

  • +
  • same (bool) – Generate the same label +for all samples using mod. +Defaults to False.

  • +
+
+
Returns:
+

torch.Tensor – The generated target label with shape (N).

+
+
+
+

See also

+

The implementation is in +trojanzoo.utils.model.generate_target().

+
+
+ +
+
+get_all_layer(_input, layer_input='input', depth=-1, prefix='', use_filter=True, non_leaf=False, seq_only=True, verbose=0)[source]
+

Get all intermediate layer outputs of +_input from any intermediate layer.

+
+
Parameters:
+
    +
  • _input (torch.Tensor) – The batched input tensor +from layer_input.

  • +
  • layer_input (str) – The intermediate layer name of _input. +Defaults to 'input'.

  • +
  • depth (int) – The traverse depth. +Defaults to -1 (\infty).

  • +
  • prefix (str) – The prefix string to all elements. +Defaults to empty string ''.

  • +
  • use_filter (bool) –

    Whether to filter out certain layer types.

    + +

  • +
  • non_leaf (bool) – Whether to include non-leaf nodes. +Defaults to False.

  • +
  • seq_only (bool) – Whether to only traverse children +of torch.nn.Sequential. +If False, will traverse children of all torch.nn.Module. +Defaults to False.

  • +
  • verbose (bool) –

    The output level to show information +including layer name, output shape and module information. +Setting it larger than 0 will enable the output. +Different integer values stands for different module information. +Defaults to 0.

    +
      +
    • 0: No output

    • +
    • 1: Show layer class name.

    • +
    • 2: Show layer string (first line).

    • +
    • 3: Show layer string (full).

    • +
    +

  • +
+
+
Returns:
+

dict[str, torch.Tensor] – The dict of all layer outputs.

+
+
+
+

See also

+

The implementation is in +trojanzoo.utils.model.get_all_layer().

+
+
+ +
+
+get_class(_input, **kwargs)[source]
+

Get the class classification result of _input +(using torch.argmax).

+
+
Parameters:
+
    +
  • _input (torch.Tensor) – The batched input tensor +passed to _Model.get_logits().

  • +
  • **kwargs – Keyword arguments passed to get_logits().

  • +
+
+
Returns:
+

torch.Tensor – The classes tensor with shape (N).

+
+
+
+ +
+
+get_data(data, **kwargs)[source]
+

Process data. Defaults to be self.dataset.get_data. +If self.dataset is None, return data directly.

+
+
Parameters:
+
    +
  • data (Any) – Unprocessed data.

  • +
  • **kwargs – Keyword arguments passed to +self.dataset.get_data().

  • +
+
+
Returns:
+

Any – Processed data.

+
+
+
+ +
+
+get_final_fm(_input, **kwargs)[source]
+

Get the final feature map of _input, +which is the output of self.flatten +and input of self.classifier. +Call _Model.get_final_fm().

+
+
Parameters:
+
+
+
Returns:
+

torch.Tensor – The feature tensor with shape (N, dim).

+
+
+
+ +
+
+get_fm(_input, **kwargs)[source]
+

Get the feature map of _input, +which is the output of self.features +and input of self.pool. +Call _Model.get_fm().

+
+
Parameters:
+
+
+
Returns:
+

torch.Tensor – The feature tensor with shape (N, C', H', W').

+
+
+
+ +
+
+get_layer(_input, layer_output='classifier', layer_input='input', seq_only=True)[source]
+

Get one certain intermediate layer output +of _input from any intermediate layer.

+
+
Parameters:
+
    +
  • _input (torch.Tensor) – The batched input tensor +from layer_input.

  • +
  • layer_output (str) – The intermediate output layer name. +Defaults to 'classifier'.

  • +
  • layer_input (str) – The intermediate layer name of _input. +Defaults to 'input'.

  • +
  • seq_only (bool) – Whether to only traverse children +of torch.nn.Sequential. +If False, will traverse children of all torch.nn.Module. +Defaults to True.

  • +
+
+
Returns:
+

torch.Tensor – The output of layer layer_output.

+
+
+
+

See also

+

The implementation is in +trojanzoo.utils.model.get_layer().

+
+
+ +
+
+get_layer_name(depth=-1, prefix='', use_filter=True, non_leaf=False, seq_only=False)[source]
+

Get layer names of model instance.

+
+
Parameters:
+
+
+
Returns:
+

list[str] – The list of all layer names.

+
+
+
+

See also

+

The implementation is in +trojanzoo.utils.model.get_layer_name().

+
+
+ +
+
+get_logits(_input, parallel=False, randomized_smooth=None, rs_sigma=None, rs_n=None, **kwargs)[source]
+

Get logits of _input.

+
+

Note

+

Users should use model as Callable function +rather than call this method directly, +because __call__ supports torch.cuda.amp.

+
+
+
Parameters:
+
    +
  • _input (torch.Tensor) – The batched input tensor.

  • +
  • parallel (bool) – Whether to use parallel model +self.model rather than self._model. +Defautls to False.

  • +
  • randomized_smooth (bool | None) – Whether to use randomized smoothing. +If it’s None, use self.randmized_smooth instead. +Defaults to None.

  • +
  • rs_sigma (float | None) – Randomized smoothing sampling std σ\sigma. +If it’s None, use self.rs_sigma instead. +Defaults to None.

  • +
  • rs_n (int) – Randomized smoothing sampling number. +If it’s None, use self.rs_n instead. +Defaults to None.

  • +
  • **kwargs – Keyword arguments passed to forward().

  • +
+
+
Returns:
+

torch.Tensor – The logit tensor with shape (N, C).

+
+
+
+ +
+
+get_official_weights(weights=None, progress=True, map_location='cpu', **kwargs)[source]
+

Get official model weights from weights.

+
+
Parameters:
+
+
+
Returns:
+

OrderedDict[str, torch.Tensor] – The model weights OrderedDict.

+
+
+
+ +
+
+static get_parallel_model(_model)[source]
+

Get the parallel model if there are more than 1 GPU avaiable.

+
+

Warning

+

torch.nn.DataParallel would be deprecated according to +https://github.com/pytorch/pytorch/issues/65936. +We need to consider using +torch.nn.parallel.DistributedDataParallel instead.

+
+
+
Parameters:
+

_model (_Model) – The non-parallel model.

+
+
Returns:
+

_Model | nn.DataParallel – The parallel model if there are more than 1 GPU avaiable.

+
+
+
+ +
+
+get_prob(_input, **kwargs)[source]
+

Get the probability classification vector of _input.

+
+
Parameters:
+
    +
  • _input (torch.Tensor) – The batched input tensor +passed to _Model.get_logits().

  • +
  • **kwargs – Keyword arguments passed to get_logits().

  • +
+
+
Returns:
+

torch.Tensor – The probability tensor with shape (N, C).

+
+
+
+ +
+
+get_target_prob(_input, target, **kwargs)[source]
+

Get the probability w.r.t. target class of _input +(using torch.gather).

+
+
Parameters:
+
+
+
Returns:
+

torch.Tensor – The probability tensor with shape (N).

+
+
+
+ +
+
+load(file_path=None, folder_path=None, suffix=None, inplace=True, map_location='cpu', component='full', strict=True, verbose=False, indent=0, **kwargs)[source]
+

Load pretrained model weights.

+
+
Parameters:
+
    +
  • file_path (str | None) – The file path to load pretrained weights. +If 'official', call get_official_weights(). +Defaults to '{folder_path}/{self.name}{suffix}.pth'.

  • +
  • folder_path (str | None) – The folder path containing model checkpoint. +It is used when file_path is not provided. +Defaults to self.folder_path.

  • +
  • suffix (str | None) – The suffix string to model weights file. +Defaults to self.suffix.

  • +
  • inplace (bool) – Whether to change model parameters. +If False, will only return the dict but not change model parameters. +Defaults to True.

  • +
  • map_location (str | device | dict) –

    Passed to torch.load. +Defaults to 'cpu'.

    +
    +

    Note

    +

    The device of model parameters will still be 'cuda' +if there is any cuda available. +This argument only affects intermediate operation.

    +
    +

  • +
  • component (str) – Specify which part of the weights to load. +Choose from ['full', 'features', 'classifier']. +Defaults to 'full'.

  • +
  • strict (bool) – Passed to torch.nn.Module.load_state_dict. +Defaults to True.

  • +
  • verbose (bool) – Whether to output auxiliary information. +Defaults to False.

  • +
  • indent (int) – The indent of output auxialiary information.

  • +
  • **kwargs – Keyword arguments passed to torch.load.

  • +
+
+
Returns:
+

OrderedDict[str, torch.Tensor] – The model weights OrderedDict.

+
+
+
+ +
+
+load_state_dict(state_dict, strict=True)[source]
+

Copies parameters and buffers from state_dict +into this module and its descendants.

+ +
+ +
+
+loss(_input=None, _label=None, _output=None, reduction='mean', **kwargs)[source]
+

Calculate the loss using self.criterion +(self.criterion_noreduction).

+
+
Parameters:
+
    +
  • _input (torch.Tensor | None) – The batched input tensor. +If _output is provided, this argument will be ignored. +Defaults to None.

  • +
  • _label (torch.Tensor) – The label of the batch with shape (N).

  • +
  • _output (torch.Tensor | None) – The logits of _input. +If None, use _input to calculate logits. +Defaults to None.

  • +
  • reduction (str) – Specifies the reduction to apply to the output. +Choose from ['none', 'mean']. +Defaults to 'mean'.

  • +
  • **kwargs – Keyword arguments passed to get_logits() +if _output is not provided.

  • +
+
+
Returns:
+

torch.Tensor – A scalar loss tensor (with shape (N) if reduction='none').

+
+
+
+ +
+
+modules()[source]
+

Returns an iterator over all modules in the network.

+ +
+ +
+
+named_children()[source]
+

Returns an iterator over immediate children modules, yielding both +the name of the module as well as the module itself.

+ +
+ +
+
+named_modules(memo=None, prefix='')[source]
+

Returns an iterator over all modules in the network, yielding +both the name of the module as well as the module itself.

+ +
+ +
+
+named_parameters(prefix='', recurse=True)[source]
+

Returns an iterator over module parameters, yielding both the +name of the parameter as well as the parameter itself.

+ +
+ +
+
+parameters(recurse=True)[source]
+

Returns an iterator over module parameters.

+ +
+ +
+
+remove_misclassify(data, **kwargs)[source]
+

Remove misclassified samples in a data batch.

+
+
Parameters:
+
+
+
Returns:
+

(torch.Tensor, torch.Tensor) – The processed input and label with shape (N - k, *) and (N - k).

+
+
+
+ +
+
+requires_grad_(requires_grad=True)[source]
+

Change if autograd should record operations on parameters in this +module.

+ +
+ +
+
+save(file_path=None, folder_path=None, suffix=None, component='', _epoch=None, verbose=False, indent=0, **kwargs)[source]
+

Save pretrained model weights.

+
+
Parameters:
+
    +
  • file_path (str | None) – The file path to save pretrained weights. +Defaults to '{folder_path}/{self.name}{suffix}.pth'.

  • +
  • folder_path (str | None) – The folder path containing model checkpoint. +It is used when file_path is not provided. +Defaults to self.folder_path.

  • +
  • suffix (str | None) – The suffix string to model weights file. +Defaults to self.suffix.

  • +
  • component (str) – Specify which part of the weights to save. +Choose from ['full', 'features', 'classifier']. +Defaults to 'full'.

  • +
  • verbose (bool) – Whether to output auxiliary information. +Defaults to False.

  • +
  • indent (int) – The indent of output auxialiary information.

  • +
  • **kwargs – Keyword arguments passed to torch.save.

  • +
+
+
+
+ +
+
+state_dict(destination=None, prefix='', keep_vars=False)[source]
+

Returns a dictionary containing a whole state of the module.

+ +
+ +
+
+summary(depth=None, verbose=True, indent=0, **kwargs)[source]
+

Prints a string summary of the model instance by calling +trojanzoo.utils.module.BasicObject.summary() +and trojanzoo.utils.model.summary().

+
+
Parameters:
+
+
+
+
+ +
+
+train(mode=True)[source]
+

Sets the module in training mode.

+
+

See also

+

torch.nn.Module.train.

+
+
+ +
+
+zero_grad(set_to_none=False)[source]
+

Sets gradients of all model parameters to zero.

+ +
+ +
+ +
+
+class trojanzoo.models._Model(num_classes=None, **kwargs)[source]
+

A specific model class which inherits torch.nn.Module.

+
+
Parameters:
+
+
+
Variables:
+
+
+
+
+
+static define_classifier(num_features=[], num_classes=1000, activation=nn.ReLU, activation_inplace=True, dropout=0.0, **kwargs)[source]
+
+
Define classifier as +(Linear -> Activation -> Dropout ) * (len(num_features) - 1) -> Linear.
+
If there is only 1 linear layer, its name will be 'fc'.
+
Else, all layer names will be indexed starting from 0 +(e.g., 'fc1', 'relu1', 'dropout0').
+
+
+
Parameters:
+
    +
  • num_features (list[int]) – List of feature numbers. +Each element serves as the in_features of current layer +and out_features of preceding layer. +Defaults to [].

  • +
  • num_classes (int) – The number of classes. +This serves as the out_features of last layer. +Defaults to None.

  • +
  • activation (type[torch.nn.Module]) – The type of activation layer. +Defaults to torch.nn.ReLU.

  • +
  • activation_inplace (bool) – Whether to use inplace activation. +Defaults to 'True'

  • +
  • dropout (float) – The drop out probability. +Will NOT add dropout layers if it’s 0. +Defaults to 0.0.

  • +
  • **kwargs – Any keyword argument (unused).

  • +
+
+
Returns:
+

torch.nn.Sequential – The sequential classifier.

+
+
Examples:
+
>>> from trojanzoo.models import _Model
+>>>
+>>> _Model.define_classifier(num_features=[5,4,4], num_classes=10)
+Sequential(
+    (fc1): Linear(in_features=5, out_features=4, bias=True)
+    (relu1): ReLU(inplace=True)
+    (dropout1): Dropout(p=0.5, inplace=False)
+    (fc2): Linear(in_features=4, out_features=4, bias=True)
+    (relu2): ReLU(inplace=True)
+    (dropout2): Dropout(p=0.5, inplace=False)
+    (fc3): Linear(in_features=4, out_features=10, bias=True)
+)
+
+
+
+
+
+ +
+
+static define_features(**kwargs)[source]
+

Define feature extractor.

+
+
Returns:
+

torch.nn.Identity – Identity module.

+
+
+
+ +
+
+classmethod define_preprocess(**kwargs)[source]
+

Define preprocess before feature extractor.

+
+
Returns:
+

torch.nn.Identity – Identity module.

+
+
+
+ +
+
+forward(x, **kwargs)[source]
+

x -> self.get_final_fm -> self.classifier -> return

+
+ +
+
+get_final_fm(x, **kwargs)[source]
+

x -> self.get_fm -> self.pool -> self.flatten -> return

+
+ +
+
+get_fm(x, **kwargs)[source]
+

x -> self.preprocess -> self.features -> return

+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/optim.html b/trojanzoo/optim.html new file mode 100644 index 00000000..c2d3faa7 --- /dev/null +++ b/trojanzoo/optim.html @@ -0,0 +1,592 @@ + + + + + + + + + + + + + + + + optim — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

optim

+
+
+class trojanzoo.optim.Optimizer(iteration=20, stop_threshold=None, loss_fn=None, **kwargs)[source]
+

An abstract input optimizer class that inherits +trojanzoo.utils.module.Process.

+
+
Parameters:
+
    +
  • iteration (int) – Optimization iteration. +Defaults to 20.

  • +
  • stop_threshold (float | None) – Threshold used in early stop check. +Defaults to None (no early stop).

  • +
  • loss_fn (Callable) – Loss function (it’s usually reduction='none').

  • +
  • **kwargs – Keyword Arguments passed to +trojanzoo.utils.module.Process.

  • +
+
+
+
+
+early_stop_check(*args, current_idx=None, adv_input=None, loss_values=None, loss_fn=None, stop_threshold=None, loss_kwargs={}, **kwargs)[source]
+

Early stop check using stop_threshold.

+
+
Parameters:
+
    +
  • current_idx (torch.Tensor) – The indices of adv_input need to check +(Other indices have early stopped).

  • +
  • adv_input (torch.Tensor) – The entire batched adversairl input tensor +with shape (N, *).

  • +
  • loss_values (torch.Tensor) – Batched loss tensor with shape (N). +If None, use loss_fn +and adv_input to calculate. +Defaults to None.

  • +
  • loss_fn (collections.abc.Callable | None) – Loss function (it’s usually reduction='none'). +Defaults to self.loss_fn.

  • +
  • stop_threshold (float | None) – Threshold used in early stop check. +None means using self.stop_threshold. +Defaults to self.stop_threshold.

  • +
  • loss_kwargs (dict[str, torch.Tensor]) – Keyword arguments passed to loss_fn, +which will also be selected according to current_idx.

  • +
  • *args – Any positional argument (unused).

  • +
  • **kwargs – Any keyword argument (unused).

  • +
+
+
Returns:
+

torch.Tensor – Batched torch.BoolTensor with shape (N).

+
+
+
+ +
+
+optimize(_input, *args, iteration=None, loss_fn=None, stop_threshold=None, output=None, **kwargs)[source]
+

Main optimize method.

+
+
Parameters:
+
    +
  • _input (torch.Tensor) – The batched input tensor to optimize.

  • +
  • iteration (int | None) – Optimization iteration. +Defaults to self.iteration.

  • +
  • loss_fn (Callable) – Loss function (it’s usually reduction='none'). +Defaults to self.loss_fn.

  • +
  • stop_threshold (float | None) – Threshold used in early stop check. +None means using self.stop_threshold. +Defaults to self.stop_threshold.

  • +
  • output (int | Iterable[str]) – Output level integer or output items. +If int, call get_output_int(). +Defaults to self.output.

  • +
+
+
Returns:
+

(torch.Tensor, torch.Tensor) – batched adversarial input tensor and batched optimization iterations +(-1 if not reaching self.threshold).

+
+
+
+ +
+
+output_info(*args, mode='start', _iter=0, iteration=0, output=None, indent=None, **kwargs)[source]
+

Output information.

+
+
Parameters:
+
    +
  • mode (str) – The output mode +(e.g., 'start', 'end', 'middle', 'memory'). +Should be legal strings in get_output_int(). +Defaults to 'start'.

  • +
  • _iter (int) – Current iteration. Defaults to 0.

  • +
  • iteration (int) – Total iteration. Defaults to 0.

  • +
  • output (Iterable[str]) – Output items. +Defaults to self.output.

  • +
  • indent (int) – The space indent for the entire string. +Defaults to self.indent.

  • +
  • *args – Any positional argument (unused).

  • +
  • **kwargs – Any keyword argument (unused).

  • +
+
+
+
+ +
+
+preprocess_input(*args, adv_input=None, org_input=None, **kwargs)[source]
+

Optimize input tensor for 1 iteration.

+
+
Parameters:
+
    +
  • adv_input (torch.Tensor) – The entire batched adversairl input tensor +with shape (N, *).

  • +
  • org_input (torch.Tensor) – The entire batched original input tensor +with shape (N, *).

  • +
+
+
+
+ +
+
+abstract update_input(current_idx, adv_input, org_input, *args, **kwargs)[source]
+

Optimize input tensor for 1 iteration.

+
+
Parameters:
+
    +
  • current_idx (torch.Tensor) – The indices of adv_input need to optimize +(Other indices have early stopped).

  • +
  • adv_input (torch.Tensor) – The entire batched adversairl input tensor +with shape (N, *).

  • +
  • org_input (torch.Tensor) – The entire batched original input tensor +with shape (N, *).

  • +
+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/trainer.html b/trojanzoo/trainer.html new file mode 100644 index 00000000..12d5dba5 --- /dev/null +++ b/trojanzoo/trainer.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + trainer — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

trainer

+
+
+trojanzoo.trainer.add_argument(parser, ClassType=Trainer)[source]
+
+
Add trainer arguments to argument parser.
+
For specific arguments implementation, see Trainer.add_argument().
+
+
+
Parameters:
+
+
+
Returns:
+

argparse._ArgumentGroup – The argument group.

+
+
+
+ +
+
+trojanzoo.trainer.create(dataset_name=None, dataset=None, model=None, model_ema=False, pre_conditioner=None, tensorboard=None, ClassType=Trainer, config=config, **kwargs)[source]
+
+
Create a trainer instance.
+
For arguments not included in kwargs, +use the default values in config.
+
For trainer implementation, see Trainer.
+
+
+
Parameters:
+
+
+
Returns:
+

Trainer – The trainer instance.

+
+
+
+ +
+
+class trojanzoo.trainer.Trainer(optim_args={}, train_args={}, writer_args={}, optimizer=None, lr_scheduler=None, model_ema=None, pre_conditioner=None, writer=None, **kwargs)[source]
+

A dict-like class to contain training arguments +which supports attribute-like view as well.

+

It inherits trojanzoo.utils.module.BasicObject.

+
+

Note

+

The most common usage is train(**trainer). +See keys() for details.

+
+
+
Variables:
+
+
+
+
+
+classmethod add_argument(group)[source]
+

Add trainer arguments to argument parser group. +View source to see specific arguments.

+
+

Note

+

This is the implementation of adding arguments. +For users, please use add_argument() instead, which is more user-friendly.

+
+
+ +
+
+keys()[source]
+

Keys include:

+
+
    +
  • +
    All attributes exclude
    +
    ['optim_args', 'train_args', 'writer_args']
    +
    +
  • +
  • train_args

  • +
+
+
+
Returns:
+

list[str] – The list of keys.

+
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/utils/data.html b/trojanzoo/utils/data.html new file mode 100644 index 00000000..882b3ae0 --- /dev/null +++ b/trojanzoo/utils/data.html @@ -0,0 +1,643 @@ + + + + + + + + + + + + + + + + data — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

data

+
+
+class trojanzoo.utils.data.TensorListDataset(data=None, targets=None, **kwargs)[source]
+

The dataset class that has a torch.Tensor as inputs +and list[int] as labels. +It inherits torch.utils.data.Dataset.

+
+
Parameters:
+
+
+
Example:
+
>>> import torch
+>>> from trojanzoo.utils.data import TensorListDataset
+>>>
+>>> data = torch.ones(10, 3, 32, 32)
+>>> targets = list(range(10))
+>>> dataset = TensorListDataset(data, targets)
+>>> x, y = dataset[3]
+>>> x.shape
+torch.Size([3, 32, 32])
+>>> y
+3
+
+
+
+
+
+ +
+
+trojanzoo.utils.data.dataset_to_tensor(dataset)[source]
+

Transform a torch.utils.data.Dataset to (data, targets) tensor tuple +by traversing all elements.

+
+
Parameters:
+

dataset (torch.utils.data.Dataset) – The dataset.

+
+
Returns:
+

(torch.Tensor, torch.Tensor) – The tuple of (data, targets).

+
+
Example:
+
>>> from torchvision.datasets import MNIST
+>>> import torchvision.transforms as transforms
+>>> from trojanzoo.utils.data import dataset_to_tensor
+>>>
+>>> transform = transforms.Compose([
+    transforms.PILToTensor(),
+    transforms.ConvertImageDtype(torch.float)])
+>>> dataset = MNIST('./', train=False, download=True,
+                    transform=transform)
+>>> data, targets = dataset_to_tensor(dataset)
+>>> data.shape
+torch.Size([10000, 1, 28, 28])
+>>> targets.shape
+torch.Size([10000])
+>>> targets.dtype
+torch.int64
+
+
+
+
+
+ +
+
+trojanzoo.utils.data.sample_batch(dataset, batch_size=None, idx=[])[source]
+

Sample a batch from dataset by calling

+
dataset_to_tensor()(torch.utils.data.Subset(dataset, idx))
+
+
Parameters:
+
    +
  • dataset (torch.utils.data.Dataset) – The dataset to sample.

  • +
  • batch_size (int) – The batch size to sample +when idx is None. +Defaults to None.

  • +
  • idx (Sequence[int]) – The index list of each sample in dataset. +If empty, randomly sample a batch with given batch_size. +Defaults to [].

  • +
+
+
Returns:
+

(torch.Tensor, torch.Tensor) – The tuple of sampled batch (data, targets).

+
+
Example:
+
>>> import torch
+>>> from trojanzoo.utils.data import TensorListDataset, sample_batch
+>>>
+>>> data = torch.ones(10, 3, 32, 32)
+>>> targets = list(range(10))
+>>> dataset = TensorListDataset(data, targets)
+>>> x, y = sample_batch(dataset, idx=[1, 2])
+>>> x.shape
+torch.Size([2, 3, 32, 32])
+>>> y
+tensor([1, 2])
+>>> x, y = sample_batch(dataset, batch_size=4)
+>>> y
+tensor([6, 3, 2, 5])
+
+
+
+
+
+ +
+
+trojanzoo.utils.data.split_dataset(dataset, length=None, percent=None, shuffle=True, seed=None)[source]
+

Split a dataset into two subsets.

+
+
Parameters:
+
    +
  • dataset (torch.utils.data.Dataset) – The dataset to split.

  • +
  • length (int) – The length of the first subset. +This argument cannot be used together with percent. +If None, use percent to calculate length instead. +Defaults to None.

  • +
  • percent (float) – The split ratio for the first subset. +This argument cannot be used together with length. +length = percent * len(dataset). +Defaults to None.

  • +
  • shuffle (bool) – Whether to shuffle the dataset. +Defaults to True.

  • +
  • seed (bool) – The random seed to split dataset +using numpy.random.shuffle. +Defaults to None.

  • +
+
+
Returns:
+

(torch.utils.data.Subset, torch.utils.data.Subset) – The two splitted subsets.

+
+
Example:
+
>>> import torch
+>>> from trojanzoo.utils.data import TensorListDataset, split_dataset
+>>>
+>>> data = torch.ones(11, 3, 32, 32)
+>>> targets = list(range(11))
+>>> dataset = TensorListDataset(data, targets)
+>>> set1, set2 = split_dataset(dataset, length=3)
+>>> len(set1), len(set2)
+(3, 8)
+>>> set3, set4 = split_dataset(dataset, percent=0.5)
+>>> len(set3), len(set4)
+(5, 6)
+
+
+
+
+
+

Note

+

This is the implementation of trojanzoo.datasets.Dataset.split_dataset(). +The difference is that this method will NOT set seed +as env['data_seed'] when it is None.

+
+
+ +
+
+trojanzoo.utils.data.get_class_subset(dataset, class_list)[source]
+

Get a subset from dataset with certain classes.

+
+
Parameters:
+
+
+
Returns:
+

torch.utils.data.Subset – The subset with labels in class_list.

+
+
Example:
+
>>> import torch
+>>> from trojanzoo.utils.data import get_class_subset, TensorListDataset
+>>>
+>>> data = torch.ones(11, 3, 32, 32)
+>>> targets = list(range(11))
+>>> dataset = TensorListDataset(data, targets)
+>>> subset = get_class_subset(dataset, class_list=[2, 3])
+>>> len(subset)
+2
+
+
+
+
+
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/utils/fim.html b/trojanzoo/utils/fim.html new file mode 100644 index 00000000..d2950177 --- /dev/null +++ b/trojanzoo/utils/fim.html @@ -0,0 +1,557 @@ + + + + + + + + + + + + + + + + fim — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

fim

+
+
+class trojanzoo.utils.fim.BaseKFAC(net, eps=0.1, sua=False, update_freq=1, alpha=1.0, constraint_norm=False, state_type=BaseState)[source]
+

Base K-FAC Preconditionner for Linear and Conv2d layers.

+

Compute the K-FAC of the second moment of the gradients. +It works for Linear and Conv2d layers and silently skip other layers.

+
+
Parameters:
+
    +
  • net (torch.nn.Module) – Network to precondition.

  • +
  • eps (float) – Tikhonov regularization parameter for the inverses.

  • +
  • sua (bool) – Applies SUA approximation.

  • +
  • update_freq (int) – Perform inverses every update_freq updates.

  • +
  • alpha (float) – Running average parameter (if == 1, no r. ave.).

  • +
  • constraint_norm (bool) – Scale the gradients by the squared +fisher norm.

  • +
+
+
+
+ +
+
+class trojanzoo.utils.fim.KFAC(*args, pi=False, **kwargs)[source]
+

K-FAC Preconditionner for torch.nn.Linear +and torch.nn.Conv2d layers.

+

Compute the K-FAC of the second moment of the gradients. +It works for Linear and Conv2d layers and silently skip other layers.

+ +
+
Parameters:
+
    +
  • net (torch.nn.Module) – Network to precondition.

  • +
  • pi (bool) – Computes pi correction for Tikhonov regularization.

  • +
  • eps (float) – Tikhonov regularization parameter for the inverses.

  • +
  • sua (bool) – Applies SUA approximation.

  • +
  • update_freq (int) – Perform inverses every update_freq updates.

  • +
  • alpha (float) – Running average parameter (if == 1, no r. ave.).

  • +
  • constraint_norm (bool) – Scale the gradients by the squared +fisher norm.

  • +
+
+
+
+ +
+
+class trojanzoo.utils.fim.EKFAC(net, *args, ra=False, **kwargs)[source]
+

EKFAC Preconditionner for torch.nn.Linear +and torch.nn.Conv2d layers.

+

Computes the EKFAC of the second moment of the gradients. +It works for Linear and Conv2d layers and silently skip other layers.

+
+
Parameters:
+
    +
  • net (torch.nn.Module) – Network to precondition.

  • +
  • eps (float) – Tikhonov regularization parameter for the inverses.

  • +
  • sua (bool) – Applies SUA approximation.

  • +
  • ra (bool) – Computes stats using a running average of +averaged gradients instead of using a intra minibatch estimate.

  • +
  • update_freq (int) – Perform inverses every update_freq updates.

  • +
  • alpha (float) – Running average parameter.

  • +
  • constraint_norm (bool) – Scale the gradients by the squared +fisher norm.

  • +
+
+
+
+ +
+
+class trojanzoo.utils.fim.BaseState[source]
+

A basic storage class.

+
+
Variables:
+
+
+
+
+ +
+
+class trojanzoo.utils.fim.KFACState[source]
+

A storage class for KFAC.

+
+
Variables:
+
+
+
+
+ +
+ + +
+ +
+ + +
+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/utils/index.html b/trojanzoo/utils/index.html new file mode 100644 index 00000000..89c2bf9f --- /dev/null +++ b/trojanzoo/utils/index.html @@ -0,0 +1,596 @@ + + + + + + + + + + + + + + + + utils — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

utils

+ +
+
+class trojanzoo.utils.lock.Lock[source]
+

A boolean lock class used for contextmanager. +It’s used in KFAC +to avoid auxiliary computation operations.

+
+
Example:
+
>>> from trojanzoo.utils.lock import Lock
+>>>
+>>> track = Lock()
+>>> print(bool(track))
+False
+>>> with track():
+>>>     print(bool(track))
+True
+>>> print(bool(track))
+False
+>>> track.enable()
+>>> print(bool(track))
+True
+>>> track.disable()
+>>> print(bool(track))
+False
+
+
+
+
+
+
+disable()[source]
+

Set lock boolean value as False. +It’s used together with enable() +when contextmanager is not suitable for the case.

+
+ +
+
+enable()[source]
+

Set lock boolean value as True. +It’s used together with disable() +when contextmanager is not suitable for the case.

+
+ +
+ +
+
+trojanzoo.utils.memory.empty_cache(threshold=None)[source]
+

Call torch.cuda.empty_cache to empty GPU cache when +torch.cuda.memory_cached() +> thresholdMB.

+
+
Parameters:
+

threshold (float) – The cached memory threshold (MB). +Defaults to env['cache_threshold'].

+
+
+
+ +
+
+trojanzoo.utils.memory.output_memory(device=None, full=False, indent=0, **kwargs)[source]
+

Output memory usage information.

+
+
Parameters:
+
+
+
+
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/utils/logger.html b/trojanzoo/utils/logger.html new file mode 100644 index 00000000..97dc2dd0 --- /dev/null +++ b/trojanzoo/utils/logger.html @@ -0,0 +1,721 @@ + + + + + + + + + + + + + + + + logger — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

logger

+
+
+class trojanzoo.utils.logger.SmoothedValue(name='', window_size=None, fmt='{global_avg:.3f}')[source]
+

Track a series of values and provide access to smoothed values over a +window or the global series average.

+ +
+
Parameters:
+
    +
  • name (str) – Name string.

  • +
  • window_size (int) – The maxlen of deque.

  • +
  • fmt (str) – The format pattern of str(self).

  • +
+
+
Variables:
+
    +
  • name (str) – Name string.

  • +
  • fmt (str) – The string pattern.

  • +
  • deque (deque) – The unique data series.

  • +
  • count (int) – The amount of data.

  • +
  • total (float) – The sum of all data.

  • +
  • median (float) – The median of deque.

  • +
  • avg (float) – The avg of deque.

  • +
  • global_avg (float) – totalcount\frac{\text{total}}{\text{count}}

  • +
  • max (float) – The max of deque.

  • +
  • min (float) – The min of deque.

  • +
  • last_value (float) – The last value of deque.

  • +
+
+
+
+
+reset()[source]
+

Reset deque, count and total to be empty.

+
+
Returns:
+

SmoothedValue – return self for stream usage.

+
+
+
+ +
+
+synchronize_between_processes()[source]
+
+

Warning

+

Does NOT synchronize the deque!

+
+
+ +
+
+update(value, n=1)[source]
+

Update n pieces of data with same value.

+
self.deque.append(value)
+self.total += value * n
+self.count += n
+
+
+
+
Parameters:
+
    +
  • value (float) – the value to update.

  • +
  • n (int) – the number of data with same value.

  • +
+
+
Returns:
+

SmoothedValue – return self for stream usage.

+
+
+
+ +
+
+update_list(value_list)[source]
+

Update value_list.

+
for value in value_list:
+    self.deque.append(value)
+    self.total += value
+self.count += len(value_list)
+
+
+
+
Parameters:
+

value_list (list[float]) – the value list to update.

+
+
Returns:
+

SmoothedValue – return self for stream usage.

+
+
+
+ +
+ +
+
+class trojanzoo.utils.logger.MetricLogger(delimiter='', meter_length=20, tqdm=None, indent=0, **kwargs)[source]
+
+
+
Parameters:
+
    +
  • delimiter (str) – The delimiter to join different meter strings. +Defaults to ''.

  • +
  • meter_length (int) – The minimum length for each meter. +Defaults to 20.

  • +
  • tqdm (bool) – Whether to use tqdm to show iteration information. +Defaults to env['tqdm'].

  • +
  • indent (int) – The space indent for the entire string. +Defaults to 0.

  • +
+
+
Variables:
+
+
+
+
+
+create_meters(**kwargs)[source]
+

Create meters with specific fmt in self.meters.

+

self.meters[meter_name] = SmoothedValue(fmt=fmt)

+
+
Parameters:
+

**kwargs(meter_name: fmt)

+
+
Returns:
+

MetricLogger – return self for stream usage.

+
+
+
+ +
+
+get_str(cut_too_long=True, strip=True, **kwargs)[source]
+

Generate formatted string based on keyword arguments.

+

key: value with max length to be self.meter_length. +The key string is green when env['color'] == True.

+
+
Parameters:
+
    +
  • cut_too_long (bool) – Whether to cut too long values to first 5 characters. +Defaults to True.

  • +
  • strip (bool) – Whether to strip trailing whitespaces. +Defaults to True.

  • +
  • **kwargs – Keyword arguments to generate string.

  • +
+
+
+
+ +
+
+log_every(iterable, header='', tqdm=None, tqdm_header='Iter', indent=None, verbose=None)[source]
+

Wrap an collections.abc.Iterable with formatted outputs.

+
    +
  • Middle Output: +{tqdm_header}: [ current / total ] str(self) {memory} {iter_time} {data_time} {time}<{remaining}

  • +
  • Final Output +{header} str(self) {memory} {iter_time} {data_time} {total_time}

  • +
+
+
Parameters:
+
    +
  • iterable (Iterable) – The raw iterator.

  • +
  • header (str) – The header string for final output. +Defaults to ''.

  • +
  • tqdm (bool) – Whether to use tqdm to show iteration information. +Defaults to self.tqdm.

  • +
  • tqdm_header (str) – The header string for middle output. +Defaults to 'Iter'.

  • +
  • indent (int) – The space indent for the entire string. +if None, use self.indent. +Defaults to None.

  • +
  • verbose (int) – The verbose level of output information. +Defaults to env[verbose]

  • +
+
+
Example:
+
+
+
+
+ +
+
+reset()[source]
+

Reset meter in self.meters by calling SmoothedValue.reset().

+
+
Returns:
+

MetricLogger – return self for stream usage.

+
+
+
+ +
+
+update(n=1, **kwargs)[source]
+

Update values to self.meters by calling SmoothedValue.update().

+

self.meters[meter_name].update(float(value), n=n)

+
+
Parameters:
+
    +
  • n (int) – the number of data with same value.

  • +
  • **kwargs{meter_name: value}.

  • +
+
+
Returns:
+

MetricLogger – return self for stream usage.

+
+
+
+ +
+
+update_list(**kwargs)[source]
+

Update values to self.meters by calling SmoothedValue.update_list().

+

self.meters[meter_name].update_list(value_list)

+
+
Parameters:
+

**kwargs{meter_name: value_list}.

+
+
Returns:
+

MetricLogger – return self for stream usage.

+
+
+
+ +
+ +
+
+class trojanzoo.utils.logger.AverageMeter(name, fmt=':f')[source]
+

Computes and stores the average and current value.

+ +
+

Note

+

It is recommended to use SmoothedValue instead.

+
+
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/utils/model.html b/trojanzoo/utils/model.html new file mode 100644 index 00000000..4199f18d --- /dev/null +++ b/trojanzoo/utils/model.html @@ -0,0 +1,863 @@ + + + + + + + + + + + + + + + + model — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

model

+
+
+trojanzoo.utils.model.init_weights(m, filter_list=[])[source]
+

Traverse module m to intialize weights of all submodules +except for those in filter_list.

+

Module parameters are reset by calling module.reset_parameters().

+
+

Note

+

An alternative implementation is to call m.apply(init_weights) +so that this method could be non-recursive and avoid traverse.

+
+
+
Parameters:
+
    +
  • m (torch.nn.Module) – Module to initialize.

  • +
  • filter_list (tuple[type]) – List of submodule types as exceptions. +Defaults to [] (empty).

  • +
+
+
Example:
+
from trojanzoo.utils.model import init_weights
+import torch.nn as nn
+
+net = nn.Sequential(nn.Linear(2, 2), nn.Linear(2, 2))
+init_weights(filter_list=[nn.Linear])   # no change
+init_weights(net)                       # init nn.Linear layers
+
+
+
+
+
+ +
+
+trojanzoo.utils.model.get_layer_name(module, depth=-1, prefix='', use_filter=True, non_leaf=False, seq_only=False, init=True)[source]
+

Get layer names of a torch.nn.Module.

+
+
Parameters:
+
+
+
Returns:
+

list[str] – The list of all layer names.

+
+
Example:
+
>>> import torchvision
+>>> from trojanzoo.utils.model import get_layer_name
+>>>
+>>> model = torchvision.models.resnet18()
+>>> get_layer_name(model, depth=0)
+[]
+>>> get_layer_name(model, depth=1)
+['conv1', 'maxpool', 'layer1', 'layer2',
+'layer3', 'layer4', 'avgpool', 'fc']
+>>> get_layer_name(model, depth=2, prefix='model')
+['model.conv1', 'model.maxpool', 'model.layer1.0', 'model.layer1.1',
+'model.layer2.0', 'model.layer2.1', 'model.layer3.0', 'model.layer3.1',
+'model.layer4.0', 'model.layer4.1', 'model.avgpool', 'model.fc']
+>>> get_layer_name(model, seq_only=True)
+['conv1', 'maxpool', 'layer1.0', 'layer1.1', 'layer2.0', 'layer2.1',
+'layer3.0', 'layer3.1', 'layer4.0', 'layer4.1', 'avgpool', 'fc']
+>>> get_layer_name(model, seq_only=True, non_leaf=True)
+['conv1', 'maxpool',
+'layer1.0', 'layer1.1', 'layer1',
+'layer2.0', 'layer2.1', 'layer2',
+'layer3.0', 'layer3.1', 'layer3',
+'layer4.0', 'layer4.1', 'layer4',
+'avgpool', 'fc']
+>>> get_layer_name(model)
+['conv1', 'maxpool',
+'layer1.0.conv1', 'layer1.0.conv2', 'layer1.1.conv1', 'layer1.1.conv2',
+'layer2.0.conv1', 'layer2.0.conv2', 'layer2.0.downsample.0', 'layer2.1.conv1', 'layer2.1.conv2',
+'layer3.0.conv1', 'layer3.0.conv2', 'layer3.0.downsample.0', 'layer3.1.conv1', 'layer3.1.conv2',
+'layer4.0.conv1', 'layer4.0.conv2', 'layer4.0.downsample.0', 'layer4.1.conv1', 'layer4.1.conv2',
+'avgpool', 'fc']
+
+
+
+
+
+ +
+
+trojanzoo.utils.model.get_all_layer(module, x, layer_input='input', depth=-1, prefix='', use_filter=True, non_leaf=False, seq_only=True, verbose=0)[source]
+

Get all intermediate layer outputs of +_input from any intermediate layer +in a torch.nn.Module.

+
+
Parameters:
+
    +
  • module (torch.nn.Module) – the module to process.

  • +
  • x (torch.Tensor) – The batched input tensor +from layer_input.

  • +
  • layer_input (str) – The intermediate layer name of x. +Defaults to 'input'.

  • +
  • depth (int) – The traverse depth. +Defaults to -1 (\infty).

  • +
  • prefix (str) – The prefix string to all elements. +Defaults to empty string ''.

  • +
  • use_filter (bool) –

    Whether to filter out certain layer types.

    + +

  • +
  • non_leaf (bool) – Whether to include non-leaf nodes. +Defaults to False.

  • +
  • seq_only (bool) – Whether to only traverse children +of torch.nn.Sequential. +If False, will traverse children of all torch.nn.Module. +Defaults to False.

  • +
  • verbose (int) –

    The output level to show information +including layer name, output shape and module information. +Setting it larger than 0 will enable the output. +Different integer values stands for different module information. +Defaults to 0.

    +
      +
    • 0: No output

    • +
    • 1: Show layer class name.

    • +
    • 2: Show layer string (first line).

    • +
    • 3: Show layer string (full).

    • +
    +

  • +
+
+
Returns:
+

dict[str, torch.Tensor] – The dict of all layer outputs.

+
+
Example:
+
>>> import torch
+>>> import torchvision
+>>> from trojanzoo.utils.model import get_all_layer
+>>>
+>>> model = torchvision.models.densenet121()
+>>> x = torch.randn(5, 3, 224, 224)
+>>> y = get_all_layer(model.features, x, verbose=True)
+layer name                                        output shape        module information
+conv0                                             [5, 64, 112, 112]   Conv2d
+pool0                                             [5, 64, 56, 56]     MaxPool2d
+denseblock1                                       [5, 256, 56, 56]    _DenseBlock
+transition1.conv                                  [5, 128, 56, 56]    Conv2d
+transition1.pool                                  [5, 128, 28, 28]    AvgPool2d
+denseblock2                                       [5, 512, 28, 28]    _DenseBlock
+transition2.conv                                  [5, 256, 28, 28]    Conv2d
+transition2.pool                                  [5, 256, 14, 14]    AvgPool2d
+denseblock3                                       [5, 1024, 14, 14]   _DenseBlock
+transition3.conv                                  [5, 512, 14, 14]    Conv2d
+transition3.pool                                  [5, 512, 7, 7]      AvgPool2d
+denseblock4                                       [5, 1024, 7, 7]     _DenseBlock
+>>> y.keys()
+dict_keys(['conv0', 'pool0',
+'denseblock1', 'transition1.conv', 'transition1.pool',
+'denseblock2', 'transition2.conv', 'transition2.pool',
+'denseblock3', 'transition3.conv', 'transition3.pool',
+'denseblock4'])
+
+
+
+
+
+

Note

+

This method regards module as a torch.nn.Sequential. +Many modules embed flatten operation in their forward method +(e.g., view(n, -1) or flatten(1)), +making get_all_layer raise error. +We suggest to use torch.nn.Flatten instead to keep the module sequential.

+
+
+ +
+
+trojanzoo.utils.model.get_layer(module, x, layer_output='output', layer_input='input', layer_name_list=None, seq_only=True)[source]
+

Get one certain intermediate layer output +of _input from any intermediate layer +in a torch.nn.Module.

+
+
Parameters:
+
    +
  • module (torch.nn.Module) – the module to process.

  • +
  • x (torch.Tensor) – The batched input tensor +from layer_input.

  • +
  • layer_output (str) – The intermediate output layer name. +Defaults to 'classifier'.

  • +
  • layer_input (str) – The intermediate layer name that outputs x. +Defaults to 'input'.

  • +
  • seq_only (bool) – Whether to only traverse children +of torch.nn.Sequential. +If False, will traverse children of all torch.nn.Module. +Defaults to True.

  • +
+
+
Returns:
+

torch.Tensor – The output of layer layer_output.

+
+
Example:
+
>>> import torch
+>>> import torchvision
+>>> from trojanzoo.utils.model import get_all_layer, get_layer
+>>>
+>>> model = torchvision.models.densenet121()
+>>> x = torch.randn(5, 3, 224, 224)
+>>> y = get_all_layer(model.features, x, verbose=True)
+layer name                                        output shape        module information
+conv0                                             [5, 64, 112, 112]   Conv2d
+pool0                                             [5, 64, 56, 56]     MaxPool2d
+denseblock1                                       [5, 256, 56, 56]    _DenseBlock
+transition1.conv                                  [5, 128, 56, 56]    Conv2d
+transition1.pool                                  [5, 128, 28, 28]    AvgPool2d
+denseblock2                                       [5, 512, 28, 28]    _DenseBlock
+transition2.conv                                  [5, 256, 28, 28]    Conv2d
+transition2.pool                                  [5, 256, 14, 14]    AvgPool2d
+denseblock3                                       [5, 1024, 14, 14]   _DenseBlock
+transition3.conv                                  [5, 512, 14, 14]    Conv2d
+transition3.pool                                  [5, 512, 7, 7]      AvgPool2d
+denseblock4                                       [5, 1024, 7, 7]     _DenseBlock
+>>> x = torch.randn(6, 256, 56, 56)
+>>> get_layer(model.features, x, layer_input='denseblock1', layer_output='transition3.conv').shape
+torch.Size([6, 512, 14, 14])
+
+
+
+
+
+ +
+
+trojanzoo.utils.model.summary(module, depth=0, verbose=True, indent=0, tree_length=None, indent_atom=12)[source]
+
+
Prints a string summary of the module.
+
This method is similar to tensorflow.keras.Model.summary().
+
+
+
Parameters:
+
    +
  • module (torch.nn.Module) – The module to process.

  • +
  • depth (int) – The traverse depth. Defaults to 0.

  • +
  • verbose (bool) – Whether to output auxiliary information. +Defaults to True.

  • +
  • indent (int) – The space indent for the entire string. +Defaults to 0.

  • +
  • tree_length (int) – The tree length. +If None, use indent_atom * (depth + 1). +Defaults to None.

  • +
  • indent_atom (int) – The indent incremental for each sub-structure. +Defaults to 12.

  • +
+
+
Example:
+
>>> import torchvision
+>>> from trojanzoo.utils.model import summary
+>>>
+>>> model=torchvision.models.resnet18()
+>>> summary(model)
+>>> summary(model, depth=1)
+conv1                   Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
+bn1                     BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
+relu                    ReLU(inplace=True)
+maxpool                 MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
+layer1                  Sequential
+layer2                  Sequential
+layer3                  Sequential
+layer4                  Sequential
+avgpool                 AdaptiveAvgPool2d(output_size=(1, 1))
+fc                      Linear(in_features=512, out_features=1000, bias=True)
+>>> summary(model, depth=1, verbose=False)
+conv1
+bn1
+relu
+maxpool
+layer1
+layer2
+layer3
+layer4
+avgpool
+fc
+>>> summary(model, depth=2)
+conv1                               Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
+bn1                                 BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
+relu                                ReLU(inplace=True)
+maxpool                             MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
+layer1                              Sequential
+            0                       BasicBlock
+            1                       BasicBlock
+layer2                              Sequential
+            0                       BasicBlock
+            1                       BasicBlock
+layer3                              Sequential
+            0                       BasicBlock
+            1                       BasicBlock
+layer4                              Sequential
+            0                       BasicBlock
+            1                       BasicBlock
+avgpool                             AdaptiveAvgPool2d(output_size=(1, 1))
+fc                                  Linear(in_features=512, out_features=1000, bias=True)
+
+
+
+
+
+

Note

+

You could use get_all_layer() with verbose=True to see the output tensor shape for each layer.

+
+
+ +
+
+trojanzoo.utils.model.activate_params(module, params=[])[source]
+

Set requires_grad=True for selected params of module. +All other params are frozen.

+
+
Parameters:
+
+
+
+
+ +
+
+trojanzoo.utils.model.accuracy(_output, _label, topk=(1, 5), **kwargs)[source]
+

Computes the accuracy over the k top predictions +for the specified values of k.

+
+
Parameters:
+
    +
  • _output (torch.Tensor) – The batched logit tensor with shape (N, C).

  • +
  • _label (torch.Tensor) – The batched label tensor with shape (N).

  • +
  • topk (Iterable[int]) – Which top-k accuracies to show. +Defaults to (1, 5).

  • +
  • **kwargs – Any keyword argument (unused).

  • +
+
+
Returns:
+

dict[str, float] – Top-k accuracies.

+
+
+
+ +
+
+trojanzoo.utils.model.generate_target(module, _input, idx=1, same=False)[source]
+
+
Generate target labels of a batched input based on

the classification confidence ranking index.

+
+
+
+
Parameters:
+
    +
  • module (torch.nn.Module) – The module to process.

  • +
  • _input (torch.Tensor) – The input tensor.

  • +
  • idx (int) – The classification confidence +rank of target class. +Defaults to 1.

  • +
  • same (bool) – Generate the same label +for all samples using mod. +Defaults to False.

  • +
+
+
Returns:
+

torch.Tensor – The generated target label with shape (N).

+
+
+
+ +
+
+class trojanzoo.utils.model.ExponentialMovingAverage(model, decay)[source]
+

Maintains moving averages of model parameters using an exponential decay. +ema_avg = decay * avg_model_param + (1 - decay) * model_param

+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/utils/module.html b/trojanzoo/utils/module.html new file mode 100644 index 00000000..fee00a76 --- /dev/null +++ b/trojanzoo/utils/module.html @@ -0,0 +1,753 @@ + + + + + + + + + + + + + + + + module — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

module

+
+
+class trojanzoo.utils.module.BasicObject(indent=0, **kwargs)[source]
+

A basic class with a pretty summary() method.

+
+
Variables:
+
    +
  • name (str) – The name of the instance or class.

  • +
  • param_list (dict[str, list[str]]) – Map from category strings to variable name list.

  • +
  • indent (int) – The indent when calling summary(). Defaults to 0.

  • +
+
+
+
+
+summary(indent=None)[source]
+

Summary the variables of the instance +according to param_list.

+
+
Parameters:
+

indent (int) – The space indent for the entire string. +Defaults to self.indent.

+
+
+ +
+ +
+ +
+
+class trojanzoo.utils.module.Process(output=0, **kwargs)[source]
+

It inherits BasicObject and further specify output levels.

+
+
Parameters:
+

output (int, Iterable[str]) – The level of output or the set of output items.

+
+
Variables:
+

output (set[str]) – The set of output items +generated by get_output().

+
+
+
+

See also

+

trojanzoo.optim.Optimizer +and ModelProcess inherit this class.

+
+
+
+get_output(org_output=None)[source]
+

Get output items based on output level.

+
+
Parameters:
+

org_output (int, Iterable[str]) – Output level integer or output items. +If int, call get_output_int(). +Defaults to self.output.

+
+
Returns:
+

set[str] – The set of output items.

+
+
+
+ +
+
+classmethod get_output_int(org_output=0)[source]
+

Get output items based on output level integer.

+
+
    +
  • 0  - 4 : {'verbose'}

  • +
  • 5  - 9 : {'verbose', 'end'}

  • +
  • 10 - 19: {'verbose', 'end', 'start'}

  • +
  • 20 - 29: {'verbose', 'end', 'start', 'middle'}

  • +
  • 30 - * : {'verbose', 'end', 'start', 'middle', 'memory'}

  • +
+
+
+
Parameters:
+

org_output (int) – Output level integer. +Defaults to 0.

+
+
Returns:
+

set[str] – The set of output items.

+
+
+
+ +
+
+static output_iter(name, _iter, iteration=None)[source]
+

Output an iteration string: +{name} Iter: [ {_iter + 1} / {iteration} ] +or {name} Iter: [ {_iter + 1} ] +if iteration is None.

+
+
Parameters:
+
    +
  • name (str) – The header string.

  • +
  • _iter (int) – The current iteration.

  • +
  • iteration (int) – The total iteration. +Defaults to None.

  • +
+
+
+
+

See also

+

The implementation is in +trojanzoo.utils.output.output_iter().

+
+
+ +
+ +
+
+class trojanzoo.utils.module.ModelProcess(dataset=None, model=None, folder_path=None, **kwargs)[source]
+

It inherits Process +and further specify model related items.

+
+
Variables:
+
+
+
+
+

See also

+

trojanzoo.attacks.Attack +and trojanzoo.defenses.Defense +inherit this class.

+
+
+ +
+
+class trojanzoo.utils.module.Module(*args, **kwargs)[source]
+

A dict-like class which supports attribute-like view as well.

+
+
Parameters:
+
    +
  • *args – Positional dict-like arguments. +All keys will be merged together.

  • +
  • **kwargs – Keyword arguments that compose a dict. +All keys will be merged together.

  • +
+
+
Variables:
+

_marker (str) – The marker of the class, +which is shown in str(self). +Defaults to 'M'.

+
+
+
+
+clear()[source]
+

Remove all keys.

+
+
Returns:
+

Module – return self for stream usage.

+
+
+
+ +
+
+copy()[source]
+

Deepcopy of self.

+
+
Returns:
+

Module – return the deepcopy of self.

+
+
+
+ +
+
+items()[source]
+
+ +
+
+keys()[source]
+
+ +
+
+remove_none()[source]
+

Remove the parameters whose values are None.

+
+
Returns:
+

Module – return self for stream usage.

+
+
+
+ +
+
+summary(indent=0)[source]
+

Output information of self.

+
+
Parameters:
+

indent (int) – The space indent for the entire string. +Defaults to 0.

+
+
+
+ +
+
+update(*args, **kwargs)[source]
+

update values.

+
+
Parameters:
+
    +
  • *args – Positional dict-like arguments. +All keys will be merged together.

  • +
  • **kwargs – Keyword arguments that compose a dict. +All keys will be merged together.

  • +
+
+
Returns:
+

Module – return self for stream usage.

+
+
+
+ +
+ +
+
+class trojanzoo.utils.module.Param(*args, **kwargs)[source]
+

A dict-like class to store parameters config that +inherits Module and further extends default values. +You can view and set keys by attributes as well.

+
+
Parameters:
+
    +
  • *args – Positional dict-like arguments. +All keys will be merged together. +If there is only 1 argument and no keyword argument, +regard it as the default value.

  • +
  • **kwargs – Keyword arguments that compose a dict. +All keys will be merged together.

  • +
+
+
Variables:
+
    +
  • _marker (str) – The marker of the class, +which is shown in str(self). +Defaults to 'P'.

  • +
  • default (Any) – The default value of unknown keys.

  • +
+
+
+
+
+clear()[source]
+
+ +
+
+remove_none()[source]
+
+ +
+
+update(*args, **kwargs)[source]
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/utils/tensor.html b/trojanzoo/utils/tensor.html new file mode 100644 index 00000000..de934154 --- /dev/null +++ b/trojanzoo/utils/tensor.html @@ -0,0 +1,539 @@ + + + + + + + + + + + + + + + + tensor — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

tensor

+
+
+trojanzoo.utils.tensor.tanh_func(x)[source]
+

tanh object function.

+
return x.tanh().add(1).mul(0.5)
+
+
+
+
Parameters:
+

x (torch.Tensor) – The tensor ranging from +[,+][-\infty, +\infty].

+
+
Returns:
+

torch.Tensor – The tensor ranging in [0, 1]

+
+
+
+ +
+
+trojanzoo.utils.tensor.atan_func(x)[source]
+

arctan object function.

+
return x.atan().div(math.pi).add(0.5)
+
+
+
+
Parameters:
+

x (torch.Tensor) – The tensor ranging from +[],+][-\infty], +\infty].

+
+
Returns:
+

torch.Tensor – The tensor ranging in [0, 1]

+
+
+
+ +
+
+trojanzoo.utils.tensor.repeat_to_batch(x, batch_size=1)[source]
+

Repeat a single input tensor to a batch.

+
+
Parameters:
+
    +
  • x (torch.Tensor) – The single input tensor to process +with shape (*).

  • +
  • batch_size (int) – Batch size. Defaults to 1.

  • +
+
+
Returns:
+

torch.Tensor – The batched input tensor with shape (batch_size, *)

+
+
+
+ +
+
+trojanzoo.utils.tensor.add_noise(x, noise=None, mean=0.0, std=1.0, universal=False, clip_min=0.0, clip_max=1.0)[source]
+

Add noise to a batched input tensor.

+
+
Parameters:
+
    +
  • x (torch.Tensor) – The input tensor to process +with shape (N, *).

  • +
  • noise (torch.Tensor | None) – The pre-defined noise. +If None, generate Gaussian noise +using torch.normal. +Defaults to be None.

  • +
  • mean (float) – The mean of generated Gaussian noise. +Defaults to 0.0.

  • +
  • std (float) – The std of generated Gaussian noise. +Defaults to 1.0.

  • +
  • universal (bool) – Whether the noise is universal +for all samples in the batch. +Defaults to False.

  • +
  • clip_min (float | torch.Tensor) – The min value of available input region. +Defaults to 0.0.

  • +
  • clip_max (float | torch.Tensor) – The max value of available input region. +Defaults to 1.0.

  • +
+
+
Returns:
+

torch.Tensor – The noisy batched input tensor +with shape (N, *) ((*) when universal=True).

+
+
+
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/trojanzoo/utils/train.html b/trojanzoo/utils/train.html new file mode 100644 index 00000000..87719b90 --- /dev/null +++ b/trojanzoo/utils/train.html @@ -0,0 +1,467 @@ + + + + + + + + + + + + + + + + train — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

train

+
+
+trojanzoo.utils.train.train(module, num_classes, epochs, optimizer, lr_scheduler=None, lr_warmup_epochs=0, model_ema=None, model_ema_steps=32, grad_clip=None, pre_conditioner=None, print_prefix='Train', start_epoch=0, resume=0, validate_interval=10, save=False, amp=False, loader_train=None, loader_valid=None, epoch_fn=None, get_data_fn=None, forward_fn=None, loss_fn=None, after_loss_fn=None, validate_fn=None, save_fn=None, file_path=None, folder_path=None, suffix=None, writer=None, main_tag='train', tag='', metric_fn=None, verbose=True, output_freq='iter', indent=0, change_train_eval=True, lr_scheduler_freq='epoch', backward_and_step=True, metric_kwargs={}, logger_train=None, logger_valid=None, **kwargs)[source]
+

Train the model

+
+ +
+
+trojanzoo.utils.train.validate(module, num_classes, loader, print_prefix='Validate', indent=0, verbose=True, get_data_fn=None, forward_fn=None, loss_fn=None, writer=None, main_tag='valid', tag='', _epoch=None, metric_fn=None, metric_kwargs={}, logger=None, **kwargs)[source]
+

Evaluate the model.

+
+
Returns:
+

(float, float) – Accuracy and loss.

+
+
+
+ +
+ + +
+ +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/tutorials/basic.html b/tutorials/basic.html new file mode 100644 index 00000000..8977ce01 --- /dev/null +++ b/tutorials/basic.html @@ -0,0 +1,478 @@ + + + + + + + + + + + + + + + + basic — TrojanZoo 2.0.3 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ Shortcuts +
+
+ +
+
+ +
+ +
+
+ +
+

basic

+

You can view example files at GitHub.

+

Following is backdoor_defense.py +to show the basic workflow.

+
#!/usr/bin/env python3
+
+# CUDA_VISIBLE_DEVICES=0 python ./examples/backdoor_defense.py --color --verbose 1 --attack badnet --defense neural_cleanse --pretrained --validate_interval 1 --epochs 50 --lr 1e-2
+
+import trojanvision
+import argparse
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser()
+    trojanvision.environ.add_argument(parser)
+    trojanvision.datasets.add_argument(parser)
+    trojanvision.models.add_argument(parser)
+    trojanvision.trainer.add_argument(parser)
+    trojanvision.marks.add_argument(parser)
+    trojanvision.attacks.add_argument(parser)
+    trojanvision.defenses.add_argument(parser)
+    kwargs = parser.parse_args().__dict__
+
+    env = trojanvision.environ.create(**kwargs)
+    dataset = trojanvision.datasets.create(**kwargs)
+    model = trojanvision.models.create(dataset=dataset, **kwargs)
+    trainer = trojanvision.trainer.create(dataset=dataset, model=model, **kwargs)
+    mark = trojanvision.marks.create(dataset=dataset, **kwargs)
+    attack = trojanvision.attacks.create(dataset=dataset, model=model, mark=mark, **kwargs)
+    defense = trojanvision.defenses.create(dataset=dataset, model=model, attack=attack, **kwargs)
+
+    if env['verbose']:
+        trojanvision.summary(env=env, dataset=dataset, model=model, mark=mark, trainer=trainer, attack=attack, defense=defense)
+    defense.detect(**trainer)
+
+
+
+ + +
+ +
+ + +
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Docs

+

Access comprehensive developer documentation for TrojanZoo

+ View Docs +
+
+
+
+ + +
+ +
+ + + + + +
+
+
+
+ + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file