Skip to content

Commit

Permalink
Add forward hook paths explicitly for recent torchdistill vers.
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshitomo-matsubara committed Aug 30, 2024
1 parent 9124113 commit c701fe7
Show file tree
Hide file tree
Showing 16 changed files with 122 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 7.0
alpha: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -118,9 +124,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 5.0
alpha: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -108,9 +114,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 11.0
alpha: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -108,9 +114,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 1.0
alpha: 0.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -108,9 +114,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 5.0
alpha: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -108,9 +114,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 5.0
alpha: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -108,9 +114,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 3.0
alpha: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -108,9 +114,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 5.0
alpha: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -108,9 +114,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 7.0
alpha: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -118,9 +124,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 5.0
alpha: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -108,9 +114,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 11.0
alpha: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -108,9 +114,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 1.0
alpha: 0.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ train:
wrapper:
requires_grad: False
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
student:
forward_proc: 'forward_batch_as_kwargs'
adaptations:
sequential: []
wrapper:
requires_grad: True
frozen_modules: []
forward_hook:
input: []
output: ['classifier']
optimizer:
key: 'optimizer_no_decay'
kwargs:
Expand All @@ -108,9 +114,9 @@ train:
criterion:
key: 'KDLoss'
kwargs:
student_module_path: '.classifier'
student_module_path: 'classifier'
student_module_io: 'output'
teacher_module_path: '.classifier'
teacher_module_path: 'classifier'
teacher_module_io: 'output'
temperature: 5.0
alpha: 0.9
Expand Down
Loading

0 comments on commit c701fe7

Please sign in to comment.