This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y_i = \sum_{k=1}^{5} (w_{ki}*x_k) + b_i \quad (1 \leq i \leq 5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras import backend as K | |
model_input = Input(shape=(10,)) | |
calculated = K.sqrt(model_input + 1.0) | |
model = Model(inputs=model_input, outputs=calculated) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.callbacks import Callback | |
import numpy as np | |
class CustomModelCheckpoint(Callback): | |
""" | |
Custom Metricsが特定の閾値を超えたときだけモデルを保存するチェックポイント | |
thresholdsはkeyがmetrics名、値が閾値となるDictionary | |
""" | |
def __init__(self, filepath, thresholds, inverse=False): | |
super(CustomModelCheckpoint, self).__init__() |