Comments (6)
This is something I would love to support the right way, but I am afraid it won't happen. But there will be a +/
operator for Sum
and */
for Product
.
I have really no idea how to support generalized reductions. :(
from l1.
Well, that's unfortunate. But what's the problem with generalized reductions?
from l1.
Ok, I might have been quick to judge.
So far, the only problem right now is that scan is not supported by the TF.js. When it will be available, it should not be a problem to implement it.
from l1.
Until tf.scan is available, there will be fake +/
and */
and then I will revisit the reductions in a proper way. So closing for now...
from l1.
I lied. Sum is an unary +
, not +/
. Same will go for a Product as unary *
.
(Originally, I intended unary *
as an operator for Sign function, but this is much better.)
from l1.
I read my comment again, and I realized I mixed up reduction and scan... As for cumsum (+\
) I have no idea what would be a good notation, or how to support tf.scan
in the future. But the question was about the reduction...
I think that prefix notation is not as powerful as reduction notation from APL – one obvious example is -[1 2 3]
– but it seems good enough to me.
So, non-commutative binary operators in unary position:
-[1 2 3] = 0 - [1 2 3]
– works
/[1 2 3] = 1 / [1 2 3]
– works
^[1 2 3] = e ^ [1 2 3]
– need work
%[1 2 3] = ???
– no idea, (as postfix it could be (a => a / 100)
, so prefix in reverse?, or something more useful :))
@[1 2 3] = ???
– no idea
Non-existing (random ideas):
<[1 2 3] = Min [1 2 3]
– breaks rule of non-commutative bi-op in un-pos (because it reduces)
>[1 2 3] = Max [1 2 3]
– same
from l1.
Related Issues (14)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from l1.