tensorfreitas / Siamese-Networks-for-One-Shot-Learning

Implementation of Siamese Neural Networks for One-shot Image Recognition
605 stars 181 forks source link

train epoch acc have no change #16

Closed myegdfz closed 3 years ago

myegdfz commented 3 years ago

firstly thx for yr work, and since the version, i made some change in your code, but it works nothing, and every epoch the accurcy rate was not change, like this.

4(`}32%7( `MGBF_$ZW`E%1

tensorfreitas commented 3 years ago

Hi! could you elaborate on what did you change to the code?

myegdfz commented 3 years ago

since the original not at version tf 2.4, so I change the _write_logs_to_tensorboard to adapt version 2.4, this one image , and the Modified_SGD class's learning_rate, because lr is the father class's attribute. image

myegdfz commented 3 years ago

and i also have a question, i modified the structure of the net, replace the original convolutional layer with vgg16 and add a netvald layer before the last layer image but loss will increase to 36.xx from 5.0. and I can't understand.

tensorfreitas commented 3 years ago

Thanks for the details. I would suggest for making sure that the original architecture will decrease the training error in a small dataset.

Only after that I would start making adjustments to the model architecture and follow the same process. Make sure you test adam/modified SGD with different learning rates. By making big adjustments it's hard to identify the reason of non convergence. Hope I was helpful

myegdfz commented 3 years ago

do you mean if my initial loss is too high, it would be stoped very fast? maybe at iteration 4.

tensorfreitas commented 3 years ago

No, I was meaning that making sure you can guarantee first that the architecture converges in a small dataset and that the training loss is decreasing.

I would suggest reading this blog post by Andrej Karpathy, especially the overfit section:

http://karpathy.github.io/2019/04/25/recipe/