|
52 | 52 | " \"T_outbound\":T_outbound,\n",
|
53 | 53 | " \"T_inbound\": T_inbound,\n",
|
54 | 54 | " \"min_homing_distance\": 300,\n",
|
55 |
| - " \"motor_factor\": -0.5 if cheat else 0.3,\n", |
56 |
| - " \"seed\": None,\n", |
57 |
| - " \"record\": [\"memory\", \"TB1\", \"Pontine\", \"motor\", \"theory\", \"CPU4\"],\n", |
| 55 | + " \"motor_factor\": -0.25 if cheat else 0.25,\n", |
| 56 | + "# \"seed\": 42,\n", |
| 57 | + "# \"record\": [\"memory\", \"TB1\", \"Pontine\", \"motor\", \"theory\", \"CPU4\"],\n", |
58 | 58 | " \"cx\": {\n",
|
59 | 59 | " \"type\": \"dye\",\n",
|
60 | 60 | " \"output_layer\": \"motor\",\n",
|
61 | 61 | " \"params\": {\n",
|
62 | 62 | " \"noise\": 0.1,\n",
|
63 |
| - " \"phi\": 0.00045,#0.00045,\n", |
64 |
| - " \"beta\": 0.1,\n", |
| 63 | + " \"phi\": 0.0003,#0.00045,\n", |
| 64 | + " \"beta\": 0.3,\n", |
65 | 65 | " \"k\": 0,\n",
|
66 |
| - " \"epsilon\":10,\n", |
| 66 | + " \"epsilon\":15,\n", |
67 | 67 | " \"length\": 1, #cm\n",
|
68 | 68 | " \"c_tot\": 0.3, #M\n",
|
69 | 69 | " \"cheat\": cheat,\n",
|
70 |
| - " \"holonomic\": True\n", |
| 70 | + " \"holonomic\": False,\n", |
| 71 | + " \"disable_beta_on_outbound\": False\n", |
71 | 72 | " }\n",
|
72 | 73 | " }\n",
|
73 | 74 | "}\n",
|
74 | 75 | "\n",
|
75 |
| - "# parameters = {\n", |
76 |
| - "# \"type\": \"simulation\",\n", |
77 |
| - "# \"T_outbound\":T_outbound,\n", |
78 |
| - "# \"T_inbound\": T_inbound,\n", |
79 |
| - "# \"motor_factor\": 1,\n", |
80 |
| - "# \"min_homing_distance\": 300,\n", |
81 |
| - "# \"seed\": 1,\n", |
82 |
| - "# \"record\": [\"memory\"],\n", |
83 |
| - "# \"cx\": {\n", |
84 |
| - "# \"type\": \"weights\",\n", |
85 |
| - "# \"params\": {\n", |
86 |
| - "# \"noise\": 0.1,\n", |
87 |
| - "# \"motor_noise\": 0.1,\n", |
88 |
| - "# \"pfn_background_activity\": 0.0,\n", |
89 |
| - "# \"mem_gain\": 0.0045,\n", |
90 |
| - "# \"mem_fade\": 0.125,\n", |
91 |
| - "# \"sigmoid\": False,\n", |
92 |
| - "# \"cpu1_slope\": 5.0,\n", |
93 |
| - "# \"cpu1_bias\": 2.5,\n", |
94 |
| - "# }\n", |
95 |
| - "# }\n", |
96 |
| - "# }\n", |
97 |
| - "\n", |
98 |
| - "\n", |
99 | 76 | "experiment = SimulationExperiment(parameters)\n",
|
100 | 77 | "results = experiment.run(\"test\", config_id=\"1\")\n",
|
101 | 78 | "plt.figure(figsize=(10, 10))\n",
|
102 | 79 | "ax = plt.axes()\n",
|
103 | 80 | "ax.axis(\"equal\")\n",
|
104 | 81 | "results.plot_path(ax, decode=False)\n",
|
105 | 82 | "\n",
|
106 |
| - "results.report()\n" |
| 83 | + "results.report()" |
| 84 | + ] |
| 85 | + }, |
| 86 | + { |
| 87 | + "cell_type": "code", |
| 88 | + "execution_count": null, |
| 89 | + "id": "eebc0465", |
| 90 | + "metadata": {}, |
| 91 | + "outputs": [], |
| 92 | + "source": [ |
| 93 | + "with open('positions.json', 'w', encoding='utf-8') as f:\n", |
| 94 | + " json.dump([p.tolist() for p in results.reconstruct_path()], f)" |
| 95 | + ] |
| 96 | + }, |
| 97 | + { |
| 98 | + "cell_type": "code", |
| 99 | + "execution_count": null, |
| 100 | + "id": "18219b9f", |
| 101 | + "metadata": {}, |
| 102 | + "outputs": [], |
| 103 | + "source": [ |
| 104 | + "print(results.parameters.keys())" |
107 | 105 | ]
|
108 | 106 | },
|
109 | 107 | {
|
110 | 108 | "cell_type": "code",
|
111 | 109 | "execution_count": null,
|
112 |
| - "id": "1cf1326f", |
| 110 | + "id": "4c2cb266", |
113 | 111 | "metadata": {},
|
114 | 112 | "outputs": [],
|
115 | 113 | "source": [
|
116 |
| - "# T = 1600\n", |
117 | 114 | "\n",
|
118 |
| - "# def timeline(t):\n", |
119 |
| - "# plt.plot([t, t], [-0.5, 16-0.5], '--')\n", |
| 115 | + "parameters = {\n", |
| 116 | + " \"type\": \"simulation\",\n", |
| 117 | + " \"T_outbound\":T_outbound,\n", |
| 118 | + " \"T_inbound\": T_inbound,\n", |
| 119 | + " \"motor_factor\": 0.25,\n", |
| 120 | + " \"min_homing_distance\": 300,\n", |
| 121 | + " \"seed\": 1,\n", |
| 122 | + " \"record\": [\"memory\"],\n", |
| 123 | + " \"cx\": {\n", |
| 124 | + " \"type\": \"weights\",\n", |
| 125 | + " \"params\": {\n", |
| 126 | + " \"noise\": 0.1,\n", |
| 127 | + " \"beta\": 0.5,\n", |
| 128 | + " \"mem_gain\": 0.0025,\n", |
| 129 | + " \"mem_fade\": 0.625,\n", |
| 130 | + " \"cheat\": not cheat\n", |
| 131 | + " }\n", |
| 132 | + " }\n", |
| 133 | + "}\n", |
120 | 134 | "\n",
|
121 |
| - "# t = results.closest_position_timestep()\n", |
122 | 135 | "\n",
|
123 |
| - "# Ts = 1 - results.transmittances().T\n", |
124 |
| - "# weights = results.transmittances().T\n", |
125 |
| - "# memory = results.concentrations().T\n", |
126 |
| - "# # cpu4 = np.array(results.recordings[\"CPU4\"][\"output\"]).T\n", |
| 136 | + "experiment = SimulationExperiment(parameters)\n", |
| 137 | + "results = experiment.run(\"test\", config_id=\"1\")\n", |
| 138 | + "plt.figure(figsize=(10, 10))\n", |
| 139 | + "ax = plt.axes()\n", |
| 140 | + "ax.axis(\"equal\")\n", |
| 141 | + "results.plot_path(ax, decode=False)\n", |
127 | 142 | "\n",
|
128 |
| - "# # plt.figure(figsize=(10, 5))\n", |
129 |
| - "# # plt.imshow(cpu4, cmap=\"hot\", interpolation=\"nearest\", aspect=\"auto\", norm=clr.Normalize(0, 1))\n", |
130 |
| - "# # timeline(T)\n", |
131 |
| - "# # plt.title(\"PFN\")\n", |
132 | 143 | "\n",
|
133 |
| - "# fig = plt.figure(figsize=(10, 5))\n", |
134 |
| - "# plt.imshow(weights, cmap=\"hot\", interpolation=\"nearest\", aspect=\"auto\", norm=clr.Normalize(0, 1))\n", |
135 |
| - "# timeline(T)\n", |
136 |
| - "# timeline(t)\n", |
137 |
| - "# plt.plot([parameters[\"T_outbound\"], parameters[\"T_outbound\"]], [-0.5, 16-0.5], '-')\n", |
138 |
| - "# plt.title(\"weights\")\n", |
| 144 | + "parameters = {\n", |
| 145 | + " \"type\": \"simulation\",\n", |
| 146 | + " \"T_outbound\":T_outbound,\n", |
| 147 | + " \"T_inbound\": T_inbound,\n", |
| 148 | + " \"motor_factor\": 1,\n", |
| 149 | + " \"min_homing_distance\": 300,\n", |
| 150 | + " \"seed\": 1,\n", |
| 151 | + " \"record\": [\"memory\"],\n", |
| 152 | + " \"cx\": {\n", |
| 153 | + " \"type\": \"pontine\",\n", |
| 154 | + " \"params\": {\n", |
| 155 | + " \"noise\": 0.1,\n", |
| 156 | + " \"holonomic\": False\n", |
| 157 | + " }\n", |
| 158 | + " }\n", |
| 159 | + "}\n", |
139 | 160 | "\n",
|
140 |
| - "# fig = plt.figure(figsize=(10, 5))\n", |
141 |
| - "# plt.imshow(Ts, cmap=\"hot\", interpolation=\"nearest\", aspect=\"auto\", )#norm=clr.Normalize(0, 1))\n", |
142 |
| - "# timeline(T)\n", |
143 |
| - "# timeline(t)\n", |
144 |
| - "# plt.plot([parameters[\"T_outbound\"], parameters[\"T_outbound\"]], [-0.5, 16-0.5], '-')\n", |
145 |
| - "# plt.title(\"1 - Transmittance\")\n", |
146 |
| - "# plt.colorbar()\n", |
| 161 | + "experiment = SimulationExperiment(parameters)\n", |
| 162 | + "results = experiment.run(\"test\", config_id=\"1\")\n", |
| 163 | + "plt.figure(figsize=(10, 10))\n", |
| 164 | + "ax = plt.axes()\n", |
| 165 | + "ax.axis(\"equal\")\n", |
| 166 | + "results.plot_path(ax, decode=False)\n", |
147 | 167 | "\n",
|
148 |
| - "# plt.figure(figsize=(10, 5))\n", |
149 |
| - "# plt.imshow(memory, cmap=\"hot\", interpolation=\"nearest\", aspect=\"auto\", norm=clr.Normalize(0, 0.3))\n", |
150 |
| - "# timeline(T)\n", |
151 |
| - "# plt.title(\"concentration output\")\n", |
152 | 168 | "\n",
|
153 |
| - "# plt.figure(figsize=(10, 5))\n", |
154 |
| - "# plt.imshow(weights[:8,:] - weights[8:,:], cmap=\"hot\", interpolation=\"nearest\", aspect=\"auto\", norm=clr.Normalize(-1, 1))\n" |
| 169 | + "# results.report()" |
155 | 170 | ]
|
156 | 171 | },
|
157 | 172 | {
|
|
191 | 206 | "\n",
|
192 | 207 | "parameters = {\n",
|
193 | 208 | " \"type\": \"simulation\",\n",
|
194 |
| - " \"T_outbound\":2,\n", |
| 209 | + " \"T_outbound\":10,\n", |
195 | 210 | " \"T_inbound\": 3000,\n",
|
196 | 211 | " \"min_homing_distance\": 0,\n",
|
197 |
| - " \"motor_factor\": 0.3,\n", |
198 |
| - " \"record\": [\"memory\", \"TB1\", \"Pontine\", \"motor\", \"theory\", \"CPU4\"],\n", |
| 212 | + " \"motor_factor\": -0.25,\n", |
| 213 | + " \"record\": [\"memory\", \"TB1\", \"Pontine\", \"motor\", \"CPU4\"],\n", |
199 | 214 | " \"cx\": {\n",
|
200 | 215 | " \"type\": \"dye\",\n",
|
201 | 216 | " \"output_layer\": \"motor\",\n",
|
202 | 217 | " \"params\": {\n",
|
203 | 218 | " \"noise\": 0.1,\n",
|
204 |
| - " \"mem_initial\": 0.0,\n", |
205 |
| - " \"pfn_weight_factor\": 1,\n", |
206 |
| - " \"phi\": 0.00045,#0.00045,\n", |
| 219 | + " \"phi\": 0.0003,#0.00045,\n", |
207 | 220 | " \"beta\": 0.3,\n",
|
208 | 221 | " \"k\": 0,\n",
|
209 |
| - " \"epsilon\":1e4,\n", |
| 222 | + " \"epsilon\":1.5e4,\n", |
210 | 223 | " \"length\": 1e-3, #cm\n",
|
211 | 224 | " \"c_tot\": 0.3, #M\n",
|
212 |
| - " \"holonomic\": True\n", |
| 225 | + " \"cheat\": True \n", |
213 | 226 | " \n",
|
214 | 227 | " }\n",
|
215 | 228 | " }\n",
|
|
231 | 244 | {
|
232 | 245 | "cell_type": "code",
|
233 | 246 | "execution_count": null,
|
234 |
| - "id": "f7581020", |
| 247 | + "id": "7ee0347c", |
235 | 248 | "metadata": {},
|
236 | 249 | "outputs": [],
|
237 | 250 | "source": []
|
|
253 | 266 | "name": "python",
|
254 | 267 | "nbconvert_exporter": "python",
|
255 | 268 | "pygments_lexer": "ipython3",
|
256 |
| - "version": "3.8.10" |
| 269 | + "version": "3.10.6" |
257 | 270 | }
|
258 | 271 | },
|
259 | 272 | "nbformat": 4,
|
|
0 commit comments