I am building CNN algorithm that will output some values. I am using GridSearchCV for parameters tuning and I want to implement progress bar for handling with large datasets but I do not know how to.
Input:
def create_model(units):
model = Sequential() # defining model
model.add(Conv1D(filters = 64, kernel_size = 5, activation = 'relu', input_shape = (max_sensor_length, SENSORS))) # first convolution layer
model.add(MaxPool1D(pool_size = 8)) # first pooling layer
model.add(Conv1D(filters = 16, kernel_size = 5, activation = 'relu')) # 2. layer
model.add(MaxPool1D(pool_size = 4))
model.add(Conv1D(filters = 16, kernel_size = 5, activation = 'relu')) # 3. layer
model.add(MaxPool1D(pool_size = 4))
model.add(Flatten()) # adding fully connected layer
model.add(Dense(units = units, activation = 'relu'))
model.add(Dense(y_ohe.shape[1], activation = 'softmax')) # adding output layer
model.compile(loss = 'categorical_crossentropy',
optimizer = 'adam',
metrics = ['accuracy'],
) # compiling the model
return model
model = KerasRegressor(model = create_model, units = 5)
batch_size = [5, 10, 30, 50, 100]
epochs = [5, 10, 30, 50, 100]
units = [5, 10, 15, 30, 50, 100]
param_grid = dict(batch_size = batch_size,
epochs = epochs,
units = units)
grid = GridSearchCV(estimator = model,
param_grid = param_grid,
n_jobs = -1,
cv = 3,
verbose = 10
)
grid_result = grid.fit(X_train,
Y_train,
validation_data = (X_test, Y_test)
)