4 ms·
a 1-tensor is not a 2-tensor, and scalars have no area. matlab: size(1) ans = [1,1] python: In[0]: np.array(1).shape Out[0]: () 0-tensors are not 2
by hprotagonist 7y ago
a 1-tensor is not a 2-tensor, and scalars have no area.
matlab:
size(1)
ans = [1,1]
python:
In[0]: np.array(1).shape
Out[0]: ()
0-tensors are not 2-tensors, either. You can read matlab's result as "scalars are matricies that have one row and one column", and that's nonsense -- matlab effectively lacks a scalar numeric type; under the covers, everything is a matrix.
- kgwgk 7y agoArrays are not tensors (except when they are, of course). If you want to talk about (n-dimensional) arrays of numbers why wouldn’t the word “array” be enough?
- hprotagonist 7y agoin the nomenclature i’m used to, scalars, vectors, and matrices are all special cases of tensors. ( they have rank 0,1, and 2 respectively). what numpy calls it is more or less moot.
- kgwgk 7y agoIt's not about what nomenclature numpy uses, it's about the word tensor being used by some people to refer to arrays for no discernible reason at all (except the coolness factor, maybe?).
- hprotagonist 7y agoI guess i don't see your point. I'm a biomedical researcher, we do lots of numerical analysis in my part of the world, these are the words we use to unambiguously refer to different entities and concepts of linear algebra. This is not a CS data structures 101 thing, this is a "there are proper names for mathematical entities" thing. I think you're confusing representation and existence, maybe.
- kgwgk 7y ago> "there are proper names for mathematical entities" That's my point. Have you ever used a proper tensor? I mean, the mathematical entity: https://en.wikipedia.org/wiki/Tensor https://en.wikipedia.org/wiki/Tensor
- hprotagonist 7y agoyes, often. This comes up all the time in tissue mechanics, because continuum mechanics turns out to be quite useful for studying the mechanical properties of soft tissue.
- kgwgk 7y agoIn that case I think you can easily see my point. Numerical computing has done pretty well since the fifties using just "multidimensional arrays". [Edit: You may care about vector algebra but 99.999% of the users of numerical arrays do not. I just think that the proper term in a general discussion about data structures in numerical computing like the one here is “array”.] [Edit2: in case you’re really not familiar with the abuse of the term, people do now often use the word tensor to talk about multidimensional arrays that have nothing to do with the mathematical entity called tensor. And I don’t think either matlab or python pretend that they have tensors.]
- 3JPLW 7y agoNow _scalars_ not being distinct from 1x1 matrices I do agree is highly problematic. Not having a real 1-tensor, though, works surprisingly well.
- deleted 7y ago[deleted]
- fireattack 7y agoIsn't it just a design choice? It's called "MAT"lab after all.