+
Skip to content

Conversation

Dimev
Copy link
Contributor

@Dimev Dimev commented Oct 18, 2022

AddInto, to allow easier multiple inputs for networks

@Dimev Dimev marked this pull request as ready for review October 24, 2022 17:40
@Dimev
Copy link
Contributor Author

Dimev commented Oct 25, 2022

adds AddInto<T>, the opposite of SplitInto<T>, allowing multiple inputs to a network by adding the inputs together

type Model = AddInto<(Linear<2, 5>, Linear<3, 5>)>;
let model: Model = Default::default();
let _: Tensor1D<5> = model.forward((Tensor1D::<2>::zeros(), Tensor1D::<3>::zeros()));

This should help with some types of recurrent networks, as it's now easier to input extra things besides the standard input

Copy link
Owner

@coreylowman coreylowman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far! Pretty easy to understand the macros too. Can you make the following changes:

  1. a couple small fixes for ModuleMut (as I suggested in the comments)
  2. can you add serialization for this into src/nn/npz_impls.rs? It should be relatively easy since you can just use the sub modules implementation for serialization

@Dimev
Copy link
Contributor Author

Dimev commented Oct 27, 2022

Alright, will make the changes when I have the time!

@Dimev
Copy link
Contributor Author

Dimev commented Oct 27, 2022

for npz saving/loading I can probably just copy the implementation for SplitInto as it's effectively the same struct, just different functionality

Copy link
Owner

@coreylowman coreylowman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 thanks for the contribution!

@coreylowman coreylowman merged commit a363698 into coreylowman:main Oct 30, 2022
@Dimev
Copy link
Contributor Author

Dimev commented Oct 30, 2022

Noice, thanks for making such a cool crate for neural nets!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载