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
Added support for regression prediction, ie raw values instead of cla… #7
Conversation
…ssification, as a minor modification of fine_tune_ae().
I just used the auto_encoder code and instead of using the samples as the target output, used an additional set of iterators. This is the test code. #include <dll/network.hpp> #include int main() {
|
Hi, Thank you very much for this Pull Request. Sorry for the delay in answering, I'm not very active during the holidays. Everything seems in order. If I understand correctly: This enable to train regression models by using the same kind of generator as the auto encoder, but not enforcing auto-encoder model. Right ? Thanks Baptiste |
include/dll/dbn_impl.hpp
Outdated
|
||
validate_generator(generator); | ||
|
||
//cpp_assert(dll::input_size(layer_get<0>()) == dll::output_size(layer_get<layers - 1>()), "The network is not build //as an autoencoder"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can directly remove this instead of commenting
include/dll/dbn_impl.hpp
Outdated
*/ | ||
template <typename InIterator, typename OutIterator> | ||
weight fine_tune_reg(InIterator&& in_first, InIterator&& in_last, OutIterator&& out_first, OutIterator&& out_last, size_t max_epochs) { | ||
//return ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this as well
Removed commented code. The methods use a custom generator type reg_generator_t which currently matches categorical_generator_t. Only issue is the return value. return trainer.train(*this, generator, max_epochs); For regression, average loss seems like a good fit, but the trainer is treating it like a categorical generator, with classification error and nan loss. So the return value and the printed output is invalid, but as far as I can tell the training does work.
Correct. My only issue is the return value. |
Seems fine now 👍 What is you issue with the return value ? Seems correct to me. |
If no more issues, I'll merge this now. |
If you are interested, I added a few (dumb) tests for regressions: https://github.com/wichtounet/dll/blob/master/test/src/unit/reg.cpp You can also see the configuration of the error using MSE rather than CCE. |
…ssification, as a minor modification of fine_tune_ae().