Skip to content

Commit

Permalink
Update API_3_grid.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyNicolas authored Jul 11, 2024
1 parent 2ebafce commit 61ab4ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tutorials/API_3_grid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"\n",
"# consider a 1D example.\n",
"# Suppose we have grid in [-1,1] with G intervals, spline order k\n",
"G = 5\n",
"G = 11\n",
"k = 3\n",
"grid = torch.linspace(-1,1,steps=G+1)[None,:]\n",
"\n",
Expand All @@ -60,10 +60,10 @@
"\n",
"basis = B_batch(x, grid, k=k)\n",
"\n",
"for i in range(G+k):\n",
" plt.plot(x[0].detach().numpy(), basis[0,i,:].detach().numpy())\n",
"for i in range(G-k):\n",
" plt.plot(x[0].detach().numpy(), basis[0,:,i].detach().numpy())\n",
" \n",
"plt.legend(['B_{}(x)'.format(i) for i in np.arange(G+k)])\n",
"plt.legend(['B_{}(x)'.format(i) for i in np.arange(G-k)])\n",
"plt.xlabel('x')\n",
"plt.ylabel('B_i(x)')"
]
Expand Down

0 comments on commit 61ab4ac

Please sign in to comment.