incorrect triples are put into a mini-batch. We compute the gradient and update the parameters after each mini-batch. When the iteration reaches a predefined number, we learn all the embedding for users, POIs, and spatiotemporal patterns.

Recommendation Using STA
------------------------

Once we have learned the embeddings, given a query user $u_q$ with the query time $t_q$ and location $l_q$, i.e., *q* = ($u_q$, $t_q$, $l_q$), we first combine $t_q$ and $l_q$ as a spatiotemporal pattern $tl_q$, and then we can get the potential POI $v_q$ using Eq. \[querypoi\]. $$\label{querypoi}
\small
   %\vec{v_{tlq}} = \vec{u_{tlq}} + \vec{tl_q}
   \vec{v_q} = \vec{u_q} M_{tl} + \vec{tl_q}$$

The learned POI embedding $v_q$ naturally reflects the user’s preference, because it encodes the users’ past activities in $\vec{u_q}$. It also captures the geographic and temporal influence in $\vec{tl_q}$.

For each POI $v \in V$, we compute its distance to the POI $v_q$ in the normed linear space as defined in Eq.  \[simpoi\], and then select the *k* POIs with the smallest ranking scores as recommendations. $$\label{simpoi}
\small
   %d(v_{tl}, v_{tlq}) = \parallel \vec{v_{tl}} - \vec{v_{tlq}} \parallel_1
   d(v, v_q) = \parallel \vec{v} M_{tl} - \vec{v_q} \parallel_1$$

We would like to emphasize our differences in computing $v_q$ and recommending POIs from 