{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":59093,"databundleVersionId":7469972,"sourceType":"competition"},{"sourceId":7924798,"sourceType":"datasetVersion","datasetId":4617907},{"sourceId":167498142,"sourceType":"kernelVersion"}],"dockerImageVersionId":30646,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import sys\nsys.path.append('/kaggle/input/bottleneck-package')\nimport bottleneck\n\nimport pandas as pd\nimport numpy as np\nimport os\nimport psutil  \nimport random\n\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nfrom tensorflow.keras.optimizers import Adam\n\nfrom pathlib import Path\nimport shutil\nfrom tqdm import tqdm\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import accuracy_score\nimport matplotlib.pyplot as plt\nfrom functools import lru_cache\nfrom pympler import asizeof\n\nimport typing\nfrom dataclasses import dataclass\nfrom collections.abc import Callable\nfrom collections.abc import Sequence\n\nimport itertools","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:34.710372Z","iopub.execute_input":"2024-03-27T19:42:34.710688Z","iopub.status.idle":"2024-03-27T19:42:50.864257Z","shell.execute_reply.started":"2024-03-27T19:42:34.710663Z","shell.execute_reply":"2024-03-27T19:42:50.863368Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%run -i '/kaggle/input/hms-share/data-utils.py'\n%run -i '/kaggle/input/hms-share/eeg.py'\n%run -i '/kaggle/input/hms-share/spectr.py'\n%run -i '/kaggle/input/hms-share/target.py'\n%run -i '/kaggle/input/hms-share/eeg_id.py'\n%run -i '/kaggle/input/hms-share/data.py'","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:50.866052Z","iopub.execute_input":"2024-03-27T19:42:50.866715Z","iopub.status.idle":"2024-03-27T19:42:50.961104Z","shell.execute_reply.started":"2024-03-27T19:42:50.866683Z","shell.execute_reply":"2024-03-27T19:42:50.960294Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SUBMISSION = True\nSUBMISSION = False\nDEBUG = False\n#DEBUG = True\n\nVALIDATION_FRAC = 0.05\nif SUBMISSION:\n    DEBUG = False\n    VALIDATION_FRAC = None\n    \nTRAIN_SIZE = 512 if DEBUG else None\nSKIP_ASSERT = SUBMISSION or not DEBUG","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:50.962072Z","iopub.execute_input":"2024-03-27T19:42:50.962345Z","iopub.status.idle":"2024-03-27T19:42:50.967265Z","shell.execute_reply.started":"2024-03-27T19:42:50.962322Z","shell.execute_reply":"2024-03-27T19:42:50.966384Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"USE_GPU = True\nUSE_TPU = False # = True not tested yet","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:50.969429Z","iopub.execute_input":"2024-03-27T19:42:50.969792Z","iopub.status.idle":"2024-03-27T19:42:50.976297Z","shell.execute_reply.started":"2024-03-27T19:42:50.969762Z","shell.execute_reply":"2024-03-27T19:42:50.975394Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ADAM_LEARNING_RATE = 0.0001","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:50.977217Z","iopub.execute_input":"2024-03-27T19:42:50.977474Z","iopub.status.idle":"2024-03-27T19:42:50.987598Z","shell.execute_reply.started":"2024-03-27T19:42:50.977453Z","shell.execute_reply":"2024-03-27T19:42:50.986767Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"NUM_EPOCHS = 8\nNUM_SUB_EPOCHS = 5 if not DEBUG else 2\nBATCH_SIZE = 128","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:50.988597Z","iopub.execute_input":"2024-03-27T19:42:50.988898Z","iopub.status.idle":"2024-03-27T19:42:50.996998Z","shell.execute_reply.started":"2024-03-27T19:42:50.988876Z","shell.execute_reply":"2024-03-27T19:42:50.996154Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SPECTR_FRAME = 10 * 60 // 2","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:50.997965Z","iopub.execute_input":"2024-03-27T19:42:50.998235Z","iopub.status.idle":"2024-03-27T19:42:51.006252Z","shell.execute_reply.started":"2024-03-27T19:42:50.998214Z","shell.execute_reply":"2024-03-27T19:42:51.005324Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('SUBMISSION =', SUBMISSION)\nprint('USE_TPU =', USE_TPU)\nprint('USE_GPU =', USE_GPU)\nprint('DEBUG = ', DEBUG)","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:51.007244Z","iopub.execute_input":"2024-03-27T19:42:51.007497Z","iopub.status.idle":"2024-03-27T19:42:51.016189Z","shell.execute_reply.started":"2024-03-27T19:42:51.007476Z","shell.execute_reply":"2024-03-27T19:42:51.015342Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def size_2_str(value):\n    if value < 5 * 1024:\n        return str(value) + ' bytes'\n    if value < 5 * 1024 * 1024:\n        return str(value//1024) + ' KB'\n    return str(value//(1024*1024)) +' MB'\n\ndef get_mem_usage():\n    pid = os.getpid()\n    py = psutil.Process(pid)\n    return py.memory_info()[0] // 2 ** 20","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:51.017235Z","iopub.execute_input":"2024-03-27T19:42:51.017551Z","iopub.status.idle":"2024-03-27T19:42:51.025862Z","shell.execute_reply.started":"2024-03-27T19:42:51.017528Z","shell.execute_reply":"2024-03-27T19:42:51.025027Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"if USE_TPU:\n    tpu = tf.distribute.cluster_resolver.TPUClusterResolver()\n    tf.tpu.experimental.initialize_tpu_system(tpu)\n    tpu_strategy = tf.distribute.TPUStrategy(tpu)","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:51.030480Z","iopub.execute_input":"2024-03-27T19:42:51.030762Z","iopub.status.idle":"2024-03-27T19:42:51.035711Z","shell.execute_reply.started":"2024-03-27T19:42:51.030740Z","shell.execute_reply":"2024-03-27T19:42:51.034828Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SPECTR_NUM_FEATURES = 4\nSPECTR_NUM_CHANALS = 100\nSPECTR_MODEL_WINDOW = 99","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:51.036576Z","iopub.execute_input":"2024-03-27T19:42:51.036874Z","iopub.status.idle":"2024-03-27T19:42:51.047756Z","shell.execute_reply.started":"2024-03-27T19:42:51.036852Z","shell.execute_reply":"2024-03-27T19:42:51.046927Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def create_spectr_model():\n    input = keras.layers.Input(\n        shape = (SPECTR_MODEL_WINDOW, SPECTR_NUM_FEATURES, SPECTR_NUM_CHANALS), name = 'spectr.input'\n    )\n    model = keras.layers.Conv2D(\n        filters = 27, kernel_size = (1,1),  \n        name = 'spectr.0', activation = 'tanh'\n    )(input)\n    model = keras.layers.Conv2D(\n        filters = 31, kernel_size = (3,1),  \n        name = 'spectr.1', activation = 'tanh'\n    )(model)\n    model = keras.layers.MaxPooling2D(\n        pool_size = (7,1), strides = (3,1), \n        name = 'spectr.1.max')(model)\n    model = keras.layers.Conv2D(\n        filters = 37, kernel_size = (5,1),  \n        name = 'spectr.2', activation = 'tanh'\n    )(model)\n    model = keras.layers.MaxPooling2D(\n        pool_size = (7,1), strides = (3,1), name = 'spectr.2.max'\n    )(model)\n    model = keras.layers.Conv2D(\n        filters = 41, kernel_size = (5,1), \n        name = 'spectr.3', activation = 'tanh'\n    )(model)\n    model = keras.layers.MaxPooling2D(\n        pool_size = (3,1), strides = (3,1), name = 'spectr.3.max'\n    )(model)\n#    model = keras.layers.Conv2D(\n#        filters = 31, kernel_size = (7,1), name = 'spectr.4', activation = 'tanh'\n#    )(model)\n#    model = keras.layers.AveragePooling2D(pool_size = (7,1), strides = (3,1), name = 'spectr.4.max')(model)\n#    model = keras.layers.Conv2D(\n#        filters = 27, kernel_size = (5,1), \n#        name = 'spectr.5', activation = 'tanh'\n#    )(model)\n#    model = keras.layers.AveragePooling2D(pool_size = (7,1), strides = (3,1), name = 'spectr.5.max')(model)\n    model  = keras.layers.Flatten(name = 'spectr.flatten')(model)\n    model  = keras.layers.Dense(\n        units = 13, activation='relu', name = 'spectr.dense.1'\n    )(model)\n    model  = keras.layers.Dense(\n        units = 13, activation='relu', name = 'spectr.dense.2'\n    )(model)\n    model  = keras.layers.Dense(\n        units = len(Target.FEATURES), activation='softmax',name = 'spectr.dense.output'\n    )(model)\n    return keras.models.Model(inputs = input, outputs = model)","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:51.048702Z","iopub.execute_input":"2024-03-27T19:42:51.048939Z","iopub.status.idle":"2024-03-27T19:42:51.060152Z","shell.execute_reply.started":"2024-03-27T19:42:51.048910Z","shell.execute_reply":"2024-03-27T19:42:51.059385Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def create_and_compile_model():\n    model = create_spectr_model()\n    optimizer = Adam(learning_rate = ADAM_LEARNING_RATE)\n    model.compile(loss='categorical_crossentropy', optimizer= optimizer, metrics=['acc'])\n    return model","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:51.061237Z","iopub.execute_input":"2024-03-27T19:42:51.061564Z","iopub.status.idle":"2024-03-27T19:42:51.079726Z","shell.execute_reply.started":"2024-03-27T19:42:51.061535Z","shell.execute_reply":"2024-03-27T19:42:51.078953Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"if USE_TPU:\n    with tpu_strategy.scope():\n        model = create_and_compile_model()\n\nelse:\n    model = create_and_compile_model()\n    \nmodel.summary()\nkeras.utils.plot_model(model, 'model.png', show_shapes=True)","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:51.080859Z","iopub.execute_input":"2024-03-27T19:42:51.081144Z","iopub.status.idle":"2024-03-27T19:42:52.452698Z","shell.execute_reply.started":"2024-03-27T19:42:51.081121Z","shell.execute_reply":"2024-03-27T19:42:52.451758Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def reshape_spectr_data(data):\n    data = np.nan_to_num(data)\n    data = bottleneck.move_max(data, 5, min_count = 1, axis = 0)\n    maxdata = np.max(data, axis = 0, keepdims = True)\n    maxdata[maxdata == 0] = 1\n    data = data[5::3] / maxdata\n    return np.reshape(data, newshape = (len(data), SPECTR_NUM_FEATURES, SPECTR_NUM_CHANALS)) ","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:52.453753Z","iopub.execute_input":"2024-03-27T19:42:52.454039Z","iopub.status.idle":"2024-03-27T19:42:52.460265Z","shell.execute_reply.started":"2024-03-27T19:42:52.454014Z","shell.execute_reply":"2024-03-27T19:42:52.459395Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def create_spectr_model_input(ids, loader, batch_size):\n    spectr = DataUtils.TransformSequence(ids, loader)\n    spectr = DataUtils.TransformSequence(spectr, reshape_spectr_data)\n    spectr = DataUtils.BatchedSequence(\n        spectr, batch_size, \n        item_dtype = np.float64, \n        item_shape = (SPECTR_MODEL_WINDOW, SPECTR_NUM_FEATURES, SPECTR_NUM_CHANALS) \n    )    \n    return spectr    \n    ","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:52.461507Z","iopub.execute_input":"2024-03-27T19:42:52.461789Z","iopub.status.idle":"2024-03-27T19:42:52.472483Z","shell.execute_reply.started":"2024-03-27T19:42:52.461767Z","shell.execute_reply":"2024-03-27T19:42:52.471670Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def build_train_data(\n    ids,\n    spectr_loader, \n    target_loader\n):\n    spectr = create_spectr_model_input(ids, spectr_loader, BATCH_SIZE)\n    target = Target.create_model_data(ids, target_loader, BATCH_SIZE)  \n    \n    spectr_target_seq = DataUtils.JoinSequence(spectr, target)\n    return DataUtils.AsKerasSequence(spectr_target_seq, lambda : random.shuffle(ids))\n    ","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:52.473721Z","iopub.execute_input":"2024-03-27T19:42:52.474098Z","iopub.status.idle":"2024-03-27T19:42:52.484419Z","shell.execute_reply.started":"2024-03-27T19:42:52.474065Z","shell.execute_reply":"2024-03-27T19:42:52.483649Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_size, _, spectr_train_loader, target_train_loader \\\n    = Data.load_train(TRAIN_SIZE)\n\ntrain_ids = list([x for x in range(train_size)])\nif VALIDATION_FRAC > 0:\n    train_ids, valid_ids = train_test_split(train_ids, test_size = VALIDATION_FRAC)\n    \ntrain_data = build_train_data(train_ids, spectr_train_loader, target_train_loader)\nif VALIDATION_FRAC > 0:\n    valid_data = build_train_data(valid_ids, spectr_train_loader, target_train_loader) \nelse:\n    valid_data = None \n    \ntrain_data = DataUtils.SplitSubEpoches(train_data, NUM_SUB_EPOCHS)","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:52.485421Z","iopub.execute_input":"2024-03-27T19:42:52.485718Z","iopub.status.idle":"2024-03-27T19:42:52.766492Z","shell.execute_reply.started":"2024-03-27T19:42:52.485696Z","shell.execute_reply":"2024-03-27T19:42:52.765653Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"device_name = tf.test.gpu_device_name()\nif \"GPU\" not in device_name:\n    print(\"GPU device not found\")\nprint('Found GPU at: {}'.format(device_name))","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:52.767742Z","iopub.execute_input":"2024-03-27T19:42:52.768088Z","iopub.status.idle":"2024-03-27T19:42:52.776962Z","shell.execute_reply.started":"2024-03-27T19:42:52.768059Z","shell.execute_reply":"2024-03-27T19:42:52.775787Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\n\ndef fit_model(model, train_data, epochs, validation_data):\n    if USE_GPU:\n        with tf.device('/gpu:0'):\n            return model.fit(\n                train_data, \n                epochs = epochs, \n                validation_data = validation_data)\n    else:\n        return model.fit(\n            train_data, \n            epochs = epochs, \n            validation_data = validation_data)\n        \nhistory = fit_model(\n    model,\n    train_data, \n    NUM_EPOCHS * NUM_SUB_EPOCHS, \n    valid_data\n)","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:42:52.778558Z","iopub.execute_input":"2024-03-27T19:42:52.778939Z","iopub.status.idle":"2024-03-27T19:44:41.138016Z","shell.execute_reply.started":"2024-03-27T19:42:52.778907Z","shell.execute_reply":"2024-03-27T19:44:41.137116Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(history.history['loss'], 'r', label='Training loss')\nif VALIDATION_FRAC > 0:\n    plt.plot(history.history['val_loss'], 'g', label='Validation loss')\nplt.title('Training VS Validation loss')\nplt.xlabel('No. of Epochs')\nplt.ylabel('Loss')\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:41.139073Z","iopub.execute_input":"2024-03-27T19:44:41.139330Z","iopub.status.idle":"2024-03-27T19:44:41.395049Z","shell.execute_reply.started":"2024-03-27T19:44:41.139308Z","shell.execute_reply":"2024-03-27T19:44:41.394097Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(history.history['acc'], 'r', label='Training accuracy')\nif VALIDATION_FRAC > 0:\n    plt.plot(history.history['val_acc'], 'g', label='Validation accuracy')\nplt.title('Training Vs Validation Accuracy')\nplt.xlabel('No. of Epochs')\nplt.ylabel('Accuracy')\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:41.396398Z","iopub.execute_input":"2024-03-27T19:44:41.396773Z","iopub.status.idle":"2024-03-27T19:44:41.645186Z","shell.execute_reply.started":"2024-03-27T19:44:41.396741Z","shell.execute_reply":"2024-03-27T19:44:41.644201Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('--------------- model fitted ----------------------')","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:41.646527Z","iopub.execute_input":"2024-03-27T19:44:41.646995Z","iopub.status.idle":"2024-03-27T19:44:41.652050Z","shell.execute_reply.started":"2024-03-27T19:44:41.646961Z","shell.execute_reply":"2024-03-27T19:44:41.651137Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def check_validation():\n    y_true = []\n    y_predict = []\n    for index in range(len(valid_data)):\n        train_batch, target_batch = valid_data[index]\n        predict = model.predict(train_batch)\n        decision = Target.make_decision(predict)\n        target_decision = Target.make_decision(target_batch)\n        for i in range(len(decision)):\n            y_predict.append(decision[i])\n            y_true.append(target_decision[i])\n    print('accuracy =', accuracy_score(y_true, y_predict))","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:41.653335Z","iopub.execute_input":"2024-03-27T19:44:41.653602Z","iopub.status.idle":"2024-03-27T19:44:41.662941Z","shell.execute_reply.started":"2024-03-27T19:44:41.653580Z","shell.execute_reply":"2024-03-27T19:44:41.661996Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\n\nif VALIDATION_FRAC > 0:\n    if USE_GPU:\n        with tf.device('/gpu:0'):\n            check_validation()\n    else:\n        check_validation()","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:41.664003Z","iopub.execute_input":"2024-03-27T19:44:41.664301Z","iopub.status.idle":"2024-03-27T19:44:42.862748Z","shell.execute_reply.started":"2024-03-27T19:44:41.664277Z","shell.execute_reply":"2024-03-27T19:44:42.861827Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('mem usage =', size_2_str(get_mem_usage()))\ndel spectr_train_loader, target_train_loader","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:42.863717Z","iopub.execute_input":"2024-03-27T19:44:42.863994Z","iopub.status.idle":"2024-03-27T19:44:42.869453Z","shell.execute_reply.started":"2024-03-27T19:44:42.863971Z","shell.execute_reply":"2024-03-27T19:44:42.868568Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def build_test_data(test_size, spectr_loader, eeg_id_loader):\n    indexes = list([x for x in range(test_size)])\n   \n    spectr = create_spectr_model_input(indexes, spectr_loader, BATCH_SIZE)\n    eeg_id = EEG_ID.create_model_data(indexes, eeg_id_loader, BATCH_SIZE)\n    \n    spectr_eeg_id_seq = DataUtils.JoinSequence(spectr, eeg_id)\n    return DataUtils.AsKerasSequence(spectr_eeg_id_seq)","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:42.870629Z","iopub.execute_input":"2024-03-27T19:44:42.870963Z","iopub.status.idle":"2024-03-27T19:44:42.879516Z","shell.execute_reply.started":"2024-03-27T19:44:42.870933Z","shell.execute_reply":"2024-03-27T19:44:42.878748Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_size, _, test_spectr_loader, test_eeg_id_loader = Data.load_test()\ntest_data = build_test_data(test_size, test_spectr_loader, test_eeg_id_loader)","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:42.884916Z","iopub.execute_input":"2024-03-27T19:44:42.885176Z","iopub.status.idle":"2024-03-27T19:44:42.893635Z","shell.execute_reply.started":"2024-03-27T19:44:42.885154Z","shell.execute_reply":"2024-03-27T19:44:42.892874Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\n\noutput = []\nfor index in range(len(test_data)):\n    batch, eeg_ids = test_data[index]\n    predict = model.predict(batch)\n    for i in range(len(eeg_ids)):\n        res = [*eeg_ids[i]]\n        res.extend(predict[i].tolist())\n        output.append(res)\noutput = pd.DataFrame(\n    data = output,\n    columns = ['eeg_id'] + Target.FEATURES\n)\noutput.to_csv('submission.csv', index = False)\n","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:42.895012Z","iopub.execute_input":"2024-03-27T19:44:42.895295Z","iopub.status.idle":"2024-03-27T19:44:43.264261Z","shell.execute_reply.started":"2024-03-27T19:44:42.895272Z","shell.execute_reply":"2024-03-27T19:44:43.263362Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model.save('spectr_model.keras')","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:43.265266Z","iopub.execute_input":"2024-03-27T19:44:43.265524Z","iopub.status.idle":"2024-03-27T19:44:43.348551Z","shell.execute_reply.started":"2024-03-27T19:44:43.265503Z","shell.execute_reply":"2024-03-27T19:44:43.347825Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('--------------- submission done ----------------------')","metadata":{"execution":{"iopub.status.busy":"2024-03-27T19:44:43.349604Z","iopub.execute_input":"2024-03-27T19:44:43.349935Z","iopub.status.idle":"2024-03-27T19:44:43.354760Z","shell.execute_reply.started":"2024-03-27T19:44:43.349911Z","shell.execute_reply":"2024-03-27T19:44:43.353809Z"},"trusted":true},"execution_count":null,"outputs":[]}]}