updated learning rate
parent
6f3bca61cf
commit
03d49d83e7
425
Siamese.ipynb
425
Siamese.ipynb
File diff suppressed because one or more lines are too long
|
|
@ -122,8 +122,10 @@ def create_speech_pairs_data(audio_group='audio'):
|
||||||
# print('pickled speech model data')
|
# print('pickled speech model data')
|
||||||
|
|
||||||
def speech_model_data():
|
def speech_model_data():
|
||||||
tr_pairs = np.load('outputs/tr_pairs.npy').astype(np.float32)/255.0
|
tr_pairs = np.load('outputs/tr_pairs.npy')/255.0
|
||||||
te_pairs = np.load('outputs/te_pairs.npy').astype(np.float32)/255.0
|
te_pairs = np.load('outputs/te_pairs.npy')/255.0
|
||||||
|
tr_pairs[tr_pairs < 0] = 0
|
||||||
|
te_pairs[te_pairs < 0] = 0
|
||||||
tr_y = np.load('outputs/tr_y.npy')
|
tr_y = np.load('outputs/tr_y.npy')
|
||||||
te_y = np.load('outputs/te_y.npy')
|
te_y = np.load('outputs/te_y.npy')
|
||||||
return tr_pairs,te_pairs,tr_y,te_y
|
return tr_pairs,te_pairs,tr_y,te_y
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ tb_cb = TensorBoard(log_dir='./siamese_logs', histogram_freq=1, batch_size=32,
|
||||||
embeddings_freq=0, embeddings_layer_names=None,
|
embeddings_freq=0, embeddings_layer_names=None,
|
||||||
embeddings_metadata=None)
|
embeddings_metadata=None)
|
||||||
# train
|
# train
|
||||||
rms = RMSprop(lr=0.00001) # lr=0.001)
|
rms = RMSprop(lr=0.001) # lr=0.001)
|
||||||
sgd = SGD(lr=0.001)
|
sgd = SGD(lr=0.001)
|
||||||
model.compile(loss=contrastive_loss, optimizer=rms, metrics=[accuracy])
|
model.compile(loss=contrastive_loss, optimizer=rms, metrics=[accuracy])
|
||||||
model.fit([tr_pairs[:, 0], tr_pairs[:, 1]], tr_y,
|
model.fit([tr_pairs[:, 0], tr_pairs[:, 1]], tr_y,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue