PythEsc / Research_project2

Prediction of Facebook-user reactions to supermarkets using neural networks
1 stars 0 forks source link

Try to align the CNN and RNN #24

Closed PythEsc closed 7 years ago

PythEsc commented 7 years ago

We should make sure that the CNN and RNN actually are using the same structure of input and output data. Moreover, they should use the same internal methods (e.g. for calculating the accuracy)

Naxter commented 7 years ago

Would be the best if Bruno would also push his RNN code, that he AND me can compare the code

brunolubascher commented 7 years ago

I aligned the two. I pushed the RNN and the changes I did for both.

PythEsc commented 7 years ago

@brunolubascher @Naxter Is it currently possible to train the network and use the training progress later for the prediction of a single post?

  1. Start the training
  2. Save the training progress after some time
  3. Start API
  4. When a new request comes in use the already trained network to predict a single post

So basically the networks should support a way to simply call a function

def predict(post: str) -> dict

which gets a single post and returns the predicted reactions based on the former trained model

Naxter commented 7 years ago

For the CNN this works with the saved checkpoints that are written while training. The function can be easily written. Maybe we provide a base class so it is easier for the API to call the function for both networks. Also, the modularity is better and easier extendable.

PythEsc commented 7 years ago

This is a really good idea. I've created a base class called "NeuralNetwork". Moreover, I've moved both directories ("convolutional_neural_network" and "recurrent_neural_network") to a base directory ("neural_network"). In this base directory we'll add all files that are used by both networks. Everything specific for one or the other network will be added to its sub-directory

PythEsc commented 7 years ago

Ok I have started to adjust the RNN to the base class. I think it would be nice to have the possibility to save and restore the models so that one can continue training at a later point. Moreover, this is necessary for the predict-method anyways. So basically this is still open:

Naxter commented 7 years ago

CNN prediciton method is implemented

Naxter commented 7 years ago

Is aligned.