Comments (9)
Do you mean dimensionality
or dimensions
?
For a 3x3 matrix, dimensionality is 2 (it's a 2D matrix) and dimensions are [3 3]
Apart from that I like the word size in principle but the only main I was cautious about size was ambiguity: it might get confused with the total number of items in the matrix. That it what it means in NumPy at least.....
Any examples of what other matrix libraries use?
from core.matrix.
Sorry, yes, I mean dimensions. For this R uses dim, MATLAB uses size, mathematica uses Dimensions. So no consensus there :)
For the total number of elements matlab provides numel (i think its a bit ugly). How about count, or card ?
from core.matrix.
numpy uses "ndim" for the number of array dimensions, and "shape" for the tuple of sizes along those dimensions.
It also uses the term "axis" a lot in its API for a specific dimension of an ndarray
from core.matrix.
I quite like "shape" as an alternative to "dimensions"
ecount
might be good as a reasonably concise term for the total number of elements - it would be consistent with ereduce
, emap
etc, for the other element-by-element operations.
ndim
feels unidiomatic to me in Clojure for some reason. Though I recognise I have a general bias against use of abbreviations....
from core.matrix.
Yes, shape is nice, sounds like quorum to me :)
ecount I think is a problem. The e_verb_ convention is to apply verb to each element of the matrix, thus wouldn't ecount imply: apply the function count to each element ? The count we want is not an elementwise op, but a collectionwise op. Admittedly, this might be inferring too much from the convention.
I still think count or card are better.
from core.matrix.
OK sounds agreed dimensions -> shape
OTOH I don't think e*verb*
does currently mean apply *verb*
to each element at present - ereduce
for example isn't applying reduce
to each element, it is applying reduce
to a hypothetical sequence of all elements. Likewise for emap
. e+
works as shorthand for emap +
in this sense.
ecount
would be consistent with that, the sense that (count seq)
returns the count of all elements in a seq.
Without having a specific formal definition in mind, I was interpreting e_something_ as "version of something
that works over the array seen as a collection of elements". Rather like areduce
for Java arrays in clojure.core. I imagine clojure.core would have acount
as well were it not for the fact that count
already works fine on Java arrays.
This is good discussion though - let's keep pushing this, naming is so important for any API.
from core.matrix.
Anyone want to do a patch for dimensions -> shape?
Happy to do it myself, but I'm conscious that other people may want to get involved with hacking the API and this is probably a good one to start with.....
from core.matrix.
e_verb_. I see your point. I need to think about this a bit.
from core.matrix.
Seems like we can close this one.
from core.matrix.
Related Issues (20)
- index-max HOT 3
- `fill` does not preserve type
- Exception when `mmul`ing `fill`ed ndarrays
- Numeric types are unexpectedly coerced HOT 1
- TODO: Not yet implemented: for class clojure.lang.PersistentVector HOT 2
- Why is there no mmul! function ? HOT 2
- API documentation is out of date HOT 4
- Uninitialized object exists on backward branch 108 in clojurescript HOT 11
- Typo in persistent_vector.cljc (vector-dot)? HOT 2
- `pm` (pretty print) undefined in clojurescript HOT 1
- what is the purpose of 'unimplemented' function in utils HOT 2
- Matrix element wise multiplication by column vector HOT 1
- where is react native API document? HOT 1
- Warnings of clashes with Clojure 1.11.0 abs. HOT 6
- apache-commons-matrix not playing well with core.matrix? HOT 1
- New release HOT 2
- pm, get-shape are confused by cells containing sequences in NDArray
- Max size of ndarray matrices? HOT 2
- element-wise equality comparison for non-numbers HOT 2
- Feature request: reverse and rotate functions HOT 2
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 core.matrix.