Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teach_event with immutable model #23

Open
HolgerPeters opened this issue Sep 21, 2016 · 1 comment
Open

teach_event with immutable model #23

HolgerPeters opened this issue Sep 21, 2016 · 1 comment

Comments

@HolgerPeters
Copy link
Contributor

Currently, in the teacher trait, Teacher<M>::teach_event<Y, C>(&self, &mut Self::Training, &mut M, &C, &M::Input, Y) has two mutable arguments, the associated training type and model. My question is, whether we could rewrite this into a function with immutable arguments, that returns new values for these arguments. This way we might be able to rewrite learn_history's loop over the history as a folding operation (reduction).

@pacman82
Copy link
Collaborator

I think this can be done. I also like the idea of expressing learn_history in terms of fold very much. However having the low level mutable interface is very handy in some applications there I use the model in one thread, while the other is training it.
My suggestion is to introduce a function wrapping the low level interface and using this function to rewrite learn_history in terms of fold.

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

No branches or pull requests

2 participants