Code Monkey home page Code Monkey logo

Comments (6)

patyork avatar patyork commented on May 2, 2024

Could you post the model? This may be a hyperparameter issue.

from keras.

fchollet avatar fchollet commented on May 2, 2024

Yes, could you post a script to repro this (I assume you used the Kaggle Otto challenge data). It looks like an exploding gradient, and there are many things that could trigger one (most likely a learning rate issue?).

In general when faced with this type of problem, you should try different learning rates and learning rate decay, different optimizers, and try to introduce regularization techniques such as L1 regularization (supported by all optimizers in Keras), gradient clipping, BatchNormalization, etc.

from keras.

erogol avatar erogol commented on May 2, 2024
model = Sequential()
model.add(Dense(20, 64, init='uniform', activation='tanh'))
model.add(Dropout(0.5))
model.add(Dense(64, 64, init='uniform', activation='tanh'))
model.add(Dropout(0.5))
model.add(Dense(64, 1, init='uniform', activation='softmax')

sgd = SGD(lr=0.1, decay=1e-6, momentum=0.9, nesterov=True)
model.compile(loss='mean_squared_error', optimizer=sgd)

I cannt post whole the script since I overwrote it but this is the same model you give as an example. Only I use the data from some where else.

However, the strange thing is, it goes smoothly to some degree but suddenly it diverges. It is the first time I observed such a thing. I also used Adagrad and it works nice but this is strange anyway.

from keras.

erogol avatar erogol commented on May 2, 2024

Also I see that time to time for Adagrad , model stucks to very high loss from the beginning but it goes well for different runs.

from keras.

nagadomi avatar nagadomi commented on May 2, 2024

I guess the learning rate becomes negative.
https://github.com/fchollet/keras/blob/master/keras/optimizers.py#L48

from keras.

erogol avatar erogol commented on May 2, 2024

yeah perfectly rational then it should be corrected.

from keras.

Related Issues (20)

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.