Skip to content

Commit

Permalink
Merge pull request #326 from CrazyNicolas/master
Browse files Browse the repository at this point in the history
[fix] Update API_3_grid.ipynb to make it runs correctly
  • Loading branch information
KindXiaoming authored Jul 12, 2024
2 parents 2ebafce + 61ab4ac commit 3029652
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 3029652

Please sign in to comment.