{"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"colab":{"provenance":[]},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":3004,"databundleVersionId":861823,"sourceType":"competition"}],"dockerImageVersionId":30886,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import tensorflow as tf\nfrom tensorflow import keras","metadata":{"id":"vm4MlG6SBNuA","trusted":true,"execution":{"iopub.status.busy":"2025-02-14T15:46:44.849416Z","iopub.execute_input":"2025-02-14T15:46:44.849775Z","iopub.status.idle":"2025-02-14T15:47:03.794642Z","shell.execute_reply.started":"2025-02-14T15:46:44.849739Z","shell.execute_reply":"2025-02-14T15:47:03.793476Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"(X_train,y_train),(X_test,y_test)=tf.keras.datasets.mnist.load_data()","metadata":{"id":"C_WPNj7gEanK","trusted":true,"execution":{"iopub.status.busy":"2025-02-14T15:47:03.796052Z","iopub.execute_input":"2025-02-14T15:47:03.796725Z","iopub.status.idle":"2025-02-14T15:47:04.448026Z","shell.execute_reply.started":"2025-02-14T15:47:03.796687Z","shell.execute_reply":"2025-02-14T15:47:04.446948Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X_train=X_train/255\nX_test=X_test/255","metadata":{"id":"Ba2PQzqHEzAL","trusted":true,"execution":{"iopub.status.busy":"2025-02-14T15:47:04.453757Z","iopub.execute_input":"2025-02-14T15:47:04.454166Z","iopub.status.idle":"2025-02-14T15:47:04.690838Z","shell.execute_reply.started":"2025-02-14T15:47:04.454123Z","shell.execute_reply":"2025-02-14T15:47:04.689500Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"m=keras.Sequential([\n    keras.layers.Flatten(input_shape=(28,28)),\n    keras.layers.Dense(128,activation=\"relu\"),\n    keras.layers.Dense(138,activation=\"relu\"),\n    keras.layers.Dense(10,activation=\"softmax\")\n                    ])","metadata":{"id":"nrSGqK0sBOt_","outputId":"710ddfce-d803-4150-c0a3-bf002de4b17c","trusted":true,"execution":{"iopub.status.busy":"2025-02-14T15:47:04.692011Z","iopub.execute_input":"2025-02-14T15:47:04.692300Z","iopub.status.idle":"2025-02-14T15:47:04.797937Z","shell.execute_reply.started":"2025-02-14T15:47:04.692275Z","shell.execute_reply":"2025-02-14T15:47:04.796688Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"m.compile(optimizer=\"adam\",loss=\"sparse_categorical_crossentropy\", metrics=[\"accuracy\"])","metadata":{"id":"vphQCjDUBQXB","trusted":true,"execution":{"iopub.status.busy":"2025-02-14T15:47:04.798999Z","iopub.execute_input":"2025-02-14T15:47:04.799316Z","iopub.status.idle":"2025-02-14T15:47:04.815650Z","shell.execute_reply.started":"2025-02-14T15:47:04.799291Z","shell.execute_reply":"2025-02-14T15:47:04.814395Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"m.fit(X_train,y_train,epochs=10)","metadata":{"id":"j63KsM_SBQ-P","outputId":"80918381-6eee-423d-e202-37df1ea25d3b","trusted":true,"execution":{"iopub.status.busy":"2025-02-14T15:47:04.816647Z","iopub.execute_input":"2025-02-14T15:47:04.816971Z","iopub.status.idle":"2025-02-14T15:48:00.791209Z","shell.execute_reply.started":"2025-02-14T15:47:04.816944Z","shell.execute_reply":"2025-02-14T15:48:00.790159Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"m.evaluate(X_test,y_test)","metadata":{"id":"lPKMy1QwBRoB","outputId":"7b6fbe08-f0e2-403a-b22b-5254b3121cc3","trusted":true,"execution":{"iopub.status.busy":"2025-02-14T15:48:00.792337Z","iopub.execute_input":"2025-02-14T15:48:00.792756Z","iopub.status.idle":"2025-02-14T15:48:01.557937Z","shell.execute_reply.started":"2025-02-14T15:48:00.792727Z","shell.execute_reply":"2025-02-14T15:48:01.556828Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"m.summary()","metadata":{"id":"MYI9gYQhAQQ2","outputId":"74f7d9cd-72e1-4b58-d641-3bd4fd27e311","trusted":true,"execution":{"iopub.status.busy":"2025-02-14T15:48:01.560250Z","iopub.execute_input":"2025-02-14T15:48:01.560563Z","iopub.status.idle":"2025-02-14T15:48:01.583154Z","shell.execute_reply.started":"2025-02-14T15:48:01.560538Z","shell.execute_reply":"2025-02-14T15:48:01.582059Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"id":"92EU0S07BSM-","trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"id":"2o81gnhTAQTz","trusted":true},"outputs":[],"execution_count":null}]}