Do we sum over sets? I'm writing my thesis on a topic in machine learning. In some parts I defined a summation over a set. I sent my thesis draft to my professor and then I met him. He briefly mentioned that "we don't sum over sets" and said that I need to be careful and read my thesis again. The meeting was just 1 minute and I couldn't ask him which parts or lines had the issue, so I couldn't really find where the problem is.
I believe that the professor meant the training datasets. But I might be wrong.
My question: is it correct mathematically to sum over sets?!
Edit:
One way I define such a context is like this: given a set $D=\{s_1, s_2, \dots, s_n\}$ which represents a training dataset that contains training samples $s_1, \dots, s_n$, then a summation over $D$ is $\sum_{s_i \in D} s_i$
 A: You have to be careful summing over sets because the order in which you sum might make a difference.  For example if a series converges but not absolutely, then you can rearrange the terms to converge to any real number.  So when you write:
$\sum_{n=1}^\infty a_n$ you have a clear order.  But if $D$ is a countably infinite set with no clear ordering, then the expression $\sum_{n\in D} a_n$ may not be well defined.  If, however, you know all $a_n\geq 0$ then it would make sense.
A: If by summing over a set you mean something like $\sum_{i\in I}a_i$, then yes. This is mathematically correct. In fact every sum can be seen that way, summing $a_0,\ldots,a_k$ is the same as summing $\sum_{i\in\{0,\ldots,k\}}a_i$.
This is mathematically valid. However you should probably listen the advice given to you by your advisor, since he is usually more knowledgeable in the conventions of the field you're working in. Try to look at some relevant papers and see if they do the same.
A: If $D=\{s_1,s_2,…,s_n\}$ and you want the sum of all these elements, then your sum should be $$\sum_{s \in D} s$$ or $$\sum_{i \in \{1,2,\ldots, n\}} s_i.$$
