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

added bettter reset() function to sequential model #2079

Closed
wants to merge 11 commits into from

Conversation

fgolemo
Copy link

@fgolemo fgolemo commented Mar 25, 2016

Hi folks,

after my first attempt I now added a better reset function to the Sequential model.

It works like this:

model = Sequential()

# add layers as usual
model.add(...)

# compile & fit as usual
model.compile(...)
model.fit(...)

# then RESET and fit again. No compilation needed
model.reset()
model.fit(...)

There are two new functions, of better 1 function, 2 modes of operation:

  • hard reset (default setting) - will reset the model weights and biases to random values
  • soft reset (with parameter use_stored=True) - will reset the model to the stored weights and baises as after compilation, i.e. to the same parameters it started with before.

So it's either

model.reset() # hard reset or
model.reset(use_stored=True) # soft reset

Give me your opinion. The fork was made at commit
8ba647c

@fastai
Copy link

fastai commented Sep 18, 2016

Any chance of getting this functionality committed? Not being able to re-initialize weights leads to a lot of compilation overhead... Anything we can do to help?

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

Successfully merging this pull request may close these issues.

3 participants