Coder Social home page Coder Social logo

dylanmuir / fmin_adam Goto Github PK

View Code? Open in Web Editor NEW
48.0 5.0 25.0 112 KB

Matlab implementation of the Adam stochastic gradient descent optimisation algorithm

Home Page: http://dylan-muir.com/articles/adam_optimiser/

MATLAB 100.00%
matlab optimization optimization-algorithms gradient-descent stochastic-gradient-descent

fmin_adam's Issues

Error while running code

Hi,
I get an error of less input arguments when I run this code.
if(isequal(fun,'defaults'))
in this line.

Error when executed with few inputs

Hi,

I started to try out your package “Adam stochastic gradient descent optimization” on matlab file exchange.
https://se.mathworks.com/matlabcentral/fileexchange/61616-adam-stochastic-gradient-descent-optimization

Quite an impressive piece of work!
You might want to know that I have no extensions to Matlab.
I tried to apply it on a simple function handle with two inputs, but it failed:

function [value, gradients] = testFunk(x0)

x = x0(1);
y = x0(2);

value = (y-3)^2 + (x-4)^2;
gradients = [2x-8, 2y-6];

(and its application…)

fun = @TestFunk;
x0 = [0,0];
[x, fval, exitflag, output] = fmin_adam(fun, x0);

As I tried to debug fmin_adam, I realized that the parameter “options” is not properly set with all the required fields:

Reference to non-existent field 'GradObj'.

Reference to non-existent field 'DerivativeCheck'.
...
Reference to non-existent field 'UseParallel'.

So when I apply the following line of code from line

options = optimset(@fmin_adam);

results in the following struct:

options =

struct with fields:

    Display: 'final'
MaxFunEvals: 10000
    MaxIter: 1000000
     TolFun: 1.0000e-06
       TolX: 1.0000e-05
FunValCheck: []
  OutputFcn: []
   PlotFcns: []

If you wish more feedback on how your code performs, you might wish to add the support for the function to be called with few inputs.

Bad step rejection

Hi Dylan, thanks for sharing. One question regarding your implementation; why are you rejecting bad steps or what's your motivation for that? I guess that the original Adam paper is not suggesting it.

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.