blue-sky
blue-sky

Reputation: 53806

Access learned weights within iteration - keras or tensorflow

After approx 1000 iterations and frequency of approx 20 iterations I see the acc and val_acc increase from 0 for a single iteration , then returning to 0 for next iteration :

5s - loss: 2.0677 - acc: 0.1345 - val_loss: 3.0170 - val_acc: 0.0000e+00
Epoch 180/3000

5s - loss: 2.0821 - acc: 0.1426 - val_loss: 3.0052 - val_acc: 0.6520
Epoch 181/3000

5s - loss: 2.0755 - acc: 0.1202 - val_loss: 3.0405 - val_acc: 0.0000e+00

As I want to learn weight where val_cc is greater > 50% can I access weight parameters at specific iteration , in this case when acc is 0.1426 and val_acc is 0.6520 ?

Alternative does keras support saving model weights when specified acc & val_acc conditions are me ?

Update :

After decreasing learning rate :

Epoch 7562/300000
1s - loss: 0.7599 - acc: 0.6968 - val_loss: 0.2335 - val_acc: 0.9231
Epoch 7563/300000
1s - loss: 0.7484 - acc: 0.7119 - val_loss: 0.3115 - val_acc: 0.8828
Epoch 7564/300000
1s - loss: 0.7702 - acc: 0.6980 - val_loss: 0.3340 - val_acc: 0.8388

Upvotes: 0

Views: 474

Answers (1)

Daniel GL
Daniel GL

Reputation: 1249

Yes, you can manage to save your model using the callback api of Keras. You have to create your callback class and implement the function on_epoch_end() save your model depending on the conditions you want. I think the best option is to check the implementation of ModelCheckpoint. You can check it in the doc

Upvotes: 1

Related Questions