{"metadata":{"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,"cells":[{"metadata":{"_cell_guid":"437f0f95-0c28-7458-26a4-e350948e91bf","_active":false,"collapsed":false},"source":"dd# 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)\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.","execution_count":null,"cell_type":"code","outputs":[],"execution_state":"idle"},{"metadata":{"_cell_guid":"d02827f1-aa63-6963-49ec-758e24df058b","_active":false,"collapsed":false},"source":"!ls ../input/train/","execution_count":null,"cell_type":"code","outputs":[],"execution_state":"idle"},{"metadata":{"_cell_guid":"95ea4ba1-4c62-621b-a3bc-f7233320ee2c","_active":false,"collapsed":false},"source":"import lasagne\nfrom theano import tensor as T\nimport numpy as np\nimport cv2\nimport os","execution_count":9,"cell_type":"code","outputs":[],"execution_state":"idle"},{"metadata":{"_cell_guid":"437f0f95-0c28-7458-26a4-e350948e91bf","_active":false,"collapsed":false},"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)\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.","execution_count":null,"cell_type":"code","outputs":[],"execution_state":"idle"},{"metadata":{"_cell_guid":"d02827f1-aa63-6963-49ec-758e24df058b","_active":false,"collapsed":false},"source":null,"execution_count":null,"cell_type":"code","outputs":[],"execution_state":"idle"},{"metadata":{"_cell_guid":"95ea4ba1-4c62-621b-a3bc-f7233320ee2c","_active":false,"collapsed":false},"source":null,"execution_count":null,"cell_type":"code","outputs":[],"execution_state":"idle"},{"metadata":{"_cell_guid":"6e1d3d58-0e66-5dd6-3aee-028b73345c9e","_active":true,"collapsed":false},"source":"inp = '../input/train/'\ndata = []\nfor fn in os.listdir(inp):\n    img = cv2.imread(os.path.join('../input/train/', fn), 0)\n    img = cv2.resize(img, (30, 30))\n    data.append(img + int(fn.startswith('dog')))\ndata = np.array(data)","execution_count":5,"cell_type":"code","outputs":[],"execution_state":"idle"},{"metadata":{"_cell_guid":"873fa3ec-212d-75a9-eb37-0d30702492d4","_active":false,"collapsed":false},"source":"img_var =  T.matrix(\"img_inp\",dtype='int32')\nclass_var = T.matrix(\"img_inp\",dtype='float32')","execution_count":10,"cell_type":"code","outputs":[],"execution_state":"idle"},{"metadata":{"_cell_guid":"1ed3a012-be6e-b203-a1f0-56d083af33dc","_active":false,"collapsed":false},"source":"img_inp = lasagne.layers.InputLayer((None,) + )","execution_count":null,"cell_type":"code","outputs":[]}]}