GithubHelp home page GithubHelp logo

ai-sgd's People

Contributors

dustinvtran avatar ptoulis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ai-sgd's Issues

Modularity in sgd.R

I've been tweaking sgd.R over the past few days and it has gotten absurdly lengthy (have not pushed the latest yet).

It would be natural to use update functions, e.g., in the main loop, you would have something such as theta.new <- sgd.update(...) for each if statement. However, the number of parameters the update function takes causes them to be very convoluted.

Here's an example of what the main loop would look like:

# Run the stochastic gradient method.
# Main iteration: i = #iteration
for (i in 1:(n*npass)) {
  # Update y matrix if method uses least squares estimate.
  if (sgd.method %in% c("LS-SGD", "LS-ISGD")) {
    y[, i] <- ls.update(i, data, theta.sgd, n)
  }
  # Update parameters.
  if (sgd.method %in% c("SGD", "ASGD", "LS-SGD")) {
    theta.new <- sgd.update(i, data, theta.sgd, lr, lambda, n, ...)
  } else if (sgd.method %in% c("ISGD", "AI-SGD", "LS-ISGD")) {
    theta.new <- isgd.update(i, data, theta.sgd, lr, lambda, n, ...)
  } else if (sgd.method == "SVRG") {
    theta.new <- svrg.update(i, data, theta.sgd, lr, lambda, n, ...)
  }
  theta.sgd[, i+1] <- theta.new
}

Is this an acceptable solution? It makes the sgd() function more readable at the cost of making the update functions themselves a bit convoluted.

Need separate folder/better naming for experiments.

It is probably better to have a new folder with the experiments and then
follow a better naming scheme. For example, it is more descriptive to have a name
such as exp_model_params.R e.g., exp_normal_n5p2.R to know that this is an experiment
on the normal model with n=1e5 examples and p=1e2 parameters.

lambda parameter in sgd not working

Not sure why, but in my experiments setting lambda to be anything other than zero leads to worse performance. Also the implicit case simply doesn't run.

batch learning needs update

The DATA object was changed to include a definition of the GLM model
that generates the data. The batch learning needs to change so that
to use this information and feed it into a call glm(..., family=...)
where family will depend on the GLM model.

Relevant datasets?

I think we should look for some interesting datasets for estimation.
Either from the Pascal challenge or from UCI ?

Especially we would like models where explicit would have trouble with;
Poisson regression is a prime example.

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.