Skip to content

Commit 3c7e453

Browse files
committed
Merge branch 'hack-the-optimizer-more' of github.com:florisvb/PyNumDiff into notebooks-update-for-optimizer
2 parents a4ef0b3 + 2cae18a commit 3c7e453

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pynumdiff/utils/evaluate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ def total_variation(x, padding=0):
134134
padding = max(padding, 1)
135135
x = x[padding: len(x)-padding]
136136

137-
return np.sum(np.abs(x[1:]-x[:-1]))/(len(x)-1) # mostly equivalent to cvxpy.tv(x2-x1).value
137+
return np.sum(np.abs(x[1:]-x[:-1]))/len(x) # normalized version of cvxpy.tv(x2-x1).value

0 commit comments

Comments
 (0)