- Insatiable appetite for knowledge
- Know the basics
- Identify the gaps in your knowledge
- Constantly update
- Expose the linkages
- Expose diverse views
- Write, argue and debate
Reference: https://www.youtube.com/watch?v=_svETMOY9zY
License To Play
from sklearn.model_selection import GridSearchCV from sklearn.metrics import classification_report from keras.wrappers.scikit_learn import KerasClassifier from keras.models import Sequential import time
def dense_model(units, dropout):
model = Sequential()
model.add(Dense(units, activation='relu', input_shape=(28, 28,)))
model.add(Dropout(dropout))
model.add(Dense(units, activation='relu'))
model.add(Dropout(dropout))
model.add(Flatten())
model.add(Dense(10, activation='softmax'))
model.compile(loss='categorical_crossentropy',
optimizer='adam',
metrics=['accuracy'])
return model
hyperparameters = {
'epochs': [1],
'batch_size': [64],
'units': [32, 64, 128],
'dropout': [0.1, 0.2, 0.4]
}
model = KerasClassifier(build_fn=dense_model, verbose=0)
start = time.clock()
grid = GridSearchCV(estimator=model, param_grid=hyperparameters, cv=6, verbose=4)
grid_result = grid.fit(x_train, y_train)
print("Best: %f using %s" % (grid_result.best_score_, grid_result.best_params_))
y_true, y_pred = np.argmax(y_test, axis=1), grid.predict(x_test)
print()
print(classification_report(y_true, y_pred))
print()
print(time.clock() - start)