Skip to content

Commit

Permalink
update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierCodol committed Nov 8, 2022
1 parent a7edb63 commit f029a99
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 163 deletions.
327 changes: 194 additions & 133 deletions examples/0-muscle-demo.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/2-build-net.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"4/4 [==============================] - 7s 144ms/step - loss: 0.7688 - position_loss: 0.7688 - l2_activation_loss: 4.8327e-05\n"
"4/4 [==============================] - 7s 140ms/step - loss: 0.7270 - position_loss: 0.7269 - l2_activation_loss: 4.8923e-05\n"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion examples/3-states.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"feature 0: excitation/activation\n",
"feature 0: activation\n",
"feature 1: muscle length\n",
"feature 2: muscle velocity\n",
"feature 3: force\n"
Expand Down
16 changes: 8 additions & 8 deletions examples/4-tasks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
" {'joint position': 0.0, 'cartesian position': 1.0, 'muscle state': 5, 'geometry state': 0.0, 'proprioceptive feedback': 0.0, 'visual feedback': 0.0, 'excitation': 0.0, 'gru_hidden_0': 0.1}\n",
"\n",
"losses:\n",
" {'joint position': None, 'cartesian position': <motornet.nets.losses.PositionLoss object at 0x0000015417CE7A00>, 'muscle state': <motornet.nets.losses.L2xDxActivationLoss object at 0x0000015417CE7970>, 'geometry state': None, 'proprioceptive feedback': None, 'visual feedback': None, 'excitation': None, 'gru_hidden_0': <motornet.nets.losses.L2xDxRegularizer object at 0x0000015417CE7910>}\n",
" {'joint position': None, 'cartesian position': <motornet.nets.losses.PositionLoss object at 0x000001886CB16A00>, 'muscle state': <motornet.nets.losses.L2xDxActivationLoss object at 0x000001886CB16970>, 'geometry state': None, 'proprioceptive feedback': None, 'visual feedback': None, 'excitation': None, 'gru_hidden_0': <motornet.nets.losses.L2xDxRegularizer object at 0x000001886CB16910>}\n",
"\n",
"loss_names:\n",
" {'joint position': 'joint position', 'cartesian position': 'position', 'muscle state': 'l2_xdx_activation', 'geometry state': 'geometry state', 'proprioceptive feedback': 'proprioceptive feedback', 'visual feedback': 'visual feedback', 'excitation': 'excitation', 'gru_hidden_0': 'gru_regularizer'}\n"
Expand Down Expand Up @@ -193,23 +193,23 @@
"text": [
"ASSIGNED OUTPUT: cartesian position\n",
"-----------------------------------\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x0000015417CE7A00>\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x000001886CB16A00>\n",
"loss weight: 1.0\n",
"loss name: position\n",
"Compounded: NO\n",
"\n",
"\n",
"ASSIGNED OUTPUT: muscle state\n",
"-----------------------------\n",
"loss function: <motornet.nets.losses.L2xDxActivationLoss object at 0x0000015417CE7970>\n",
"loss function: <motornet.nets.losses.L2xDxActivationLoss object at 0x000001886CB16970>\n",
"loss weight: 5\n",
"loss name: l2_xdx_activation\n",
"Compounded: NO\n",
"\n",
"\n",
"ASSIGNED OUTPUT: gru_hidden_0\n",
"-----------------------------\n",
"loss function: <motornet.nets.losses.L2xDxRegularizer object at 0x0000015417CE7910>\n",
"loss function: <motornet.nets.losses.L2xDxRegularizer object at 0x000001886CB16910>\n",
"loss weight: 0.1\n",
"loss name: gru_regularizer\n",
"Compounded: NO\n",
Expand Down Expand Up @@ -255,31 +255,31 @@
"text": [
"ASSIGNED OUTPUT: cartesian position\n",
"-----------------------------------\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x0000015417CE7A00>\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x000001886CB16A00>\n",
"loss weight: 1.0\n",
"loss name: position\n",
"Compounded: YES\n",
"\n",
"\n",
"ASSIGNED OUTPUT: cartesian position\n",
"-----------------------------------\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x000001541ED590D0>\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x000001886CB5D0A0>\n",
"loss weight: 1.0\n",
"loss name: position\n",
"Compounded: YES\n",
"\n",
"\n",
"ASSIGNED OUTPUT: muscle state\n",
"-----------------------------\n",
"loss function: <motornet.nets.losses.L2xDxActivationLoss object at 0x0000015417CE7970>\n",
"loss function: <motornet.nets.losses.L2xDxActivationLoss object at 0x000001886CB16970>\n",
"loss weight: 5\n",
"loss name: l2_xdx_activation\n",
"Compounded: NO\n",
"\n",
"\n",
"ASSIGNED OUTPUT: gru_hidden_0\n",
"-----------------------------\n",
"loss function: <motornet.nets.losses.L2xDxRegularizer object at 0x0000015417CE7910>\n",
"loss function: <motornet.nets.losses.L2xDxRegularizer object at 0x000001886CB16910>\n",
"loss weight: 0.1\n",
"loss name: gru_regularizer\n",
"Compounded: NO\n",
Expand Down
36 changes: 19 additions & 17 deletions examples/5-losses.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 6,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n",
"Already initialized using LOCAL initialization.\n",
"All packages imported.\n",
"tensorflow version: 2.9.1\n",
Expand Down Expand Up @@ -97,31 +99,31 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 7,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ASSIGNED OUTPUT: cartesian position\n",
"-----------------------------------\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x000002BC74517AF0>\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x0000012A9CA5B160>\n",
"loss weight: 1.0\n",
"loss name: position\n",
"Compounded: NO\n",
"\n",
"\n",
"ASSIGNED OUTPUT: muscle state\n",
"-----------------------------\n",
"loss function: <motornet.nets.losses.L2xDxActivationLoss object at 0x000002BC74517A60>\n",
"loss function: <motornet.nets.losses.L2xDxActivationLoss object at 0x0000012A9CA5B0D0>\n",
"loss weight: 5\n",
"loss name: l2_xdx_activation\n",
"Compounded: NO\n",
"\n",
"\n",
"ASSIGNED OUTPUT: gru_hidden_0\n",
"-----------------------------\n",
"loss function: <motornet.nets.losses.L2xDxRegularizer object at 0x000002BC74517A00>\n",
"loss function: <motornet.nets.losses.L2xDxRegularizer object at 0x0000012A9CA5B070>\n",
"loss weight: 0.1\n",
"loss name: gru_regularizer\n",
"Compounded: NO\n",
Expand Down Expand Up @@ -173,39 +175,39 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 8,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ASSIGNED OUTPUT: cartesian position\n",
"-----------------------------------\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x000002BC74517AF0>\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x0000012A9CA5B160>\n",
"loss weight: 1.0\n",
"loss name: position\n",
"Compounded: YES\n",
"\n",
"\n",
"ASSIGNED OUTPUT: cartesian position\n",
"-----------------------------------\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x000002BC74517A90>\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x0000012A958A8A00>\n",
"loss weight: 1.0\n",
"loss name: position\n",
"Compounded: YES\n",
"\n",
"\n",
"ASSIGNED OUTPUT: muscle state\n",
"-----------------------------\n",
"loss function: <motornet.nets.losses.L2xDxActivationLoss object at 0x000002BC74517A60>\n",
"loss function: <motornet.nets.losses.L2xDxActivationLoss object at 0x0000012A9CA5B0D0>\n",
"loss weight: 5\n",
"loss name: l2_xdx_activation\n",
"Compounded: NO\n",
"\n",
"\n",
"ASSIGNED OUTPUT: gru_hidden_0\n",
"-----------------------------\n",
"loss function: <motornet.nets.losses.L2xDxRegularizer object at 0x000002BC74517A00>\n",
"loss function: <motornet.nets.losses.L2xDxRegularizer object at 0x0000012A9CA5B070>\n",
"loss weight: 0.1\n",
"loss name: gru_regularizer\n",
"Compounded: NO\n",
Expand Down Expand Up @@ -261,7 +263,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 9,
"metadata": {
"collapsed": true,
"pycharm": {
Expand Down Expand Up @@ -313,47 +315,47 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 10,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ASSIGNED OUTPUT: cartesian position\n",
"-----------------------------------\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x000002BC74517AF0>\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x0000012A9CA5B160>\n",
"loss weight: 1.0\n",
"loss name: position\n",
"Compounded: YES\n",
"\n",
"\n",
"ASSIGNED OUTPUT: cartesian position\n",
"-----------------------------------\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x000002BC74517A90>\n",
"loss function: <motornet.nets.losses.PositionLoss object at 0x0000012A958A8A00>\n",
"loss weight: 1.0\n",
"loss name: position\n",
"Compounded: YES\n",
"\n",
"\n",
"ASSIGNED OUTPUT: muscle state\n",
"-----------------------------\n",
"loss function: <motornet.nets.losses.L2xDxActivationLoss object at 0x000002BC74517A60>\n",
"loss function: <motornet.nets.losses.L2xDxActivationLoss object at 0x0000012A9CA5B0D0>\n",
"loss weight: 5\n",
"loss name: l2_xdx_activation\n",
"Compounded: NO\n",
"\n",
"\n",
"ASSIGNED OUTPUT: excitation\n",
"---------------------------\n",
"loss function: <__main__.L2ActivationLoss object at 0x000002BC743DA5E0>\n",
"loss function: <__main__.L2ActivationLoss object at 0x0000012A9CA5BC10>\n",
"loss weight: 1.0\n",
"loss name: example_loss\n",
"Compounded: NO\n",
"\n",
"\n",
"ASSIGNED OUTPUT: gru_hidden_0\n",
"-----------------------------\n",
"loss function: <motornet.nets.losses.L2xDxRegularizer object at 0x000002BC74517A00>\n",
"loss function: <motornet.nets.losses.L2xDxRegularizer object at 0x0000012A9CA5B070>\n",
"loss weight: 0.1\n",
"loss name: gru_regularizer\n",
"Compounded: NO\n",
Expand Down
5 changes: 2 additions & 3 deletions examples/6-train-net.ipynb

Large diffs are not rendered by default.

Binary file modified examples/save/data.pickle
Binary file not shown.

0 comments on commit f029a99

Please sign in to comment.