<jupyter_start><jupyter_text>VGGNet Oxford Flowers classification  Set the seed<jupyter_code>import numpy as np
np.random.seed(42)<jupyter_output><empty_output><jupyter_text>Load dependencies<jupyter_code>import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D
from keras.layers.normalization import BatchNormalization
from keras.callbacks import TensorBoard<jupyter_output><empty_output><jupyter_text>Load and Process the data<jupyter_code>import tflearn.datasets.oxflower17 as oxflower17
X, Y = oxflower17.load_data(one_hot = True)<jupyter_output><empty_output><jupyter_text>Design Neural Network Architecture<jupyter_code>model = Sequential()
model.add(Conv2D(96, kernel_size = (11, 11), strides = (4, 4), activation = "relu", input_shape = (224, 224, 3)))
model.add(MaxPooling2D(pool_size = (3, 3), strides = (2, 2)))
model.add(BatchNormalization())

# Default strides = (1, 1)
model.add(Conv2D(256, kernel_size = (5, 5), activation = "relu"))
model.add(MaxPooling2D(pool_size = (3, 3), strides = (2, 2)))
model.add(BatchNormalization())

model.add(Conv2D(256, kernel_size = (3, 3), activation = "relu"))
model.add(Conv2D(384, kernel_size = (3, 3), activation = "relu"))
model.add(Conv2D(384, kernel_size = (3, 3), activation = "relu"))
model.add(MaxPooling2D(pool_size = (3, 3), strides = (2, 2)))
model.add(BatchNormalization())

model.add(Flatten())
model.add(Dense(4096, activation = "tanh"))
model.add(Dropout(0.5))
model.add(Dense(4096, activation = "tanh"))
model.add(Dropout(0.5))

model.add(Dense(17, activation = "softmax"))
model.summary()
model.compile(loss = "categorical_crossentropy", optimizer = "adam", metrics = ["accuracy"])<jupyter_output><empty_output><jupyter_text>TensorBoard<jupyter_code>tensorboard = TensorBoard("logs/vggnet")<jupyter_output><empty_output><jupyter_text>Train!<jupyter_code>model.fit(X, Y, batch_size = 64, epochs = 1, verbose = 1, validation_split = 0.1, shuffle = True, callbacks = [tensorboard])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15014720314033367, 'fraction_numerical': 0.042688910696761534, 'mean_word_length': 8.353211009174313, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '237082', 'license': 'MIT', 'n_tokens_mistral': 807, 'n_tokens_neox': 743, 'n_words': 143, 'path': 'notebooks/keras/vggnet-in-keras.ipynb', 'repo_name': 'ekholabs/workshop', 'size': '2038'}