N
N
newPsevdonim2022-03-26 23:54:55
Neural networks
newPsevdonim, 2022-03-26 23:54:55

How is the selection of layers when using the grid search method?

I started to deal with the automatic selection of neural network parameters. In the process, I came across a method called grid search. The data is loaded as a dictionary. I understand how the selection of parameters takes place, all except the layers.

# Различные наборы слоёв
 params = {
'clf__layers': [[Dense(256, activation='relu', input_shape=(30, )), Dense(256, activation='relu'), Dropout(0.4), Dense(1, activation='sigmoid')],
               [Dense(64, activation='relu', input_shape=(30, )), Dropout(0.4), Dense(64, activation='relu'), Dense(1, activation='sigmoid')],
               [Dense(16, activation='relu', input_shape=(30, )), Dropout(0.4), Dense(16, activation='relu'), Dense(16, activation='relu'),
                Dropout(0.4), Dense(1, activation='sigmoid')]
               ],
'clf__optimizer': ['rmsprop'],
'clf__loss': ['binary_crossentropy'],
'clf__metric': [['accuracy']],
'clf__epochs': [25, 50]
}

clf_layers is a list with 3 nested lists, when selecting parameters, the algorithm mixes the specified layers in the nested lists between each other or they mix only between each other within one nested list.

Here is an article from which an example is taken - https://shwanoff.ru/gridsearchcv/

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question