Exponential Shift does not effect some links after the links' lr are manually modified
See original GitHub issue- Conditions
- Chainer version: 5.0.0b1
- CuPy version: 5.0.0b1
- OS/Platform: Ubuntu 16.04
- CUDA/cuDNN version: 9.0
Problem
I tried to reproduce lr_mult
in caffe
, I multiply hyperparameter lr
of some links.
And I use ExponentialShift
to multiply all lr
in the model, but the modified link’s lr
does not change.
I tried with the code below, and conv1
’s lr
does not change and still remain to 0.03
.
I expected that conv1
’s lr
will be 0.15
.
Is this expected return for optimizer
in Chainer
?
import chainer
class ExampleModel(chainer.Chain):
def __init__(self):
super(ExampleModel, self).__init__()
with self.init_scope():
self.conv1 = chainer.links.Convolution2D(3, 10, 1, 1)
self.conv2 = chainer.links.Convolution2D(10, 10, 1, 1)
def main():
model = ExampleModel()
optimizer = chainer.optimizers.MomentumSGD(lr=0.01)
optimizer.setup(model)
model.conv1.W.update_rule.hyperparam.lr *= 3
print('Done: conv1 lr * 3')
print(' conv1 lr: {}'.format(model.conv1.W.update_rule.hyperparam.lr))
print(' conv2 lr: {}'.format(model.conv2.W.update_rule.hyperparam.lr))
optimizer.lr *= 5
print('Done: optimizer.lr * 5')
print(' conv1 lr: {}'.format(model.conv1.W.update_rule.hyperparam.lr))
print(' conv2 lr: {}'.format(model.conv2.W.update_rule.hyperparam.lr))
if __name__ == '__main__':
main()
output
$ python example.py
Done: conv1 lr * 3
conv1 lr: 0.03
conv2 lr: 0.01
Done: optimizer.lr * 5
conv1 lr: 0.03
conv2 lr: 0.05
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Batch normalization in 3 levels of understanding
It consists of normalizing activation vectors from hidden layers using the first and the second statistical moments (mean and variance) of the ...
Read more >Chapter 14: SOLUTIONS TO TEXT PROBLEMS:
When a competitive firm doubles the amount it sells, the price remains the same, so its total revenue doubles. 2. The price faced...
Read more >EC-Lab - Software User's Manual - MMRC
The equipment described in this manual has been designed in accordance with EN61010 and EN61326 and has been supplied in a safe condition....
Read more >SARS-CoV-2 is associated with changes in brain ... - Nature
There is strong evidence of brain-related abnormalities in COVID-191–13. However, it remains unknown whether the impact of SARS-CoV-2 ...
Read more >IBM Z Server Time Protocol Guide
STP uses a message-based protocol in which timekeeping information is passed over externally defined coupling links, such as Coupling Express LR ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do not close this
Chainer currently does not have a way to emulate
lr_mult
. It looks better to add support for it.As a workaround, you can use multiple
ExponentialShift
extensions to modify lr of different parameters. For example, if you want to use x2 lr for some parameters, you can write: