Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/basic_tutorial/basic_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"from ssms.basic_simulators.simulator import simulator\n",
"\n",
"sim_out = simulator(\n",
" model=\"ddm\", theta={\"v\": 0, \"a\": 1, \"z\": 0.5, \"t\": 0.5}, n_samples=1000,\n",
" model=\"ddm\",\n",
" theta={\"v\": 0, \"a\": 1, \"z\": 0.5, \"t\": 0.5},\n",
" n_samples=1000,\n",
")"
]
},
Expand Down
8 changes: 6 additions & 2 deletions notebooks/basic_tutorial copy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,14 @@
],
"source": [
"from ssms.basic_simulators.simulator import simulator\n",
"\n",
"out_list = []\n",
"for i in range(100):\n",
" sim_out = simulator(\n",
" model=\"ddm\", theta={\"v\": 0, \"a\": 1, \"z\": 0.5, \"t\": 0.5}, n_samples=1, random_state = 100,\n",
" model=\"ddm\",\n",
" theta={\"v\": 0, \"a\": 1, \"z\": 0.5, \"t\": 0.5},\n",
" n_samples=1,\n",
" random_state=100,\n",
" )\n",
" out_list.append(sim_out)"
]
Expand Down Expand Up @@ -485,7 +489,7 @@
}
],
"source": [
"[out_list[i]['rts'][0][0] for i in range(100)]"
"[out_list[i][\"rts\"][0][0] for i in range(100)]"
]
},
{
Expand Down
20 changes: 12 additions & 8 deletions notebooks/basic_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@
}
],
"source": [
"type(model_config['param_bounds'])"
"type(model_config[\"param_bounds\"])"
]
},
{
Expand Down Expand Up @@ -1427,7 +1427,9 @@
}
],
"source": [
"training_data['thetas'][:, model_config[\"params\"].index(\"st\")] < training_data['thetas'][:, model_config[\"params\"].index(\"t\")]"
"training_data[\"thetas\"][:, model_config[\"params\"].index(\"st\")] < training_data[\n",
" \"thetas\"\n",
"][:, model_config[\"params\"].index(\"t\")]"
]
},
{
Expand Down Expand Up @@ -1464,11 +1466,13 @@
"metadata": {},
"outputs": [],
"source": [
"my_dict = {'v': np.array([-1.022687], dtype=np.float32), \n",
"\t\t 't': np.array([1.2465975], dtype=np.float32), \n",
"\t\t 'a': np.array([1.472519], dtype=np.float32), \n",
"\t\t 'z': np.array([0.2667516], dtype=np.float32),\n",
"\t\t'deadline': np.array([2.0713003], dtype=np.float32)}"
"my_dict = {\n",
" \"v\": np.array([-1.022687], dtype=np.float32),\n",
" \"t\": np.array([1.2465975], dtype=np.float32),\n",
" \"a\": np.array([1.472519], dtype=np.float32),\n",
" \"z\": np.array([0.2667516], dtype=np.float32),\n",
" \"deadline\": np.array([2.0713003], dtype=np.float32),\n",
"}"
]
},
{
Expand All @@ -1489,7 +1493,7 @@
],
"source": [
"names = [key_ for key_ in my_dict.keys()]\n",
"np.tile(np.stack([my_dict[key_] for key_ in names], axis = 1), (200, 1)).shape"
"np.tile(np.stack([my_dict[key_] for key_ in names], axis=1), (200, 1)).shape"
]
},
{
Expand Down
7 changes: 5 additions & 2 deletions notebooks/basic_tutorial_12122024.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,11 @@
],
"source": [
"from matplotlib import pyplot as plt\n",
"plt.hist(sim_out[\"rts\"] * sim_out['choices'], histtype = 'step', bins = 40, label='sim_out')\n",
"plt.hist(sim_out2[\"rts\"] * sim_out2['choices'], histtype = 'step', bins = 40, label='sim_out2')\n",
"\n",
"plt.hist(sim_out[\"rts\"] * sim_out[\"choices\"], histtype=\"step\", bins=40, label=\"sim_out\")\n",
"plt.hist(\n",
" sim_out2[\"rts\"] * sim_out2[\"choices\"], histtype=\"step\", bins=40, label=\"sim_out2\"\n",
")\n",
"plt.legend()"
]
},
Expand Down
8 changes: 4 additions & 4 deletions notebooks/basic_tutorial_old.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@
],
"source": [
"def myfun(a, b, c):\n",
"\tprint(a, b, c)\n",
" print(a, b, c)\n",
"\n",
"myfun(**{'c': 1, 'b': 2, 'a': 3})"
"\n",
"myfun(**{\"c\": 1, \"b\": 2, \"a\": 3})"
]
},
{
Expand Down Expand Up @@ -270,8 +271,7 @@
"from ssms.basic_simulators.simulator import simulator\n",
"\n",
"sim_out = simulator(\n",
"\tmodel=\"lba2\", theta={'A': 0.3, 'b': 0.5, 'v0': 0.5, 'v1': 0.5},\n",
"\t\t\t\t\t\t n_samples=10\n",
" model=\"lba2\", theta={\"A\": 0.3, \"b\": 0.5, \"v0\": 0.5, \"v1\": 0.5}, n_samples=10\n",
")"
]
},
Expand Down
Loading
Loading