Giter Site home page Giter Site logo

Comments (4)

cgarciae avatar cgarciae commented on May 18, 2024 1

@TuanNguyen27 From the base implementation of the Module class + hooks (get_parameter and friends) probably not. If you need any layer not yet ported its usually very straight forward since the code is identical 99% of the time; you can post an issue since its our goal to have all of them.

from dm-haiku.

cgarciae avatar cgarciae commented on May 18, 2024

Haiku doesn't offers a Model interface. You can try Elegy which offers a Keras-like Model interface, however since version 0.2.0 it is no longer compatible with Haiku, the Module system is very similar though.

from dm-haiku.

TuanNguyen27 avatar TuanNguyen27 commented on May 18, 2024

thanks for the tip, @cgarciae ! Just for my own curiosity, is there any feature available in haiku but not in Elegy ?

from dm-haiku.

tomhennigan avatar tomhennigan commented on May 18, 2024

We don't ship a model interface in Haiku (in general we try to be un-opinionated wrt how you use your neural network), but you can write a small wrapper class if you want to hold your apply function and parameters as an object:

@dataclass
class Model:
  params: hk.Params
  apply: Callable

  def __call__(self, x):
    return self.apply(self.params, x)

model = Model(params, f.apply)
print(model.params)
out = model(x)

from dm-haiku.

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.