Created
March 2, 2017 08:09
-
-
Save kaizu/e239b82622034dafdccb53fd7682ab21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"%matplotlib inline\n", | |
"from ecell4 import *\n", | |
"import numpy\n", | |
"import matplotlib.pylab as plt" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"def singlerun(x, kon, koff, solver='ode'):\n", | |
" with reaction_rules():\n", | |
" A + B == C | (abs(kon), abs(koff))\n", | |
" data = run_simulation(x, y0={'C': 120}, solver=solver, species_list=['A'], return_type='array')\n", | |
" return numpy.asarray(data).T[1]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"x0 = numpy.linspace(0, 10, 21)\n", | |
"y0 = singlerun(x0, 0.01, 0.3, 'gillespie')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[<matplotlib.lines.Line2D at 0x68ee170>]" | |
] | |
}, | |
"execution_count": 4, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEF9JREFUeJzt3W9oXfd9x/HPZ7K2qumYYqIJW06mPDAapqX1uIRsHmNL\nmimjpRZ5YFJoEcPgJ92WjqLO7pM+rEGjdA/GwKRZBc3Smt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X8w+zf+oBL/IniNU5Ims+VJSSfz2MmmbxJdlCJuRr0F7ZP0WUnnbL+ctX0pIv6txJrQ\ne38t6cnsQuVNSX9Zcj25iogXbD8t6SWtjuRaUIK/GLX9lKQ/lXSX7YuSvizpqKTjtg9qdcbZA7ns\nm1+KAkAaqtDlAgDoAIEOAIkg0AEgEQQ6ACSCQAeARBDoAJAIAh0AEkGgA0Ai/g8NgRwzxhPCvQAA\nAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x681bd30>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.plot(x0, y0, 'o')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"def evaluate(individual):\n", | |
" x = numpy.linspace(0, 10, 21)\n", | |
" y = singlerun(x, *individual)\n", | |
" return ((y - y0) ** 2).sum()," | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"import scipy.optimize\n", | |
"params1, cov = scipy.optimize.curve_fit(singlerun, x0, y0, p0=(1.0, 1.0))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"(array([-0.01068974, -0.3105444 ]), (147.52589412177068,))" | |
] | |
}, | |
"execution_count": 7, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"params1, evaluate(params1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz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4nppxzH5jZU8BSOnpyLSMF7xg1\ns8eB8UCRmW0DfgDcB8wxs+l0jDg7NSbH1p2iIiKpIRmaXEREpAsU6CIiKUKBLiKSIhToIiIpQoEu\nIpIiFOgiIilCgS4ikiIU6CIiKeJ/ATVJtk1uRg0UAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x3ff0590>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"x1 = numpy.linspace(0, 10, 101)\n", | |
"plt.plot(x0, y0, 'o')\n", | |
"plt.plot(x1, singlerun(x1, *params1), '-')\n", | |
"plt.plot(x1, singlerun(x1, 0.01, 0.3), '--')\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"from deap import base, creator\n", | |
"creator.create(\"FitnessMin\", base.Fitness, weights=(-1.0, ))\n", | |
"creator.create(\"Individual\", list, fitness=creator.FitnessMin)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"import random\n", | |
"from deap import tools\n", | |
"\n", | |
"IND_SIZE = 2\n", | |
"\n", | |
"toolbox = base.Toolbox()\n", | |
"toolbox.register(\"attribute\", random.random)\n", | |
"toolbox.register(\"individual\", tools.initRepeat, creator.Individual,\n", | |
" toolbox.attribute, n=IND_SIZE)\n", | |
"toolbox.register(\"population\", tools.initRepeat, list, toolbox.individual)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"toolbox.register(\"mate\", tools.cxTwoPoint)\n", | |
"toolbox.register(\"mutate\", tools.mutGaussian, mu=0, sigma=1, indpb=1.0/IND_SIZE)\n", | |
"# toolbox.register(\"mate\", tools.cxSimulatedBinaryBounded, low=0, up=1, eta=20.0)\n", | |
"# toolbox.register(\"mutate\", tools.mutPolynomialBounded, low=0, up=1, eta=20.0, indpb=1.0/IND_SIZE)\n", | |
"\n", | |
"toolbox.register(\"select\", tools.selTournament, tournsize=3)\n", | |
"toolbox.register(\"evaluate\", evaluate)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"def main_ga():\n", | |
" pop = toolbox.population(n=50)\n", | |
" CXPB, MUTPB, NGEN = 0.5, 0.2, 100\n", | |
"\n", | |
" # Evaluate the entire population\n", | |
" fitnesses = map(toolbox.evaluate, pop)\n", | |
" for ind, fit in zip(pop, fitnesses):\n", | |
" ind.fitness.values = fit\n", | |
"\n", | |
" for g in range(NGEN):\n", | |
" print(g, *min([(ind, evaluate(ind)) for ind in pop], key=lambda p: p[1]))\n", | |
" # Select the next generation individuals\n", | |
" offspring = toolbox.select(pop, len(pop))\n", | |
" # Clone the selected individuals\n", | |
" offspring = list(map(toolbox.clone, offspring))\n", | |
"\n", | |
" # Apply crossover and mutation on the offspring\n", | |
" for child1, child2 in zip(offspring[::2], offspring[1::2]):\n", | |
" if random.random() < CXPB:\n", | |
" toolbox.mate(child1, child2)\n", | |
" del child1.fitness.values\n", | |
" del child2.fitness.values\n", | |
"\n", | |
" for mutant in offspring:\n", | |
" if random.random() < MUTPB:\n", | |
" toolbox.mutate(mutant)\n", | |
" del mutant.fitness.values\n", | |
"\n", | |
" # Evaluate the individuals with an invalid fitness\n", | |
" invalid_ind = [ind for ind in offspring if not ind.fitness.valid]\n", | |
" fitnesses = map(toolbox.evaluate, invalid_ind)\n", | |
" for ind, fit in zip(invalid_ind, fitnesses):\n", | |
" ind.fitness.values = fit\n", | |
"\n", | |
" # The population is entirely replaced by the offspring\n", | |
" pop[:] = offspring\n", | |
"\n", | |
" return pop" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 13, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"0 [0.018356354406677933, 0.8705348091096281] (3016.6100104387083,)\n", | |
"1 [0.018356354406677933, 0.3526768677576647] (873.25063714495241,)\n", | |
"2 [0.018356354406677933, 0.46017297073907015] (336.48983979711153,)\n", | |
"3 [0.018356354406677933, 0.46017297073907015] (336.48983979711153,)\n", | |
"4 [0.018356354406677933, 0.46017297073907015] (336.48983979711153,)\n", | |
"5 [0.018356354406677933, 0.6304894716335571] (873.03590949772331,)\n", | |
"6 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"7 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"8 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"9 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"10 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"11 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"12 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"13 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"14 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"15 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"16 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"17 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"18 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"19 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"20 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"21 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"22 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"23 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"24 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"25 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"26 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"27 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"28 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"29 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"30 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"31 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"32 [0.018356354406677933, 0.4857341559026765] (331.23473190067051,)\n", | |
"33 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"34 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"35 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"36 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"37 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"38 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"39 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"40 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"41 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"42 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"43 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"44 [-0.010397271552709569, 0.31233523551285286] (153.13380645059979,)\n", | |
"45 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"46 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"47 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"48 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"49 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"50 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"51 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"52 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"53 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"54 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"55 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"56 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"57 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"58 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"59 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"60 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"61 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"62 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"63 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"64 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"65 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"66 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"67 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"68 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"69 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"70 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"71 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"72 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"73 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"74 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"75 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"76 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"77 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"78 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"79 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"80 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"81 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"82 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"83 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"84 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"85 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"86 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"87 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"88 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"89 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"90 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"91 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"92 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"93 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"94 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"95 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"96 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"97 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"98 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n", | |
"99 [-0.010397271552709569, -0.301526457654592] (148.73748012959126,)\n" | |
] | |
} | |
], | |
"source": [ | |
"pop = main_ga()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 14, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"([-0.010397271552709569, -0.301526457654592], (148.73748012959126,))" | |
] | |
}, | |
"execution_count": 14, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"params2 = min([(ind, evaluate(ind)) for ind in pop], key=lambda p: p[1])[0]\n", | |
"params2, evaluate(params2)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt8VPWd//HXZyaTG7eAhEBACCIiqCA1gncFL2jVQm1L\n69Yuddm1v15+bXctrrT+trvb7q+ubN3arZdlrRatVVER8IJIUbHe0HBRbgaQe7gkXBIgCZnMzHf/\nyIDhEhKSmTlzeT995DEzZ85k3jPgm5Nvvuc75pxDRERSn8/rACIiEhsqdBGRNKFCFxFJEyp0EZE0\noUIXEUkTKnQRkTShQhcRSRMqdBGRNKFCFxFJE1mJfLKePXu6kpKSRD6liEjKW7JkyW7nXGFr+yW0\n0EtKSigrK0vkU4qIpDwz29yW/TTkIiKSJlToIiJpQoUuIpImVOgiImlChS4ikiYSOstFRFLb7GUV\nTJtfzvbqeooL8pgybggTRvb1OpZEqdBFpE1mL6tg6qwV1DeGAaiormfqrBUAKvUkoSEXEWmTafPL\nj5T5YfWNYabNL/cokRxLhS4ibbK9uv6UtkviachFjtD4qJxMcUEeFSco7+KCPA/SyInoCF2Az8dH\nK6rrcXw+Pjp7WYXX0SRJTBk3hLyA/6hteQE/U8YN8SiRHEuFLoDGR6V1E0b25Ve3nEffgjwM6FuQ\nx69uOU8/xSWRNg25mNkm4AAQBkLOuVIz6wE8C5QAm4CJzrl98Ykp8abxUWmLCSP7qsCT2KkcoY9x\nzp3vnCuN3r4bWOicGwwsjN6WFNXSOKjGR0VS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d0EVDrnlnidJYGygC8ADzvnRgK1xOnH8GQRHTceT9M/ZsVAJzO7zdtUieeaphbGZXphKhR6\nmz6MOt2YWYCmMn/KOTfL6zxxdinwJTPbRNOQ2lgz+6O3keJuG7DNOXf4J6/naSr4dHYNsNE5V+Wc\nawRmAZd4nClRdplZH4DoZWU8niQVCj3uH0adbMzMaBpbXeOcu9/rPPHmnJvqnOvnnCuh6c/3Dedc\nWh+5Oed2AlvN7PAnnl8NrPYwUiJsAS4ys/zo3/GrSfNfBDczF5gUvT4JmBOPJ2n3h0QnSiI+jDoJ\nXQp8C1hhZsuj237qnHvVw0wSe/8XeCp6oLIBuN3jPHHlnFtsZs8DS2maybWMNDxj1MyeBq4CeprZ\nNuDnwL3ATDObTNOKsxPj8tw6U1REJD2kwpCLiIi0gQpdRCRNqNBFRNKECl1EJE2o0EVE0oQKXUQk\nTajQRUTShApdRCRN/C+OaCJNDmVKBAAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x6f33e50>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"x1 = numpy.linspace(0, 10, 101)\n", | |
"plt.plot(x0, y0, 'o')\n", | |
"plt.plot(x1, singlerun(x1, *params2), '-')\n", | |
"plt.plot(x1, singlerun(x1, 0.01, 0.3), '--')\n", | |
"plt.show()" | |
] | |
} | |
], | |
"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": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment