neural-disaggregator icon indicating copy to clipboard operation
neural-disaggregator copied to clipboard

I'm not good at programming. I hope you can give me some guidance

Open chowlay1996 opened this issue 4 years ago • 5 comments

Hello! Thank you for your contribution. I would like to know how to add loss visualization function in RNN network. I would like to observe its fitting

chowlay1996 avatar Jun 29 '20 11:06 chowlay1996

Hello!

Since the models are built using Keras, you can get easily get the loss value per epoch. The model.fit function returns a History object containing all losses. You can then plot them with a few modifications in the code.

You can take a look at this blog post from Machine Learning Mastery that explains the whole process.

OdysseasKr avatar Jun 29 '20 11:06 OdysseasKr

Thank you very much

chowlay1996 avatar Jun 29 '20 11:06 chowlay1996

I have learned this blog, but model.fit () requires numpy Array or List for data types of X and y. Train_mains, train_meter in your code does not belong to this type. How can I transform the type

chowlay1996 avatar Jun 29 '20 11:06 chowlay1996

In order to work with the Keras function, you need to modify the RNN disaggregator, not just the code that calls it.

Take a look at https://github.com/OdysseasKr/neural-disaggregator/blob/master/RNN/rnndisaggregator.py#L95 for the RNN.

This line

self.model.fit(mainchunk, meterchunk, epochs=epochs, batch_size=batch_size, shuffle=True)

receives two numpy arrays (mainchunk and meterchunk). This function returns the history object that you can use.

OdysseasKr avatar Jun 29 '20 12:06 OdysseasKr

I'd appreciate you for your help

chowlay1996 avatar Jun 29 '20 12:06 chowlay1996