Live data from Hacker News

A Gentle Introduction to Tensors (2014) [pdf]

ese.wustl.edu

31–40 of 54 posts

Re: A Gentle Introduction to Tensors (2014) [pdf]

#31
post #27

Earlier quoted context omitted.

[flagged]

As you know, you can't attack other users like this on HN, regardless of how knowledgeable you are or feel you are. Therefore I've banned this account. If you don't want to keep getting banned on HN, please follow the site guidelines. https://news.ycombinator.com/newsguidelines.html

Your shop, your rules, obviously. I think that's a shame fwiw and write now against any bans based on a cursory read of their last 3 months of comments or so. As I also did against the disappearing of the comment itself.

You may know better for many reasons. I note our concerns and goals are not necessarily aligned. YMMV.

Re: A Gentle Introduction to Tensors (2014) [pdf]

#32
post #2

I have always hated when tensors are defined as something whose coordinates are transformed in a certain way. I just find it inherently unfriendly and un-geometric. No matter how much talk is given about simpler cases such as scalars, vectors, covectors, etc., the final defining formula would still look to me as daunting as always. (There is nothing “gentle” about the formulas on page 14.) Surprisingly or not, the wh…

What is also confusing that for physics to be a tensor/vector only the transformation behavior under the orthogonal group is considered, so acceleration is a vector. Math and GR (ok, this is also physics) then uses the coordinate transforms on a manifold, so these are different things.

Re: A Gentle Introduction to Tensors (2014) [pdf]

#33
post #2

I have always hated when tensors are defined as something whose coordinates are transformed in a certain way. I just find it inherently unfriendly and un-geometric. No matter how much talk is given about simpler cases such as scalars, vectors, covectors, etc., the final defining formula would still look to me as daunting as always. (There is nothing “gentle” about the formulas on page 14.) Surprisingly or not, the wh…

I taught a module on tensors in my undergrad Mathematical Methods for Physics course last semester. The students had a weak mathematical background, so I had to explain better than any of the books and videos do. The main problem with most introductions to the topic are that they deal with coordinate systems where the basis vectors are orthogonal, so the covariant and contravariant components are the same. You need t…

Yes! As a former Physics major who was puzzled by tensors for years (despite being relatively comfortable using and manipulating them), I actually had a similar breakthrough reading Fleisch's book and finally "getting" covariant and contravariant components via thinking about non-orthogonal basis vectors. Definitely one of those "why couldn't they have just explained it this way back when I was an undergrad?" moments. I got so excited when I was reading it that I literally got up, ran to the living room and subjected my partner (not a math or physics person at all) to an impromptu fifteen minute lecture with diagrams in multiple colors of ink. She wasn't as impressed.

(Fleisch's "Student's Guide to Waves" is also highly recommended as a book I wish I'd had when I was a student).

Re: A Gentle Introduction to Tensors (2014) [pdf]

#34
I think one of the issues that makes tensors difficult to understand is that different disciplines use the word in different ways. I'm going to generalize here a bit about how each group uses the term, but I suspect not everyone will agree with me. Apologies in advance!

For machine-learning types, a tensor is a multidimensaional array of numbers that admits certain operations (addition, subtraction, hadamard product, etc) [0]

For mathematicians, a tensor is a function F. We pass the function an ordered tuple of N vectors and M covectors (or, to keep things simple, N column vectors and M row vectors), and the function returns a scalar. The function F needs to be linear in each of the N vectors and M covectors. In this view, a matrix is a tensor with N=1, M=1. The operations used by machine learning types arise naturally once you crank the mathematical handle a little bit.

For physicists, a tensor is what mathematicians would refer to as a tensor field. So they take a space X (think R^N), and for each point in the space they associate a mathematician's tensor F as defined above. The properties of the function F are permitted to change from point to point. The Riemannian metric tensor is a classic example of 'tensor' according to this usage.

[0] https://machinelearningmastery.com/introduction-to-tensors-f...

Re: A Gentle Introduction to Tensors (2014) [pdf]

#35
post #17

Argh! People make this so much more complicated than it has to be. A tensor of rank N is a vector in a space whose basis is a set of N-tuples of ordinary vectors. That's it. So a rank-1 tensor is just a regular vector. A rank-2 tensor is a vector in a space whose basis is ordered pairs of regular vectors, a rank-3 tensor is a vector in a space whose basis is ordered triples of regular vectors, and so on.

Here's where this is confusing (to me at least). The dimensionality of a vector space is the number of scalars needed to build a vector in that space. That's easy. I also think of "rank" as synonymous with "dimensionality" but it's not. Or at least it implies a different connotation of the word "dimensionality." It's the number of dimensions in the notation rather than in the space. Or something. And now I'm off the…

Take a look at my definition of the "mathematician's tensor" in the top-level comments. The rank of a tensor is the number of row- and column-vectors you need to feed the tensor to get it to return a real number. AFAIK it's not related to 'rank' in the sense of the rank-nullity theorem.

To move from the mathematician's definition to the ML definition, pick a basis for your row and colum vectors. Now if you want the (i, j, ...) element of the multidimensional array, gather the vectors with one in the i-th position and zero elsewhere, the j-th position and zero elsewhere, etc. Then feed them to the tensor in that order.

It's easiest to see how it works with row vectors (rank (0,1)), column vectors (rank (1, 0)) and matrices (rank (1, 1)) and work from there.

Re: A Gentle Introduction to Tensors (2014) [pdf]

#37

I think one of the issues that makes tensors difficult to understand is that different disciplines use the word in different ways. I'm going to generalize here a bit about how each group uses the term, but I suspect not everyone will agree with me. Apologies in advance! For machine-learning types, a tensor is a multidimensaional array of numbers that admits certain operations (addition, subtraction, hadamard product,…

This is so true!

For machine-learning and data science, tensors are largely what is called n-dimensional array. Numpy is a popular python library built basically around this data type.

Mathematical tensors in a particular base (sorry for the sloppy language, theoretical physicist here) can be displayed with such a data type, depsite the n-dimensional array data type (as available in numpy) lacks the (co)vector properties.

Funny enough, in theoretical physics there are two groups of people: The one prefering to write out complicated objects (i.e. tensors) with indices and the ones who do not (typically called abstract tensor notation in general relativity). The latter are much more close to mathematical physics and prefer to understand tensors as mappings from (co)vector spaces to scalars, similar to as you already wrote.

Most general relativity computer codes are written by the index people, not by the mathematical physicists ;-)

