A python script for 1-D array data classification

Keras-1D-NN-Classifier

This code is based on the reference codes linked below.

reference 1, reference 2

This code is for 1-D array data classification.

The given data in ‘data’ directory is simple data for training and testing this code.

About this code

This code is iterated by changing the’learn rate’ variable to find the optimal learning rate. The related part is the code below.

var = [ 4e-5,8e-5, 12e-5]
for i in range(len(var)):

    var_str = 'lr replay %d th' % i
    dense1 = 16
    dense2 = 16
    train_epoch = 160
    batch_size = 300
    classes = 7
    learn_rate = var[i]

In addition, it monitors during learning through the code below and stops learning when there is no improvement in accuracy.

checkpoint = ModelCheckpoint(filepath=model_path, monitor='val_acc',

 

 

 

To finish reading, please visit source site