{"cells":[{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"4f3cbc3a-d676-ccda-85a0-ae96cdc35968"},"outputs":[],"source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nfrom subprocess import check_output\nprint(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n\n# Any results you write to the current directory are saved as output."},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"5ae7bd9f-7fae-0895-6370-d9a01d3ec16f"},"outputs":[],"source":"from keras.models import Sequential\nfrom keras.models import Sequential\nfrom keras.layers.core import Dense, Activation, Flatten, Dropout\nfrom keras.layers.convolutional import Convolution2D\nfrom keras.layers.pooling import MaxPooling2D"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"edf8568f-44b8-a715-1ac9-e2dce31e9478"},"outputs":[],"source":"import zipfile\nwith zipfile.ZipFile(\"../input/train.7z\",\"r\") as zip_ref:\n    zip_ref.extractall(\"../input/train\")\n    "},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"0589ef9b-c972-2fcb-4658-735fd53d6d8e"},"outputs":[],"source":"\n\nmodel = Sequential()\nmodel.add(Convolution2D(32, 3, 3, input_shape=(32, 32, 3)))\nmodel.add(MaxPooling2D((2, 2)))\nmodel.add(Dropout(0.5))\nmodel.add(Activation('relu'))\nmodel.add(Flatten())\nmodel.add(Dense(128))\nmodel.add(Activation('relu'))\nmodel.add(Dense(43))\nmodel.add(Activation('softmax'))\n\n\n# There is no right or wrong answer. This is for you to explore model creation.\n\n\n# TODO: Compile and train the model\nmodel.compile('adam', 'categorical_crossentropy', ['accuracy'])\nhistory = model.fit(X_normalized, y_one_hot, nb_epoch=10, validation_split=0.2)"}],"metadata":{"_change_revision":0,"_is_fork":false,"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.6.0"}},"nbformat":4,"nbformat_minor":0}