{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.7.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":21755,"databundleVersionId":1475600,"sourceType":"competition"}],"dockerImageVersionId":30301,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"## Importing required libraries","metadata":{}},{"cell_type":"code","source":"import scipy.io\nimport scipy.misc\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import imshow\nfrom PIL import Image\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.framework.ops import EagerTensor\nimport pprint as pp\n%matplotlib inline","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:34.017051Z","iopub.execute_input":"2023-11-18T11:57:34.017615Z","iopub.status.idle":"2023-11-18T11:57:39.907487Z","shell.execute_reply.started":"2023-11-18T11:57:34.017522Z","shell.execute_reply":"2023-11-18T11:57:39.906471Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Checking size of content images\nim = Image.open('/kaggle/input/gan-getting-started/photo_jpg/7c0d9a98f6.jpg')\nprint(im.size)\nim = Image.open('/kaggle/input/gan-getting-started/photo_jpg/6bc7d64fb6.jpg')\nprint(im.size)","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:39.909669Z","iopub.execute_input":"2023-11-18T11:57:39.910336Z","iopub.status.idle":"2023-11-18T11:57:39.937041Z","shell.execute_reply.started":"2023-11-18T11:57:39.910299Z","shell.execute_reply":"2023-11-18T11:57:39.936103Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Checking size of style images\nim = Image.open('/kaggle/input/gan-getting-started/monet_jpg/40d7d18ad3.jpg')\nprint(im.size)\nim = Image.open('/kaggle/input/gan-getting-started/monet_jpg/d087730b76.jpg')\nprint(im.size)","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:39.939912Z","iopub.execute_input":"2023-11-18T11:57:39.940237Z","iopub.status.idle":"2023-11-18T11:57:39.960201Z","shell.execute_reply.started":"2023-11-18T11:57:39.940207Z","shell.execute_reply":"2023-11-18T11:57:39.959209Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Loading imagenet weights from vgg19\nimg_size = 256\nvgg = tf.keras.applications.VGG19(include_top=False,\n                                  input_shape=(img_size, img_size, 3),\n                                  weights='imagenet')\nvgg.trainable = False\npp.pprint(vgg)","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:39.962295Z","iopub.execute_input":"2023-11-18T11:57:39.962921Z","iopub.status.idle":"2023-11-18T11:57:46.370794Z","shell.execute_reply.started":"2023-11-18T11:57:39.962893Z","shell.execute_reply":"2023-11-18T11:57:46.369720Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### View various content images","metadata":{}},{"cell_type":"code","source":"content_image = Image.open('/kaggle/input/gan-getting-started/photo_jpg/7c0d9a98f6.jpg')\ncontent_image","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.372122Z","iopub.execute_input":"2023-11-18T11:57:46.372523Z","iopub.status.idle":"2023-11-18T11:57:46.409126Z","shell.execute_reply.started":"2023-11-18T11:57:46.372493Z","shell.execute_reply":"2023-11-18T11:57:46.408147Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"content_image = Image.open('/kaggle/input/gan-getting-started/photo_jpg/6bc7d64fb6.jpg')\ncontent_image","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.410576Z","iopub.execute_input":"2023-11-18T11:57:46.410884Z","iopub.status.idle":"2023-11-18T11:57:46.445391Z","shell.execute_reply.started":"2023-11-18T11:57:46.410857Z","shell.execute_reply":"2023-11-18T11:57:46.444207Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Computing content cost to ensure G and C have similar content","metadata":{}},{"cell_type":"code","source":"def compute_content_cost(content_output, generated_output):\n    \"\"\"\n    Computes the content cost\n   \n    Returns: \n    J_content -- scalar, content cost\n    \"\"\"\n    #Retreive dimensions properly using tensorflow\n    a_C = content_output[-1]\n    a_G = generated_output[-1]\n    \n    #Reshape\n    m, n_H, n_W, n_C = a_G.get_shape().as_list()\n    a_C_unrolled = tf.reshape(a_C, shape = [m, n_C, n_H * n_W])\n    a_G_unrolled = tf.reshape(a_G, shape = [m, n_C, n_H * n_W])\n    \n    #Compute content loss for generated image\n    J_content = tf.reduce_sum(tf.square(tf.subtract(a_C, a_G)), axis = None) / (4 * n_H * n_W * n_C)\n    \n    return J_content","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.446929Z","iopub.execute_input":"2023-11-18T11:57:46.447757Z","iopub.status.idle":"2023-11-18T11:57:46.458867Z","shell.execute_reply.started":"2023-11-18T11:57:46.447722Z","shell.execute_reply":"2023-11-18T11:57:46.457848Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### View various style images","metadata":{}},{"cell_type":"code","source":"style_image = Image.open('/kaggle/input/gan-getting-started/monet_jpg/40d7d18ad3.jpg')\nstyle_image","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.460471Z","iopub.execute_input":"2023-11-18T11:57:46.460865Z","iopub.status.idle":"2023-11-18T11:57:46.496018Z","shell.execute_reply.started":"2023-11-18T11:57:46.460820Z","shell.execute_reply":"2023-11-18T11:57:46.495072Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"style_image = Image.open('/kaggle/input/gan-getting-started/monet_jpg/d087730b76.jpg')\nstyle_image","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.497161Z","iopub.execute_input":"2023-11-18T11:57:46.498109Z","iopub.status.idle":"2023-11-18T11:57:46.530662Z","shell.execute_reply.started":"2023-11-18T11:57:46.498067Z","shell.execute_reply":"2023-11-18T11:57:46.529633Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Computing Style Cost","metadata":{}},{"cell_type":"code","source":"# Computing Gram matrix\ndef gram_matrix(A):\n    GA = tf.matmul(A, tf.transpose(A))\n    return GA","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.534455Z","iopub.execute_input":"2023-11-18T11:57:46.534753Z","iopub.status.idle":"2023-11-18T11:57:46.539556Z","shell.execute_reply.started":"2023-11-18T11:57:46.534725Z","shell.execute_reply":"2023-11-18T11:57:46.538597Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def compute_layer_style_cost(a_S, a_G):\n    \"\"\"\n    Arguments:\n    a_S -- tensor of dimension (1, n_H, n_W, n_C), hidden layer activations representing style of the image S \n    a_G -- tensor of dimension (1, n_H, n_W, n_C), hidden layer activations representing style of the image G\n    \n    Returns: \n    J_style_layer -- tensor representing a scalar value, style cost\n    \"\"\"\n    # Retrieve dimensions from a_G\n    m, n_H, n_W, n_C = a_G.get_shape().as_list()\n    \n    #Reshape\n    a_S = tf.transpose(tf.reshape(a_S, [n_H * n_W, n_C]))\n    a_G = tf.transpose(tf.reshape(a_G, [n_H * n_W, n_C]))\n    \n    #Computing gram matrices for both style and generated images\n    a_S = tf.transpose(tf.reshape(a_S, [n_H * n_W, n_C]))\n    a_G = tf.transpose(tf.reshape(a_G, [n_H * n_W, n_C]))\n    \n    # Computing gram_matrices for both images S and G \n    GS = gram_matrix(a_S)\n    GG = gram_matrix(a_G)\n    \n    #Computing style loss\n    J_style_layer = tf.reduce_sum(tf.square(tf.subtract(GS, GG)), axis = None) / (4 * (n_H * n_W) ** 2 * n_C ** 2)\n    \n    return J_style_layer","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.540995Z","iopub.execute_input":"2023-11-18T11:57:46.541329Z","iopub.status.idle":"2023-11-18T11:57:46.552128Z","shell.execute_reply.started":"2023-11-18T11:57:46.541303Z","shell.execute_reply":"2023-11-18T11:57:46.551082Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### choose layers to represent style","metadata":{"execution":{"iopub.status.busy":"2023-04-28T11:37:26.718538Z","iopub.execute_input":"2023-04-28T11:37:26.719279Z","iopub.status.idle":"2023-04-28T11:37:26.729864Z","shell.execute_reply.started":"2023-04-28T11:37:26.719234Z","shell.execute_reply":"2023-04-28T11:37:26.728973Z"}}},{"cell_type":"code","source":"for layer in vgg.layers:\n    print(layer.name)","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.553717Z","iopub.execute_input":"2023-11-18T11:57:46.554319Z","iopub.status.idle":"2023-11-18T11:57:46.565698Z","shell.execute_reply.started":"2023-11-18T11:57:46.554283Z","shell.execute_reply":"2023-11-18T11:57:46.564500Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"STYLE_LAYERS = [\n    ('block1_conv1', 0.2),\n    ('block2_conv1', 0.2),\n    ('block3_conv1', 0.2),\n    ('block4_conv1', 0.2),\n    ('block5_conv1', 0.2)]","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.566961Z","iopub.execute_input":"2023-11-18T11:57:46.567318Z","iopub.status.idle":"2023-11-18T11:57:46.577020Z","shell.execute_reply.started":"2023-11-18T11:57:46.567291Z","shell.execute_reply":"2023-11-18T11:57:46.576003Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def compute_style_cost(style_image_output, generated_image_output, STYLE_LAYERS=STYLE_LAYERS):\n    \"\"\"\n    Computes the overall style cost from several chosen layers\n    \n    \"\"\"\n    \n    # initialize the overall style cost\n    J_style = 0\n    # a_S is the hidden layer activation from the layer we have selected.\n    # The first element of the array contains the input layer image, so skipping that\n    a_S = style_image_output[1:]\n\n    # a_G is the output of the choosen hidden layers.\n    a_G = generated_image_output[1:]\n    for i, weight in zip(range(len(a_S)), STYLE_LAYERS):  \n        J_style_layer = compute_layer_style_cost(a_S[i], a_G[i])\n        J_style += weight[1] * J_style_layer\n\n    return J_style","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.578285Z","iopub.execute_input":"2023-11-18T11:57:46.578652Z","iopub.status.idle":"2023-11-18T11:57:46.588689Z","shell.execute_reply.started":"2023-11-18T11:57:46.578613Z","shell.execute_reply":"2023-11-18T11:57:46.587606Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"@tf.function()\ndef total_cost(J_content, J_style, alpha = 10, beta = 40):\n    \"\"\"\n    Computes the total cost function\n    \"\"\"\n    \n    J = alpha * J_content + beta * J_style\n    \n    return J","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.590205Z","iopub.execute_input":"2023-11-18T11:57:46.590576Z","iopub.status.idle":"2023-11-18T11:57:46.603929Z","shell.execute_reply.started":"2023-11-18T11:57:46.590539Z","shell.execute_reply":"2023-11-18T11:57:46.602928Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Load the content image","metadata":{}},{"cell_type":"code","source":"content_image = np.array(Image.open('/kaggle/input/gan-getting-started/photo_jpg/7c0d9a98f6.jpg').resize((img_size, img_size)))\ncontent_image = tf.constant(np.reshape(content_image, ((1,) + content_image.shape)))\n\nprint(content_image.shape)\nimshow(content_image[0])\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:46.605263Z","iopub.execute_input":"2023-11-18T11:57:46.605640Z","iopub.status.idle":"2023-11-18T11:57:47.022427Z","shell.execute_reply.started":"2023-11-18T11:57:46.605614Z","shell.execute_reply":"2023-11-18T11:57:47.021112Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Load the style image","metadata":{}},{"cell_type":"code","source":"style_image =  np.array(Image.open('/kaggle/input/gan-getting-started/monet_jpg/40d7d18ad3.jpg').resize((img_size, img_size)))\nstyle_image = tf.constant(np.reshape(style_image, ((1,) + style_image.shape)))\n\nprint(style_image.shape)\nimshow(style_image[0])\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:47.023724Z","iopub.execute_input":"2023-11-18T11:57:47.024132Z","iopub.status.idle":"2023-11-18T11:57:47.259743Z","shell.execute_reply.started":"2023-11-18T11:57:47.024092Z","shell.execute_reply":"2023-11-18T11:57:47.258707Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Randomly initialize the image to be generated","metadata":{}},{"cell_type":"code","source":"generated_image = tf.Variable(tf.image.convert_image_dtype(content_image, tf.float32))\nnoise = tf.random.uniform(tf.shape(generated_image), 0, 0.5)\ngenerated_image = tf.add(generated_image, noise)\ngenerated_image = tf.clip_by_value(generated_image, clip_value_min=0.0, clip_value_max=1.0)\n\nprint(generated_image.shape)\nimshow(generated_image.numpy()[0])\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:47.261075Z","iopub.execute_input":"2023-11-18T11:57:47.261442Z","iopub.status.idle":"2023-11-18T11:57:47.498965Z","shell.execute_reply.started":"2023-11-18T11:57:47.261413Z","shell.execute_reply":"2023-11-18T11:57:47.497817Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Load pre-trained VGG19 model","metadata":{}},{"cell_type":"code","source":"def get_layer_outputs(vgg, layer_names):\n    \"\"\" Creates a vgg model that returns a list of intermediate output values.\"\"\"\n    outputs = [vgg.get_layer(layer[0]).output for layer in layer_names]\n\n    model = tf.keras.Model([vgg.input], outputs)\n    return model","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:47.500545Z","iopub.execute_input":"2023-11-18T11:57:47.501454Z","iopub.status.idle":"2023-11-18T11:57:47.508712Z","shell.execute_reply.started":"2023-11-18T11:57:47.501414Z","shell.execute_reply":"2023-11-18T11:57:47.507437Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Define content layer and build the model","metadata":{}},{"cell_type":"code","source":"content_layer = [('block5_conv4', 1)]\n\nvgg_model_outputs = get_layer_outputs(vgg, STYLE_LAYERS + content_layer)","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:47.510495Z","iopub.execute_input":"2023-11-18T11:57:47.510946Z","iopub.status.idle":"2023-11-18T11:57:47.527019Z","shell.execute_reply.started":"2023-11-18T11:57:47.510905Z","shell.execute_reply":"2023-11-18T11:57:47.525958Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"content_target = vgg_model_outputs(content_image)  # Content encoder\nstyle_targets = vgg_model_outputs(style_image)     # Style enconder","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:47.528605Z","iopub.execute_input":"2023-11-18T11:57:47.529026Z","iopub.status.idle":"2023-11-18T11:57:56.457506Z","shell.execute_reply.started":"2023-11-18T11:57:47.528985Z","shell.execute_reply":"2023-11-18T11:57:56.456619Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Compute content cost","metadata":{}},{"cell_type":"code","source":"preprocessed_content =  tf.Variable(tf.image.convert_image_dtype(content_image, tf.float32))\na_C = vgg_model_outputs(preprocessed_content)\na_G = vgg_model_outputs(generated_image)\n\n# Compute the content cost\nJ_content = compute_content_cost(a_C, a_G)\n\nprint(J_content)","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:56.458622Z","iopub.execute_input":"2023-11-18T11:57:56.458962Z","iopub.status.idle":"2023-11-18T11:57:56.506371Z","shell.execute_reply.started":"2023-11-18T11:57:56.458922Z","shell.execute_reply":"2023-11-18T11:57:56.505418Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Compute Style Cost","metadata":{}},{"cell_type":"code","source":"# Assign the input of the model to be the \"style\" image \npreprocessed_style =  tf.Variable(tf.image.convert_image_dtype(style_image, tf.float32))\na_S = vgg_model_outputs(preprocessed_style)\n\n# Compute the style cost\nJ_style = compute_style_cost(a_S, a_G)\nprint(J_style)","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:56.507723Z","iopub.execute_input":"2023-11-18T11:57:56.508197Z","iopub.status.idle":"2023-11-18T11:57:56.559077Z","shell.execute_reply.started":"2023-11-18T11:57:56.508135Z","shell.execute_reply":"2023-11-18T11:57:56.558189Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Utility functions to display the images generated by the style transfer model\ndef clip_0_1(image):\n    \"\"\"\n    Truncate all the pixels in the tensor to be between 0 and 1\n    \n    Arguments:\n    image -- Tensor\n    J_style -- style cost coded above\n\n    Returns:\n    Tensor\n    \"\"\"\n    return tf.clip_by_value(image, clip_value_min=0.0, clip_value_max=1.0)\n\ndef tensor_to_image(tensor):\n    \"\"\"\n    Converts the given tensor into a PIL image\n    \n    Arguments:\n    tensor -- Tensor\n    \n    Returns:\n    Image: A PIL image\n    \"\"\"\n    tensor = tensor * 255\n    tensor = np.array(tensor, dtype=np.uint8)\n    if np.ndim(tensor) > 3:\n        assert tensor.shape[0] == 1\n        tensor = tensor[0]\n    return Image.fromarray(tensor)","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:56.560196Z","iopub.execute_input":"2023-11-18T11:57:56.560483Z","iopub.status.idle":"2023-11-18T11:57:56.567681Z","shell.execute_reply.started":"2023-11-18T11:57:56.560458Z","shell.execute_reply":"2023-11-18T11:57:56.566606Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Model training","metadata":{}},{"cell_type":"code","source":"optimizer = tf.keras.optimizers.Adam(learning_rate=0.01)\n\n@tf.function()\ndef train_step(generated_image):\n    with tf.GradientTape() as tape:\n        # Compute a_G as the vgg_model_outputs for the current generated image\n        a_G = vgg_model_outputs(generated_image)\n        \n        # Compute the style cost\n        J_style = compute_style_cost(a_S, a_G)\n\n        # Compute the content cost\n        J_content = compute_content_cost(a_C, a_G)\n        \n        # Compute the total cost\n        J = total_cost(J_content, J_style, alpha = 10, beta = 5)\n        \n    grad = tape.gradient(J, generated_image)\n\n    optimizer.apply_gradients([(grad, generated_image)])\n    generated_image.assign(clip_0_1(generated_image))\n        \n    return J","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:56.568823Z","iopub.execute_input":"2023-11-18T11:57:56.569094Z","iopub.status.idle":"2023-11-18T11:57:56.580389Z","shell.execute_reply.started":"2023-11-18T11:57:56.569070Z","shell.execute_reply":"2023-11-18T11:57:56.579474Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"generated_image = tf.Variable(tf.image.convert_image_dtype(content_image, tf.float32))","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:56.581701Z","iopub.execute_input":"2023-11-18T11:57:56.582531Z","iopub.status.idle":"2023-11-18T11:57:56.597398Z","shell.execute_reply.started":"2023-11-18T11:57:56.582503Z","shell.execute_reply":"2023-11-18T11:57:56.595786Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Also shows the generated image at some epochs\nepochs = 2501\nfor i in range(epochs):\n    train_step(generated_image)\n    if i % 250 == 0:\n        print(f\"Epoch {i} \")\n    if i % 250 == 0:\n        image = tensor_to_image(generated_image)\n        imshow(image)\n        image.save(f\"/kaggle/working/image_{i}.jpg\")\n        plt.show() ","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:57:56.598744Z","iopub.execute_input":"2023-11-18T11:57:56.599623Z","iopub.status.idle":"2023-11-18T11:59:05.367925Z","shell.execute_reply.started":"2023-11-18T11:57:56.599586Z","shell.execute_reply":"2023-11-18T11:59:05.366971Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Show the 3 images in a row\nfig = plt.figure(figsize=(16, 4))\nax = fig.add_subplot(1, 3, 1)\nimshow(content_image[0])\nax.title.set_text('Content image')\nax = fig.add_subplot(1, 3, 2)\nimshow(style_image[0])\nax.title.set_text('Style image')\nax = fig.add_subplot(1, 3, 3)\nimshow(generated_image[0])\nax.title.set_text('Generated image')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-18T11:59:05.374239Z","iopub.execute_input":"2023-11-18T11:59:05.374996Z","iopub.status.idle":"2023-11-18T11:59:05.874948Z","shell.execute_reply.started":"2023-11-18T11:59:05.374954Z","shell.execute_reply":"2023-11-18T11:59:05.874024Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}