Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Wrong Use of ReplayPlugin in LaMAML Experiments. #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions experiments/split_cifar100/lamaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def lamaml_scifar100(override_args=None):
args = create_default_args(
{'cuda': 0, 'n_inner_updates': 5, 'second_order': True,
'grad_clip_norm': 1.0, 'learn_lr': True, 'lr_alpha': 0.25,
'sync_update': False, 'mem_size': 200, 'lr': 0.1,
'sync_update': False, 'mem_size': 200, 'buffer_mb_size': 10, 'lr': 0.1,
'train_mb_size': 10, 'train_epochs': 10, 'seed': None}, override_args
)

Expand All @@ -41,16 +41,6 @@ def lamaml_scifar100(override_args=None):
metrics.accuracy_metrics(epoch=True, experience=True, stream=True),
loggers=[interactive_logger])

# Buffer
rs_buffer = ReservoirSamplingBuffer(max_size=args.mem_size)
replay_plugin = ReplayPlugin(
mem_size=args.mem_size,
batch_size=args.train_mb_size,
batch_size_mem=args.train_mb_size,
task_balanced_dataloader=False,
storage_policy=rs_buffer
)

# Strategy
model = MTConvCIFAR()
cl_strategy = LaMAML(
Expand All @@ -65,9 +55,10 @@ def lamaml_scifar100(override_args=None):
sync_update=args.sync_update,
train_mb_size=args.train_mb_size,
train_epochs=args.train_epochs,
buffer_mb_size=args.buffer_mb_size,
max_buffer_size=args.mem_size,
eval_mb_size=100,
device=device,
plugins=[replay_plugin],
evaluator=evaluation_plugin,
)

Expand Down
17 changes: 4 additions & 13 deletions experiments/split_tiny_imagenet/lamaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def lamaml_stinyimagenet(override_args=None):
args = create_default_args(
{'cuda': 0, 'n_inner_updates': 5, 'second_order': True,
'grad_clip_norm': 1.0, 'learn_lr': True, 'lr_alpha': 0.4,
'sync_update': False, 'mem_size': 400, 'lr': 0.1, 'train_mb_size': 10,
'train_epochs': 10, 'seed': None}, override_args
'sync_update': False, 'mem_size': 400, 'buffer_mb_size': 10, 'lr': 0.1,
'train_mb_size': 10, 'train_epochs': 10, 'seed': None}, override_args
)

set_seed(args.seed)
Expand All @@ -43,16 +43,6 @@ def lamaml_stinyimagenet(override_args=None):
metrics.accuracy_metrics(epoch=True, experience=True, stream=True),
loggers=[interactive_logger])

# Buffer
rs_buffer = ReservoirSamplingBuffer(max_size=args.mem_size)
replay_plugin = ReplayPlugin(
mem_size=args.mem_size,
batch_size=args.train_mb_size,
batch_size_mem=args.train_mb_size,
task_balanced_dataloader=False,
storage_policy=rs_buffer
)

# Strategy
model = MTConvTinyImageNet()
cl_strategy = LaMAML(
Expand All @@ -67,9 +57,10 @@ def lamaml_stinyimagenet(override_args=None):
sync_update=args.sync_update,
train_mb_size=args.train_mb_size,
train_epochs=args.train_epochs,
buffer_mb_size=args.buffer_mb_size,
max_buffer_size=args.mem_size,
eval_mb_size=100,
device=device,
plugins=[replay_plugin],
evaluator=evaluation_plugin,
)

Expand Down