Skip to content

Commit

Permalink
Revert "fixed bug with only one score reported (#155)"
Browse files Browse the repository at this point in the history
This reverts commit be0b9db.
  • Loading branch information
simplymathematics authored Dec 1, 2023
1 parent be0b9db commit a3650dd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 40 deletions.
2 changes: 1 addition & 1 deletion deckard/base/model/art_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ def __call__(self):
device_type = "gpu" if torch.cuda.is_available() else "cpu"
if device_type == "gpu":
logger.info("Using GPU")
logger.info("Model moved to GPU")
number_of_devices = torch.cuda.device_count()
num = randint(0, number_of_devices - 1)
device = torch.device(f"cuda:{num}")
if isinstance(data[0][0], np.ndarray):
data = [torch.from_numpy(d).to(device) for d in data]
data = [d.to(device) for d in data]
model.to(device)
logger.info(f"Model moved to GPU: {device}")
else:
device = torch.device("cpu")
model = TorchInitializer(
Expand Down
2 changes: 0 additions & 2 deletions deckard/layers/optimise.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ def optimise(cfg: DictConfig) -> None:
if raise_exception:
raise e
scores = fake_scores
if len(scores) == 1:
scores = scores[0]
return scores


Expand Down
19 changes: 0 additions & 19 deletions examples/power/README.md

This file was deleted.

12 changes: 6 additions & 6 deletions examples/power/conf/torch_cifar10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ stage : '???'
direction :
- maximize
- minimize
# - minimize
- maximize
- minimize
# - minimize
- minimize
- minimize
- minimize
optimizers:
- accuracy
- train_time
# - predict_proba_time
- predict_proba_time
- adv_accuracy
- adv_fit_time
# - adv_predict_time
- adv_predict_time
_target_ : deckard.base.experiment.Experiment
hydra:
run:
Expand Down Expand Up @@ -51,6 +51,6 @@ hydra:
++model.trainer.batch_size: int(range(10, 10000))
++attack.init.eps : range(0.01, 1.0)
++attack.init.eps_step : ${eval:'(.01)*${attack.init.eps}'}
++attack.init.batch_size: ${model.trainer.batch_size}
++attack.init.batch_size: int(range(10,10000))
_target_: hydra_plugins.hydra_optuna_sweeper.optuna_sweeper.OptunaSweeper
direction: ${direction}
12 changes: 6 additions & 6 deletions examples/power/conf/torch_cifar100.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ stage : '???'
direction :
- maximize
- minimize
# - minimize
- maximize
- minimize
# - minimize
- minimize
- minimize
- minimize
optimizers:
- accuracy
- train_time
# - predict_proba_time
- predict_proba_time
- adv_accuracy
- adv_fit_time
# - adv_predict_time
- adv_predict_time
_target_ : deckard.base.experiment.Experiment
hydra:
run:
Expand Down Expand Up @@ -52,6 +52,6 @@ hydra:
++model.trainer.batch_size: int(range(10, 10000))
++attack.init.eps : range(0.01, 1.0)
++attack.init.eps_step : ${eval:'(.01)*${attack.init.eps}'}
++attack.init.batch_size: ${model.trainer.batch_size}
++attack.init.batch_size: int(range(10,10000))
_target_: hydra_plugins.hydra_optuna_sweeper.optuna_sweeper.OptunaSweeper
direction: ${direction}
13 changes: 7 additions & 6 deletions examples/power/conf/torch_mnist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ stage : '???'
direction :
- maximize
- minimize
# - minimize
- maximize
- minimize
# - minimize
- minimize
- minimize
- minimize
optimizers:
- accuracy
- train_time
# - predict_proba_time
- predict_proba_time
- adv_accuracy
- adv_fit_time
# - adv_predict_time
- adv_predict_time
_target_ : deckard.base.experiment.Experiment
hydra:
run:
Expand Down Expand Up @@ -52,9 +52,10 @@ hydra:
++model.trainer.batch_size: int(range(10, 10000))
++attack.init.eps : range(0.01, 1.0)
++attack.init.eps_step : ${eval:'(.01)*${attack.init.eps}'}
++attack.init.batch_size: ${model.trainer.batch_size}
++attack.init.batch_size: int(range(10,10000))
_target_: hydra_plugins.hydra_optuna_sweeper.optuna_sweeper.OptunaSweeper
direction: ${direction}

# launcher: REDIS QUEUE LAUNCHER
# # @package hydra.launcher
# _target_: hydra_plugins.hydra_rq_launcher.rq_launcher.RQLauncher
Expand Down

0 comments on commit a3650dd

Please sign in to comment.