Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

[Help]How can we resume from an already saved parameters ? #176

Open
rai16 opened this issue Apr 24, 2017 · 1 comment
Open

[Help]How can we resume from an already saved parameters ? #176

rai16 opened this issue Apr 24, 2017 · 1 comment

Comments

@rai16
Copy link

rai16 commented Apr 24, 2017

No description provided.

@Taco-W
Copy link
Member

Taco-W commented May 25, 2017

@rai16 The parameters are initialized by solver.init() like https://github.com/dmlc/minpy/blob/master/examples/nn/cnn.py#L94.

So, to use the saved parameters, one solution is to replace the parameters after the parameter is initialized and before the training starts. Say, I want to replace w1 by the saved parameter w1_saved, I could insert solver.model.params['w1']=w1_saved between solver.init() and solver.tain().

The code with replacement looks like:

    # Initialize model parameters.
    solver.init()
    # Use saved parameter
    solver.model.params['w1'] = w1_saved
    # Train!
    solver.train()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants