GithubHelp home page GithubHelp logo

Comments (3)

MaximilianPi avatar MaximilianPi commented on September 25, 2024

sjSDM_model is the base model class for the DNN (keras style) API:

com = simulate_SDM(env = 3L, species = 5L, sites = 100L)
X = com$env_weights
Y = com$response

# the activation function in the last layer must be linear (NULL)
model = sjSDM_model(input_shape = 3L)
model %>% 
  layer_dense(units = 10L, activation = "tanh") %>% 
  layer_dense(units = 10L, activation = "relu") %>% 
  layer_dense(units = 5L) 

model %>% 
  compile(df = 50L, 
          optimizer = optimizer_adamax(learning_rate = 0.01), 
          l1_cov = 0.0001, 
          l2_cov = 0.0001)

model %>% 
  summary

model %>% 
  fit(X = X, Y = Y, epochs = 10L, batch_size = 10L)

# species association matrix:
sp = getCov(model)

# you can also continue training:
model %>% 
  fit(X = X, Y = Y, epochs = 10L, batch_size = 10L)

There is also a section in the vignette for this model class. We could add a reference in the sjSDM detail section... and maybe we should rename the model, e.g. to sjSDM_DNN?

from s-jsdm.

florianhartig avatar florianhartig commented on September 25, 2024

hmm ... but in principle, you can use create all types of models with that, right? I just wonder how much sense it makes to have this for most users, but on the other hand, it can't hurt to have it, so I would just leave it and suggest to close

from s-jsdm.

MaximilianPi avatar MaximilianPi commented on September 25, 2024

Well, because of the api changes (flexible linear/dnn structures, and using PyTorch nn.modules) the implementation of this approach is not so easy anymore, which is why I removed it for now (there are other more important things to do for now). I will close this.

from s-jsdm.

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.