Commit 3b010651 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain
Browse files

Starting M8 MODAL

parent 455e0f5f
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Let us start by looking again at the Prey-Predator model"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"load(library:examples/lotka_volterra/LVi.bc)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"list_model."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### SSA means Stochastic Simulation Algorithm (from Gillespie)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"numerical_simulation(method: ssa).\n",
"plot."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### SPN is a Stochastic Petri Net, i.e., SSA without time"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"numerical_simulation(method: spn).\n",
"plot."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### SBN is a Stochastic Boolean Net, i.e., a stochastic boolean simulation"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"numerical_simulation(method: sbn).\n",
"plot."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"Now let us look at different ways to approach PAC learning for this model.\n",
"\n",
"First, the biocham command: `pac_learning(Model, #Initial_states, Time_horizon)`\n",
"it will read the file `Model` and generate `#Initial_states` random initial states from which it will run simulations for `Time_horizon`.\n",
"\n",
"You can add options for the simulation, notably: `boolean_simulation: yes` to go from default `ssa` to `sbn` method,\n",
"and `cnf_clause_size: 2` to change the size of the disjuncts considered from the default `3`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Question 1\n",
"\n",
"Compare the results of trying to learn a model from traces of the above `library:examples/lotka_volterra/LVi.bc` model in the 3 following conditions:\n",
"\n",
"1. A single boolean simulation of length 50\n",
"2. 25 boolean simulations of length 2\n",
"3. 50 stochastic simulations of length 1\n",
"\n",
"Explain what you observe"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Question 2\n",
"\n",
"In the output, the `h` corresponds to Valiant's precision parameter. What we know (see François' slides) is that with $L(h, s)$ samples we have probability higher than $1 - h^{-1}$ to find our approximation, and its total amount of false negatives has measure $< h^{-1}$\n",
"\n",
"How did we turn this into an estimate of the number of samples needed for a given $h$?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Question 3\n",
"\n",
"Why do we have to provide a `cnf_clause_size` to learn CNF formulae of size less than `K`?\n",
"\n",
"What does it represent \"biologically\"?\n",
"\n",
"Could we have used the DNF learning algorithm here? why?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"Let us now consider a bigger model coming from L. Mendoza (Biosystems 2006), and made Boolean by the same author with Remy et al. (Dynamical Roles and Functionality of Feedback Circuits, Springer 2006).\n",
"\n",
"![Th Lymphocite differentiation](RemyEtAl06.png)\n",
"\n",
"The model is about the control and differentiation of Th (lymphocite) cells."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"STAT4,TBet -> IFNg.\r\n",
"/ STAT4 -< IFNg.\r\n",
"/ TBet -< IFNg.\r\n",
"GATA3 / STAT1 -> IL4.\r\n",
"/ GATA3 -< IL4.\r\n",
"STAT1 -< IL4.\r\n",
"IFNg / SOCS1 -> IFNgR.\r\n",
"/ IFNg -< IFNgR.\r\n",
"SOCS1 -< IFNgR.\r\n",
"IL4 / SOCS1 -> IL4R.\r\n",
"/ IL4 -< IL4R.\r\n",
"SOCS1 -< IL4R.\r\n",
"IL12 / STAT6 -> IL12R.\r\n",
"/ IL12 -< IL12R.\r\n",
"STAT6 -< IL12R.\r\n",
"IFNgR -> STAT1.\r\n",
"/ IFNgR -< STAT1.\r\n",
"IL4R -> STAT6.\r\n",
"/ IL4R -< STAT6.\r\n",
"IL12R / GATA3 -> STAT4.\r\n",
"/ IL12R -< STAT4.\r\n",
"GATA3 -< STAT4.\r\n",
"STAT1 -> SOCS1.\r\n",
"TBet -> SOCS1.\r\n",
"/ STAT1,TBet -< SOCS1.\r\n",
"STAT6 / TBet -> GATA3.\r\n",
"STAT1 / GATA3 -> TBet.\r\n",
"TBet / GATA3 -> TBet.\r\n",
"GATA3 -< TBet.\r\n",
"/ STAT1,TBet -< TBet.\r\n",
"/ STAT6 -< GATA3.\r\n",
"TBet -< GATA3.\r\n"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"load(library:examples/Th_lymphocytes/lympho.bc).\n",
"list_model."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Biocham",
"language": "",
"name": "biocham"
},
"language_info": {
"codemirror_mode": "biocham",
"file_extension": ".bc",
"mimetype": "text/plain",
"name": "biocham",
"pygments_lexer": "prolog"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment