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

How To Know If The Model Is Trained? #31

Closed
Sunehildeep opened this issue Jul 13, 2018 · 13 comments
Closed

How To Know If The Model Is Trained? #31

Sunehildeep opened this issue Jul 13, 2018 · 13 comments

Comments

@Sunehildeep
Copy link

How to know if the model is fully trained? I'm at around 200k iteration, but how would I know its trained?
And I've one more question, does the model learns/improves itself as we keep chatting with it?

@adeshpande3
Copy link
Owner

You could try to separate the initial dataset into train/test and then see intermittently run the network on the test examples during the training run. However, since it's not really a classification problem, quantitatively measuring how the network is doing gets a little bit harder. For myself, I just trained until I got reasonable responses and until the network started to overfit at which point I stopped training.

And no, the model won't improve or anything. Once the model has been trained and deployed to FB messenger, its weights won't change anymore as the network will just be running inference.

@Sunehildeep
Copy link
Author

Okay, thanks for the info.

@Sunehildeep
Copy link
Author

Sunehildeep commented Jul 15, 2018

I've one more question, should I delete all other checkpoints when I've to deploy it and only keep the latest one? And also, I saved the training and restored it now, so does that mean that the checkpoint numbers will differ? Or they will continue from where I left them. For example if I stopped training at 60k iterations and the checkpoint was named as 60000 so if I restore my training, will it create checkpoints from 10000 or from 70000.

One more thing I'd like to know is how do I modify the bot to improve its responses as we keep chatting with it? Like if it gives wrong responses, then if we keep chatting with it, it keeps learning how I speak? Because I've seen this feature in nearly every chatbot. I only liked your chatbot and I'm a noob in tensorflow, so sorry for the "too" many questions I've been asking. I'd just like to get this information which is confusing me.

Also, I've been training it on an AWS VPS, the training was very fast at first till it got to 50k iterations and I stopped it as it was very slow at that time. I rebooted the VPS cuz I thought it might be the VPS, but its really damn slow now, like 50 iterations are done after 40-50seconds. I'd like to know if its the system or tensorflow trains it like that when it gets bigger.

@Sunehildeep Sunehildeep reopened this Jul 15, 2018
@adeshpande3
Copy link
Owner

  1. You won't have to delete the other checkpoints because it looks like from Tensorflow's documentation it will always take the latest checkpoint. And yes, the checkpoint numbers will differ because the variable i for the number of iterations will restart at 0. It'll create checkpoints from 10000 instead of 70000 I believe (although best way to check is just to try it out).

  2. I'm not aware of any bots that have that behaviour. It doesn't really seem possible to me because you would need a way to tell the network that the response was incorrect and you would need to be able to show the network what the expected output was. Maybe you can link to the other chatbots that have that behavior and I can try to see what they are doing.

  3. I'm not really aware of any slowdown that could occur but maybe you should try decreasing the size of the network and then seeing if the problem is still there.

@Sunehildeep
Copy link
Author

I'm not able to find the chatbot I saw, but the example in there was like this.
User: Hi
Bot: aaa

(After chatting for a few minutes)
User: hey
Bot: hello

I believe it gets the response and trains the bot with 1 iteration (which basically means the training code for one time) with respect to that response while chatting.

@adeshpande3
Copy link
Owner

Still not sure about how that could be trained. If you're training it on that one iteration, you'd have to still specify what the expected response is. If the input sequence is "Hi" for example and the bot response is "aaa", how will it ever learn what the appropriate response is?

@Sunehildeep
Copy link
Author

You are right, but I've one more issue, I've trained for like 300k iterations but still I get invalid responses and random outputs. Everytime it replies same reply to a specific word and that reply is also invalid.
For example:
User: Ok
Bot: I mean

User: Hi
Bot: And emailed it

@adeshpande3
Copy link
Owner

See #30

@Sunehildeep
Copy link
Author

Sunehildeep commented Jul 19, 2018

"By decreasing the complexity of the network, I mean decreasing the number of LSTM units or the number of LSTM layers"
I did tried that, but the thing is when I decrease LSTM units I get tensorflow error of shape not matching. of lhs and rhs and my current lstm is large (nearly 112)

@adeshpande3
Copy link
Owner

See #6. If you're getting the shape not matching error, then you might have a difference between the model you're training and the one you are loading.

@Sunehildeep
Copy link
Author

Sunehildeep commented Jul 19, 2018

So if I want to change the lstm unit for training, I need to start everything from beginning of training? Like I'm on 500k iterations now and the bot just responds with 3 messages to every sentence, it's so weird even after that much training

@adeshpande3
Copy link
Owner

Yeah you need to restart the training.

As a side note, I should make it clear that the network I've created is just a basic one and likely isn't enough to achieve good performance. If you want an extremely realistic chatbot, you'll need to take a look at some research papers to see their implementations. I referenced some at the end of this post and I recommend you take a look at the Ways to Improve section.

@Sunehildeep
Copy link
Author

Thanks, I'll look into them and If I'm able to improve this chatbot, I will contribute.

I'm closing the issue now as my problems are solved.

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