Coder Social home page Coder Social logo

Comments (8)

OverLordGoldDragon avatar OverLordGoldDragon commented on May 18, 2024 1

Plummeting problem fixed; Lookahead appears strongly bound to its internal optimizer's state - the problem was solved by loading the iterations attribute, which before was thrown out as Nadam itself worked better that way. The iterations attr mediates Nadam's momentum - lower = lower, down to half of max. Same holds for abruptly changing .lr. Not rigorous evidence though, as still unsure whether Lookahead's properly implemented.

from keras-lookahead.

CyberZHG avatar CyberZHG commented on May 18, 2024

Fixed.

from keras-lookahead.

OverLordGoldDragon avatar OverLordGoldDragon commented on May 18, 2024

@CyberZHG That was fast - thanks; I'll test it shortly. To clarify, is below

self.weights = self.optimizer.weights + slow_params

applying weight updates to self.weights, while Keras applies updates to self.optimizer.weights via self.updates? That is, if this is the only weight update, then before this fix, the 'slow' parameters weren't accounted for at all.

from keras-lookahead.

OverLordGoldDragon avatar OverLordGoldDragon commented on May 18, 2024

Tested - model.optimizer.weights now holds weights, but also,

len(model.optimizer.updates) == len(model.optimizer.optimizer.updates) # 171 == 171
len(model.optimizer.weights) >  len(model.optimizer.optimizer.weights) # 137 > 103
# up to matching len, the two sets of weights are all equal

Is this intended? If so, was this accounted for before? It may explain my poor model performance. A snippet of the point where the weight tensors differ below:

image


(Also, optimizer save size has increased - unless the exact partial duplicate is necessary, better without it)

from keras-lookahead.

OverLordGoldDragon avatar OverLordGoldDragon commented on May 18, 2024

Something's faulty - model performance plummets when loading states/weights and re-compiling model for a different batch_shape (greater timesteps); it behaves as if nothing was loaded, not even layer weights; I check that optimizer weights are loaded as saved

image
(val spikes should coincide with train spikes - plot error)

from keras-lookahead.

stale avatar stale commented on May 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from keras-lookahead.

OverLordGoldDragon avatar OverLordGoldDragon commented on May 18, 2024

To clarify, is the weight len discrepancy mentioned in my third comment intentional or a bug?

from keras-lookahead.

stale avatar stale commented on May 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from keras-lookahead.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.