Re: A Gentle Introduction to Tensors (2014) [pdf]

#38

I think one of the issues that makes tensors difficult to understand is that different disciplines use the word in different ways. I'm going to generalize here a bit about how each group uses the term, but I suspect not everyone will agree with me. Apologies in advance! For machine-learning types, a tensor is a multidimensaional array of numbers that admits certain operations (addition, subtraction, hadamard product,…

> For mathematicians, a tensor is a function F. We pass the function an ordered tuple of N vectors and M covectors (or, to keep things simple, N column vectors and M row vectors), and the function returns a scalar. The function F needs to be linear in each of the N vectors and M covectors. In this view, a matrix is a tensor with N=1, M=1. The operations used by machine learning types arise naturally once you crank the mathematical handle a little bit.

As with almost all non-technical statements one can make about math (including my amendment—recursive nerd-sniping away), this is neither quite true nor quite false.

A tensor is an element of a tensor product—that's it. (But what tensor product? There are a lot of notions. I'll use the bare tensor product of non-topologised vector spaces.)

One kind of thing you can tensor is copies of a single vector space, and/or its dual. This is the sort of tensor product you likely have in mind. Tensoring copies of the dual allows you to feed in elements of the original vector space. Tensoring copies of the vector space allows you to feed in elements of the dual vector space (there is mathematically no intrinsic difference between a vector and a co-vector; having a favourite vector space in mind, you can talk about the elements of that vector space or of its dual, and—which is where the vector vs. co-vector terminology in physics comes from—about how coefficient vectors change when you change the basis of V), although, importantly, if your original vector space is infinite dimensional then the natural embedding into its double dual is not an isomorphism.

Which is to say, yes, the objects you describe all arise as mathematical tensors; but mathematical tensors can also describe much more.

Re: A Gentle Introduction to Tensors (2014) [pdf]

#39
post #2

I have always hated when tensors are defined as something whose coordinates are transformed in a certain way. I just find it inherently unfriendly and un-geometric. No matter how much talk is given about simpler cases such as scalars, vectors, covectors, etc., the final defining formula would still look to me as daunting as always. (There is nothing “gentle” about the formulas on page 14.) Surprisingly or not, the wh…

I taught a module on tensors in my undergrad Mathematical Methods for Physics course last semester. The students had a weak mathematical background, so I had to explain better than any of the books and videos do. The main problem with most introductions to the topic are that they deal with coordinate systems where the basis vectors are orthogonal, so the covariant and contravariant components are the same. You need t…

> The main problem with most introductions to the topic are that they deal with coordinate systems where the basis vectors are orthogonal, so the covariant and contravariant components are the same. You need to deal with non-orthogonal basis vectors, because then you realize that naturally there are two ways of defining basis vectors at a given point in space.

Or, preferably, not with basis vectors at all, but that notion seems to do violence to a physicist's way of thinking about linear algebra—I've never quite understood why the physical approach to the subject is so bound up in co-ordinates, when it seems like physicists would be one of the groups most likely to benefit from fully grokking a co-ordinate-free approach.

Re: A Gentle Introduction to Tensors (2014) [pdf]

#40

I think one of the issues that makes tensors difficult to understand is that different disciplines use the word in different ways. I'm going to generalize here a bit about how each group uses the term, but I suspect not everyone will agree with me. Apologies in advance! For machine-learning types, a tensor is a multidimensaional array of numbers that admits certain operations (addition, subtraction, hadamard product,…

I think that tensors have a much more broad meaning to mathematicians. At least in pure mathematics and algebra, there is much more of a focus on the tensor product operation, a way of taking two (or more) vector spaces and producing a new vector space: their tensor product. Tensors are elements of this new space. In particular they don’t need to be multilinear functions on a product of vector spaces (for finite dimensional spaces there is not much difference, but for infinite-dimensional spaces there is a real difference between these two things).

Tensor products in this generality don’t need to have an (n, m) rank in the sense you’re describing, since they might be put together from completely different spaces. For example it’s perfectly fine to form the tensor product of a 2-dimensional space with a 5-dimensional space, yielding a 10-dimensional space.

Post reply on HN