From 27f64986d6d00490837b03d8e10ff83dea789eeb Mon Sep 17 00:00:00 2001 From: John Martinsson Date: Wed, 16 Nov 2016 22:46:18 +0100 Subject: [PATCH] Experimental run with CubeRun and MLSP 2013 - separate train/validation : 230/92 Using TensorFlow backend. Wed, 16 Nov 2016 17:04:16 +0000 Wed, 16 Nov 2016 17:04:45 +0000 X_train shape: (230, 257, 624, 1) Y_train shape: (230, 19) Train on 230 samples, validate on 92 samples Epoch 1/20 230/230 [==============================] - 234s - loss: 0.2889 - acc: 0.9096 - val_loss: 0.6004 - val_acc: 0.9382 Epoch 2/20 230/230 [==============================] - 280s - loss: 0.2331 - acc: 0.9357 - val_loss: 0.4799 - val_acc: 0.9388 Epoch 3/20 230/230 [==============================] - 267s - loss: 0.2178 - acc: 0.9405 - val_loss: 0.3822 - val_acc: 0.9336 Epoch 4/20 230/230 [==============================] - 263s - loss: 0.1884 - acc: 0.9467 - val_loss: 0.3444 - val_acc: 0.9251 Epoch 5/20 230/230 [==============================] - 267s - loss: 0.1899 - acc: 0.9458 - val_loss: 0.2372 - val_acc: 0.9354 Epoch 6/20 230/230 [==============================] - 259s - loss: 0.1735 - acc: 0.9490 - val_loss: 0.2278 - val_acc: 0.9382 Epoch 7/20 230/230 [==============================] - 274s - loss: 0.1657 - acc: 0.9533 - val_loss: 0.2417 - val_acc: 0.9388 Epoch 8/20 230/230 [==============================] - 290s - loss: 0.1501 - acc: 0.9545 - val_loss: 0.2337 - val_acc: 0.9399 Epoch 9/20 230/230 [==============================] - 282s - loss: 0.1414 - acc: 0.9604 - val_loss: 0.2455 - val_acc: 0.9319 Epoch 10/20 230/230 [==============================] - 281s - loss: 0.1222 - acc: 0.9613 - val_loss: 0.2539 - val_acc: 0.9371 Epoch 11/20 230/230 [==============================] - 285s - loss: 0.1108 - acc: 0.9689 - val_loss: 0.3698 - val_acc: 0.9416 Epoch 12/20 230/230 [==============================] - 289s - loss: 0.0974 - acc: 0.9698 - val_loss: 0.3457 - val_acc: 0.9365 Epoch 13/20 230/230 [==============================] - 287s - loss: 0.0939 - acc: 0.9712 - val_loss: 0.2873 - val_acc: 0.9405 Epoch 14/20 230/230 [==============================] - 269s - loss: 0.0789 - acc: 0.9748 - val_loss: 0.3948 - val_acc: 0.9394 Epoch 15/20 230/230 [==============================] - 266s - loss: 0.0611 - acc: 0.9808 - val_loss: 0.3758 - val_acc: 0.9399 Epoch 16/20 230/230 [==============================] - 259s - loss: 0.0582 - acc: 0.9817 - val_loss: 0.3478 - val_acc: 0.9405 Epoch 17/20 230/230 [==============================] - 259s - loss: 0.0450 - acc: 0.9842 - val_loss: 0.2778 - val_acc: 0.9411 Epoch 18/20 230/230 [==============================] - 275s - loss: 0.0380 - acc: 0.9870 - val_loss: 0.4107 - val_acc: 0.9434 Epoch 19/20 230/230 [==============================] - 287s - loss: 0.0347 - acc: 0.9888 - val_loss: 0.2777 - val_acc: 0.9354 Epoch 20/20 230/230 [==============================] - 288s - loss: 0.0308 - acc: 0.9911 - val_loss: 0.4374 - val_acc: 0.9411 Wed, 16 Nov 2016 18:35:59 +0000 Wed, 16 Nov 2016 18:36:00 +0000 The weights have been saved in: ../weights/2016_11_16_18:35:59_cuberun.h5 --- bird/train.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bird/train.py b/bird/train.py index 38ceee7..13e88cd 100644 --- a/bird/train.py +++ b/bird/train.py @@ -6,7 +6,7 @@ import loader # Settings -nb_epoch = 60 +nb_epoch = 20 nb_classes = 19 #nb_classes = 2 batch_size = 8 @@ -72,8 +72,8 @@ #print("Validation class dict: ", validation_class_dict.class_indices) ############################################################################ -X_valid, Y_valid = loader.load_data(train_path, labels_path, size=100, - nb_classes=nb_classes, image_shape=(cols, rows)) +#X_valid, Y_valid = loader.load_data(train_path, labels_path, size=100, + #nb_classes=nb_classes, image_shape=(cols, rows)) # Setup compile @@ -95,9 +95,16 @@ #for e in range(nb_epoch): #print("epoch %d" % e) print(strftime("%a, %d %b %Y %H:%M:%S +0000", localtime())) -X_train, Y_train = loader.load_all_data(train_path, labels_path, - nb_classes=nb_classes, - image_shape=(cols, rows)); +X, Y, filenames = loader.load_all_data(train_path, labels_path, + nb_classes=nb_classes, + image_shape=(cols, rows)); + +X_train = X[:230] +Y_train = Y[:230] +X_valid = X[230:] +Y_valid = Y[230:] + + print(strftime("%a, %d %b %Y %H:%M:%S +0000", localtime())) print("X_train shape: ", X_train.shape) print("Y_train shape: ", Y_train.shape)