MENU

Fun & Interesting

Optimizing Neural Network Structures with Keras-Tuner

sentdex 97,144 5 years ago
Video Not Working? Fix It Now

Tuning and optimizing neural networks with the Keras-Tuner package: https://keras-team.github.io/keras-tuner/ Kite AI autocomplete for Python download: https://kite.com/download/?utm_medium=referral&utm_source=youtube&utm_campaign=sentdex&utm_content=keras-tuner Text-based tutorial and sample code: https://pythonprogramming.net/keras-tuner-optimizing-neural-network-tutorial/ Starting model: from tensorflow import keras from tensorflow.keras.layers import Conv2D, MaxPooling2D, Dense, Flatten, Activation model = keras.models.Sequential() model.add(Conv2D(32, (3, 3), input_shape=x_train.shape[1:])) model.add(Activation('relu')) model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Conv2D(32, (3, 3))) model.add(Activation('relu')) model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Flatten()) # this converts our 3D feature maps to 1D feature vectors model.add(Dense(10)) model.add(Activation("softmax")) model.compile(optimizer="adam", loss="sparse_categorical_crossentropy", metrics=["accuracy"]) model.fit(x_train, y_train, batch_size=64, epochs=1, validation_data = (x_test, y_test)) Channel membership: https://www.youtube.com/channel/UCfzlCWGWYyIQ0aLC5w48gBQ/join Discord: https://discord.gg/sentdex Support the content: https://pythonprogramming.net/support-donate/ Twitter: https://twitter.com/sentdex Instagram: https://instagram.com/sentdex Facebook: https://www.facebook.com/pythonprogramming.net/ Twitch: https://www.twitch.tv/sentdex #deeplearning #tutorial #keras

Comment