NeuroSyd / seizure-prediction-CNN

GNU Affero General Public License v3.0
42 stars 13 forks source link

Saving the model #2

Closed Afef00 closed 5 years ago

Afef00 commented 5 years ago

I was wondering if I want to save the model sould I modify in CNN.py this line

filepath="modell%s%s.h5" %(self.target, self.mode), verbose=0, save_bestonly=True) to this filepath="modell%s_%s.h5" %(self.target, self.mode), verbose=0, save_best_only=True,save_weights_only=False)

truongduynhan commented 5 years ago

Both should work. The difference is that the former will save weights+model's topology while the latter will save weights only.

Afef00 commented 5 years ago

You mean this will save the model +weights ? : filepath="modell%s%s.h5" %(self.target, self.mode), verbose=0, save_best_only=True)

Also one more thing in the evaluation of the model performance I wanted to calculate the model's accuracy instead of Auc using : from sklearn.metrics import accuracy_score accuracy_score(y, predictions) print('Test AC is:',accuracy_score) However,I got this errror message "TabError: inconsistent use of tabs and spaces in indentation"

truongduynhan commented 5 years ago

You mean this will save the model +weights ? --> YES

The error you get is about python indentation. Make sure that you use consistent indentation (tab or space) throughout each .py file.

Afef00 commented 5 years ago

Thanks !!