Download code/perturbnet/protocol.py from reneeice/sparse-adversarial-research-archive: direct link, hf CLI and curl.
- Browser
- Download file 649 Bytes
-
https://huggingface.co/datasets/reneeice/sparse-adversarial-research-archive/resolve/main/code/perturbnet/protocol.py
- Command line
-
hf download hf://datasets/reneeice/sparse-adversarial-research-archive/code/perturbnet/protocol.py
-
curl -L -o protocol.py https://huggingface.co/datasets/reneeice/sparse-adversarial-research-archive/resolve/main/code/perturbnet/protocol.py
649 Bytes
| from __future__ import annotations | |
| import typing | |
| import bittensor as bt | |
| from perturbnet.constants import MODEL_NAME | |
| class AttackChallenge(bt.Synapse): | |
| """ | |
| Validator -> Miner challenge payload. | |
| Miner output is only `perturbed_image_b64`. | |
| """ | |
| task_id: str | |
| model_name: str = MODEL_NAME | |
| clean_image_b64: str | |
| true_label: str | |
| epsilon: float = 0.12 | |
| norm_type: str = "Linf" | |
| min_delta: float = 0.002 | |
| timeout_seconds: int = 60 | |
| # Miner response payload. | |
| perturbed_image_b64: typing.Optional[str] = None | |
| def deserialize(self) -> typing.Optional[str]: | |
| return self.perturbed_image_b64 | |