ehsanhaghighat / sciann

Deep learning for Engineers - Physics Informed Deep Learning
htttp://sciann.com
Other
325 stars 116 forks source link

fix save_weights argument in model.train to use 'freq' value instead of always using 10 as callback period #55

Closed pradhyumna85 closed 2 years ago

pradhyumna85 commented 2 years ago

Issue: "https://github.com/sciann/sciann/issues/54"

history = model.train(inputs_train, len(losses)*['zero'], batch_size=100, learning_rate=0.001,
               save_weights={"path":'./weights','freq':200})

When executing the above code with the save_weights parameter, weights are saved every 10 epoch irrespective of what we pass in the 'freq' key of the save_weights argument.

I figured out the code which I think is logically incorrect, in the sciann.model class's train function and updated the same to get expected behavior (10 as default value of 'freq' if the key is not specified).

pradhyumna85 commented 2 years ago

@ehsanhaghighat Thank you for fixing this in your recent commit. I am closing the pull request.