Comments (4)
@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.
from burn.
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.
@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)
- clamp_min does not handle -inf correctly on Autodiff<NdArray> backend
- Update tch to 0.16+
- Add multi-stream support to all the different backends.
- Add application logger strategy to learner builder
- Improve pickle (`CandleTensor`) conversions to `NestedValue`
- Add `squeeze_dims` function
- Building failed. Err: Is gcc.exe installed HOT 3
- Bug with element types in JIT when using all(), related to PRNG
- Crate libc 0.2.154 is yanked
- Feature: Burn equivalent to torch.retain_grad
- Burn-WGPU tests fail on Windows with Radeon 6950 HOT 1
- [Book] Add reference to models repo
- [Book] Add examples section
- Error when importing onnx of transformers bert model HOT 1
- Extract onnx importing into it's own crate. HOT 2
- The trait `std::clone::Clone` is not implemented for `BenchmarkModuleRecord<B>
- [Book] Add custom dataset, loader and batcher detailed example HOT 1
- Crate zip 1.3.0 is yanked
- Alternative design for node, argument handling in burn import HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from burn.