Skip to content

Commit 84cba2e

Browse files
committed
update 'uniform_sampling_1d' example in the docs
1 parent 7408ed5 commit 84cba2e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

docs/source/tutorial/tutorial.custom_loss.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,8 @@ simple (but naive) strategy is to *uniformly* sample the domain:
6060

6161
.. jupyter-execute::
6262

63-
def uniform_sampling_1d(interval, scale, data):
64-
# Note that we never use 'data'; the loss is just the size of the subdomain
65-
x_left, x_right = interval
66-
x_scale, _ = scale
67-
dx = (x_right - x_left) / x_scale
63+
def uniform_sampling_1d(xs, ys):
64+
dx = xs[1] - xs[0]
6865
return dx
6966

7067
def f_divergent_1d(x):

0 commit comments

Comments
 (0)