Coder Social home page Coder Social logo

Comments (4)

benbaarber avatar benbaarber commented on June 3, 2024 1

@nathanielsimard Thanks for the response

For your specific problem, I think you would need a mapper, similar to how our optimizers are actually implemented and update the model's parameters. See this mapper as a reference.

This helps alot, thanks.

Right now, we aren't really prioritizing more features, but rather improving performance. Feel free to open issues in areas where Burn would benefit from more documentation and examples; we may prioritize it!

Sounds good. I understand the Visitor/Mapper paradigm a bit better now after looking around the codebase, though I think some really basic examples would go a long way with newcomers (like me) being able to quickly and easily use these features. The thing I was confused about at first was where to store the parameters after visiting them, then I was a bit confused about using Mapper to adjust the parameters of the target model as a function of itself and the policy model, which I will try to figure out today and will definitely ask in the discord if I'm lost there.

Thank you again for the help

from burn.

antimora avatar antimora commented on June 3, 2024

CC @laggui @nathanielsimard

from burn.

benbaarber avatar benbaarber commented on June 3, 2024

Having another issue as well, am trying to implement the soft update of the target network in a deep Q learning environment, see pytorch equivalent:

pnsd, tnsd = self.policy_net.state_dict(), self.target_net.state_dict()

for key in pnsd:
  tnsd[key] = pnsd[key] * self.hp["tau"] + tnsd[key] * (1 - self.hp["tau"])

self.target_net.load_state_dict(tnsd)

I see that burn has the concepts of visitors and mappers, which seemed to be the best way to implement this. However, the documentation around visitors, mappers, and generally accessing the parameters of a model is either missing or very hard to find. Even this small section in the book is out of date with the trait definitions. There do not appear to be any examples of the intended way to use these traits either.

I feel like burn has tons of potential to be THE goto machine learning framework in rust, but the lack of clear documentation and examples is holding it back. I really think documenting existing code should be a higher priority than adding new features at this point, and would be happy to help if someone can answer my questions and clear this stuff up for me.

from burn.

nathanielsimard avatar nathanielsimard commented on June 3, 2024

@benbaarber Thanks for the PR that made the optimizer concrete. Hope this solves your problem regarding holding an optimizer in your struct. Regarding the visitor and mapper, I think it's a very nice candidate for a new advanced section in the book. Adding more docs on the trait wouldn't be a bad idea either.

For your specific problem, I think you would need a mapper, similar to how our optimizers are actually implemented and update the model's parameters. See this mapper as a reference. Let me know if it helps, and don't hesitate to ask your questions on the Discord; we are a bit more responsive there!

Right now, we aren't really prioritizing more features, but rather improving performance. Feel free to open issues in areas where Burn would benefit from more documentation and examples; we may prioritize it!

from burn.

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.