stur86 / tvregdiff Goto Github PK
View Code? Open in Web Editor NEWPython version of Rick Chartrand's algorithm for numerical differentiation of noisy data
License: MIT License
Python version of Rick Chartrand's algorithm for numerical differentiation of noisy data
License: MIT License
Has any testing been done to compare the outputs of TVRegDiff
with Chartrand's original MATLAB code?
I see he has a couple of demo's included in his code:
demo_large.m
demo_small.m
I tried running tvregdiff
with the same parameters as demo_small.m
but couldn't get exactly the same results. Maybe I am doing something wrong.
I'm currently having a hard time understanding the adjoint of the cumsum operator and while trying to understand it, I've encountered something. In line 281 - 283
in tvregdiff.py
, the adjoint of the cumsum operator is defined as
def AT(w): return (sum(w) * np.ones(len(w)) -
np.transpose(np.concatenate(([0.0], np.cumsum(w[:-1])))))
I'm wondering if the effect of
np.transpose(...)
is intended in this context? Since
np.concatenate(([0.0], np.cumsum(w[:-1])))
returns a 1D-vector and NumPy's transpose(...)
has no effect on 1D-vectors, nothing will happen here (see also the docs). As example one can call
a = np.arange(0, 10)
np.allclose(a, np.transpose(a)) # evaluates to True because a is 1D
a = a.reshape((-1, 1))
np.allclose(a, np.transpose(a)) # evaluates to False because a is a 2D-column-vector, same applies to row vectors
As I said, I don't quite understand the adjoint of the cumsum, so I would like to ask if this behaviour (nothing happening) is intended or not?
Btw, instead of
sum(w) * np.ones(len(w))
one can use
np.full((len(w), ), fill_value = np.sum(w))
but this is just a very small detail.
Thanks and best regards!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.