\usepackage{subcaption}
\usepackage{wrapfig}
% \usepackage{multicol}
% \usepackage[ruled,vlined]{algorithm2e}
% \usepackage{algorithmic}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{siunitx}
\usepackage{dsfont}
\usepackage{hyperref}
\usepackage{scalerel}
\usepackage{booktabs}

% ref commands
\newcommand{\sect}[1]{Sec.~\ref{#1}}
\newcommand{\fig}[1]{Fig.~\ref{#1}}
\newcommand{\eq}[1]{Eq.~\eqref{#1}}
\newcommand{\app}[1]{Appendix~\ref{#1}}
\newcommand{\tab}[1]{Tab.~\ref{#1}}
\newcommand{\alg}[1]{Alg.~\ref{#1}}
% \newcommand{\algline}[1]{Line~\ref{#1}
\newcommand{\chp}[1]{Chapter~\ref{#1}}
\usepackage{float}

\usepackage{siunitx}
\usepackage{xcolor}
\newcommand{\nol}[1]{{\color{purple} [nol]: #1}}

% traj models specific
\newcommand{\mdptime}[0]{t}
\newcommand{\mdpstate}[0]{s}
\newcommand{\mdpaction}[0]{a}
\newcommand{\nextstate}[0]{\mdpstate_{\mdptime+1}}
\newcommand{\state}[0]{\mdpstate_\mdptime}
\newcommand{\action}[0]{a_t}
\newcommand{\hor}[0]{h}
\newcommand{\dynmod}[0]{f}
\newcommand{\traj}[0]{\mdpstate_{\mdptime+\hor}=\dynmod_\theta(\state,h,\theta_\pi)}	
\newcommand{\step}[0]{\nextstate=\dynmod_\theta(\state,\action)}	
% \newcommand{\dataset}[0]{\big\{ \bi)}	

\usepackage{tikz}

\newcommand{\cblock}[3]{
  \hspace{-1.5mm}
  \begin{tikzpicture}
    [
    node/.style={square, minimum size=10mm, thick, line width=0pt},
    ]
    \node[fill={rgb,255:red,#1;green,#2;blue,#3}] () [] {};
  \end{tikzpicture}%
}
\makeatletter
\newcommand{\bigplus}{%
  \DOTSB\mathop{\mathpalette\mattos@bigplus\relax}\slimits@
}
\newcommand\mattos@bigplus[2]{%
  \vcenter{\hbox{%
    \sbox\z@{$#1\sum$}%
    \resizebox{!}{0.9\dimexpr\ht\z@+\dp\z@}{\raisebox{\depth}{$\m@th#1+$}}%
  }}%
  \vphantom{\sum}%
}
\makeatother
\usepackage{amssymb}
\usepackage{fdsymbol}
\usepackage{wasysym}


%========================================================
% MATH
%--------------------------------------------------------

\newcommand{\abs}[1]{\left| #1 \right|}	% absolute value

\renewcommand{\vec}[1]{\boldsymbol{#1}}				% Vector
\newcommand{\mat}[1]{\boldsymbol{\capitalize{#1}}}		% Matrix
% \DeclareMathOperator{\diag}{\mathrm{diag}} 			% Diagonal matrix

\newcommand{\R}[0]{\mathds{R}}					% Real numbers

\renewcommand{\d}{\mathrm{d}}					% Derivate
\newcommand{\gradient}{\nabla}					% Gradient
\newcommand{\hessian}{H}					% Hessian
%\nomenclature{\hessian}{Hessian}

\newcommand{\inv}[0]{^{-1}} 					% Inverse
\newcommand{\T}[0]{^T} 						% Transpose

\newcommand{\norm}[1]{\left|\left| #1 \right|\right|} 		% Norm
\newcommand{\asin}[0]{\sin^{-1}} 	% 

\newcommand{\E}{\mathds{E}}	 				% expectation operator
% \DeclareMathOperator{\var}{\mathrm{var}} 			% variance
\newcommand{\varMat}[0]{\mat{\Sigma}}
\newcommand{\prob}{{p}} 					% probability density function
\newcommand{\normcdf}[1]{\Phi\left( #1 \right)} 		% Normal Cumulative distribution function
\newcommand{\normpdf}[1]{\phi\left( #1 \right)} 		% Normal probability density function
\newcommand{\gaussNo}[0]{\mathcal{N}}	% Gaussian Distribution
\newcommand{\gauss}[2]{\gaussNo \left( #1, #2 \right)}	% Gaussian Distribution
\newcommand{\unifNo}[0]{\mathcal{U}}
\newcommand{\unif}[2]{\unifNo \left( #1,#2 \right)}


\newcommand{\degrees}[0]{\circ}


%========================================================
% MACHINE LEARNING
%--------------------------------------------------------

\newcommand{\D}[0]{\mathcal{D}} 				% Dataset
\newcommand{\dataset}[0]{\mathcal{D}}
\newcommand{\trainingset}[0]{\mathcal{D}}

\newcommand{\inputSca}[0]{\theta} % x
\newcommand{\inputVec}[0]{\vec{\inputSca}}
\newcommand{\inputMatrix}[0]{\mat{\inputSca}}

\newcommand{\outputSca}[0]{y}
\newcommand{\outputVec}[0]{\vec{\outputSca}}
\newcommand{\outputMatrix}[0]{\mat{\outputSca}}

\newcommand{\latentMatrix}[0]{\mat{h}}

\newcommand{\testInputVec}[0]{\inputVec^*}

\newcommand{\dimInputs}{D}
\newcommand{\dimLatents}{Q}
\newcommand{\dimTargets}{P}

\newcommand{\inputSpace}[0]{\mathcal{X}}
\newcommand{\inputsSpace}{\mathcal{X}}
\newcommand{\targetsSpace}{\mathcal{Y}}
\newcommand{\latentsSpace}{\mathcal{H}}
\newcommand{\reallatentsSpace}{\mathcal{L}}

\newcommand{\regressionNo}[0]{f}
\newcommand{\regression}[1]{\regressionNo \left( #1 \right)}

\newcommand{\measurementNoise}[0]{\epsilon}
\newcommand{\noise}{\measurementNoise}

\newcommand{\parameterModel}[0]{\gamma}
\newcommand{\parametersModel}[0]{\vec{\parameterModel}}

\newcommand{\parameterReward}[0]{\gamma}
\newcommand{\parametersReward}[0]{\vec{\parameterModel}}

\newcommand{\loss}[0]{\mathcal{L}}

\newcommand{\nDimInput}[0]{\dimparameters}

\newcommand{\MDPSetState}{\mathcal{S}}				% Set possible States
\newcommand{\MDPSetAction}{\mathcal{A}}				% Set possible Actions
\newcommand{\MDPprobability}{z}			% Transition function
\newcommand{\MDPreward}{r}
\newcommand{\MDPState}{\vec{s}} 				% State
\newcommand{\MDPAction}{\vec{a}}				% Action
\newcommand{\MDPObservation}{\vec{o}}				% Action
\newcommand{\MDPTime}{t}					% Time

\newcommand{\MDPdimState}[0]{n}
\newcommand{\MDPdimAction}[0]{m}


\newcommand{\mean}[0]{\mu}
\newcommand{\std}[0]{\sigma}
\newcommand{\variance}[0]{\std^2}


%========================================================
% OPTIMIZATION
%--------------------------------------------------------

\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
% \DeclareMathOperator*{\minimize}{\text{arg min}}
\newcommand{\maximize}[0]{\text{arg max}} 			% Maximize

\newcommand{\parameter}[0]{\theta} 				% Parameter
\newcommand{\parameters}[0]{\vec{\parameter}} 			% Parameters
\newcommand{\context}[0]{\vec{c}}
\newcommand{\dimparameters}{d}					% Dimensionality parameters
\newcommand{\objfuncNo}[0]{f}					% Objective function
\newcommand{\objfunc}[1]{\objfuncNo\left(#1\right)}		% Objective function (as a function)
\newcommand{\gradientline}{\d \objfunc{\parameters}/\d \parameters}
\newcommand{\objeval}[0]{y}
\newcommand{\objevals}[0]{\vec{\objeval}}
\newcommand{\iteration}[0]{t}

\newcommand{\titlelong}[0]{Learning Accurate Long-term Dynamics \\ for Model-based Reinforcement Learning}
\newcommand{\website}[0]{\url{https://sites.google.com/view/trajectory-prediction/}}

\newcommand\hmmax{0}
\newcommand\bmmax{0}