Has my understanding of a generating set been wrong this entire time? My understanding of the generating set (informally) was the following

Pick any number of elements, say $g_1, g_2, \dotso, g_n$, in a finite group $G$. The set of all elements produced by a finite product of any combination of these elements is called the generating set of the elements $g_1, g_2, \dotso, g_n$.

However, the course notes had the following definition of a generating set.

If $S \subseteq$ G is a subset, then define $S^{-1} =  \left ( s^{-1} | s \in S  \right )$ and let $\langle S \rangle$ denote the set of all elements  of $G$ which can be written as finite products of elements of $S \bigcup S^{-1}.$

Am I missing something in my understanding of the generating set? Because in my understanding of it, there's absolutely nothing to do with any inverse elements whereas the course notes makes some mention of them for some reason.
 A: The book definition works with infinite groups, too. In the finite case, if you have $g$, then $g^{-1}=g^{|G|-1}$, so you don't need to specifically add inverses to the generation process.
A: Firstly you seem to have confused two things a "generating set" and the "subgroup generated by". In my opinion the correct definition of each is as follows: A subset $S$ of a group $G$ is a generating set of $G$ if for any subgroup $H$ of $G$ if $S \subseteq H$ then $H=G$. While if $S$ is a subset of a group $G$, the subgroup generated by $S$, often denoted $\langle S\rangle$, is the smallest subgroup of $G$ containing $S$.
The two concepts are related of course. A subset $S$ is a generating set for $G$ if and only if the subgroup generated by $S$ is $G$.
Finally one might be interested in constructing the subgroup generated by $S$. Trivially $\langle S\rangle = \cap\{H|S\subseteq H \leq G\}$. If one prefers one can build it inductively $S_0=\{e\}\cup S$, $S_n = \{x^{-1}y\,|\,x,y \in S_{n-1}\} \cup S_{n-1}$, then $\langle S \rangle = \cup \{S_i|i\in \mathbb{N}\}$ or one of many other equivalent ways. However as mentioned in the answer by Thomas Andrews above when $G$ is finite one can simply take $S_0=S$, $S_n=\{xy\,|\,x\in S,y\in S_{n-1}\}\cup S_{n-1}$ and then $\langle S\rangle = S_{|G|}$ corresponding to what you described above.
A: Here is an example to show you why it matters to include inverses of elements of $S$ when describing the generated subgroup. 
If you took $(\Bbb Z,+)$ and take $S=\{1\}$, the set of finite products (read sums since the operation is written additively) would only get you $\Bbb N$. (You would still get $0$ as an empty sum of $1$'s.)
When you only use the elements of $S$ and the operation to generate a subset of a subgroup, you are only guaranteed to get the monoid generated by $S$. You've got to throw in inverses in order to get the rest.
