Skip to content

Commit

Permalink
Fix another typo in a colab
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 318055981
  • Loading branch information
romanngg committed Jun 24, 2020
1 parent c0c37c7 commit c493ad6
Showing 1 changed file with 42 additions and 39 deletions.
81 changes: 42 additions & 39 deletions notebooks/neural_tangents_cookbook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -57,7 +57,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -81,7 +81,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -118,7 +118,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -146,7 +146,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -216,7 +216,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -239,7 +239,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -268,7 +268,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -297,7 +297,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -324,7 +324,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {
"height": 341
Expand Down Expand Up @@ -408,7 +408,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -440,7 +440,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -457,7 +457,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {
"height": 341
Expand Down Expand Up @@ -514,7 +514,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -528,7 +528,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {
"height": 341
Expand Down Expand Up @@ -606,16 +606,16 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "JeKzXr6Y4Erl"
},
"outputs": [],
"source": [
"predict_fn = nt.predict.gradient_descent_mse_ensemble(kernel_fn, train_xs, train_ys,\n",
" diag_reg=1e-4)\n",
"predict_fn = nt.predict.gradient_descent_mse_ensemble(kernel_fn, train_xs, \n",
" train_ys, diag_reg=1e-4)\n",
"\n",
"nngp_mean, nngp_covariance = predict_fn(x_test=test_xs, get='nngp', \n",
" compute_cov=True)\n",
Expand All @@ -626,7 +626,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {
"height": 341
Expand Down Expand Up @@ -700,23 +700,24 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "nQ3xu5lr8MPN"
},
"outputs": [],
"source": [
"ntk_mean, ntk_covariance = predict_fn(x_test=test_xs, get='ntk', compute_cov=True)\n",
"ntk_mean, ntk_covariance = predict_fn(x_test=test_xs, get='ntk', \n",
" compute_cov=True)\n",
"\n",
"ntk_mean = np.reshape(ntk_mean, (-1,))\n",
"ntk_std = np.sqrt(np.diag(ntk_covariance))"
]
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {
"height": 341
Expand Down Expand Up @@ -791,7 +792,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -806,7 +807,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {
"height": 338
Expand Down Expand Up @@ -888,7 +889,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -915,7 +916,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -939,7 +940,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -971,7 +972,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {
"height": 338
Expand Down Expand Up @@ -1059,7 +1060,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -1096,7 +1097,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -1110,7 +1111,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {
"height": 338
Expand Down Expand Up @@ -1187,7 +1188,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -1213,7 +1214,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {
"height": 338
Expand Down Expand Up @@ -1329,7 +1330,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -1371,7 +1372,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -1404,7 +1405,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -1413,13 +1414,15 @@
"outputs": [],
"source": [
"#@test {\"skip\": true}\n",
"predict_fn = nt.predict.gradient_descent_mse_ensemble(kernel_fn, train_xs, \n",
" train_ys, diag_reg=1e-4)\n",
"ntk_mean, ntk_var = predict_fn(x_test=test_xs, get='ntk', compute_cov=True)\n",
"\n",
"ntk_mean = np.reshape(ntk_mean, (-1,))\n",
"ntk_std = np.sqrt(np.diag(ntk_var))\n",
"\n",
"ntk_train_loss_mean = loss_fn(train_predict_fn, train_ys, ts)\n",
"ntk_test_loss_mean = loss_fn(test_predict_fn, test_ys, ts, test_xs)"
"ntk_train_loss_mean = loss_fn(predict_fn, train_ys, ts)\n",
"ntk_test_loss_mean = loss_fn(predict_fn, test_ys, ts, test_xs)"
]
},
{
Expand All @@ -1434,7 +1437,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {
"height": 338
Expand Down

0 comments on commit c493ad6

Please sign in to comment.