\documentclass{uai2024} % for initial submission
%\documentclass[accepted]{uai2024} % after acceptance, for a revised version; 
% also before submission to see how the non-anonymous paper would look like 
                        
%% There is a class option to choose the math font
% \documentclass[mathfont=ptmx]{uai2024} % ptmx math instead of Computer
                                         % Modern (has noticeable issues)
% \documentclass[mathfont=newtx]{uai2024} % newtx fonts (improves upon
                                          % ptmx; less tested, no support)
% NOTE: Only keep *one* line above as appropriate, as it will be replaced
%       automatically for papers to be published. Do not make any other
%       change above this note for an accepted version.

%% Choose your variant of English; be consistent
\input{math_commands.tex}

\usepackage[american]{babel}
% \usepackage[british]{babel}

%% Some suggested packages, as needed:
\usepackage{natbib} % has a nice set of citation styles and commands
    \bibliographystyle{plainnat}
    \renewcommand{\bibsection}{\subsubsection*{References}}
\usepackage{mathtools} % amsmath with fixes and additions
% \usepackage{siunitx} % for proper typesetting of numbers and units
\usepackage{booktabs} % commands to create good-looking tables
\usepackage{tikz} % nice language for creating drawings and diagrams

\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc}    % use 8-bit T1 fonts
\usepackage{hyperref}       % hyperlinks
\usepackage{url}            % simple URL typesetting
\usepackage{booktabs}       % professional-quality tables
\usepackage{amsfonts}       % blackboard math symbols
\usepackage{nicefrac}       % compact symbols for 1/2, etc.
\usepackage{microtype}      % microtypography
\usepackage{xcolor}         % colors
\usepackage{bbm}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage[ruled,vlined,linesnumbered,algo2e,noend]{algorithm2e}
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{pifont}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{arydshln}
\usepackage{enumitem}
\usepackage{bbm}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}{Proposition}
\newtheorem{lemma}{Lemma}
\newtheorem{corollary}{Corollary}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem{assumption}{Assumption}
\newtheorem{remark}{Remark}

\DeclareMathOperator{\concat}{concat}
\DeclareMathOperator{\flatten}{flatten}
\DeclareMathOperator{\oodavg}{OOD_{Avg}}
\DeclareMathOperator{\idavg}{ID_{Avg}}
\DeclareMathOperator{\oodwrt}{OOD_{Wrt}}
\DeclareMathOperator{\acc}{acc}
\DeclareMathOperator{\enc}{Enc}
\DeclareMathOperator{\trans}{Trans}
\DeclareMathOperator{\lstm}{LSTM}
\DeclareMathOperator{\diam}{diam}

\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%

\newcommand{\hoang}[1]{\textcolor{red}{#1}}
\newcommand{\xr}[1]{\textcolor{blue}{#1}}
\newcommand{\xueru}[1]{\textcolor{purple}{#1}}
%% Provided macros
% \smaller: Because the class footnote size is essentially LaTeX's \small,
%           redefining \footnotesize, we provide the original \footnotesize
%           using this macro.
%           (Use only sparingly, e.g., in drawings, as it is quite small.)

%% Self-defined macros
\newcommand{\swap}[3][-]{#3#1#2} % just an example

\title{Non-stationary Domain Generalization: Theory and Algorithm\\(Supplementary Material)}

\begin{document}
\maketitle

\onecolumn

\paragraph{Visualization of conventional domain generalization and non-stationary domain generalization settings.}

Figure~\ref{fig:1} shows the difference between conventional domain generalization and non-stationary domain generalization settings. In particular, domains in conventional domain generalization are independently sampled from a stationary environment, whereas non-stationary domain generalization considers domains that evolve along a specific direction (e.g., time, space). Furthermore, an analysis of the Yearbook dataset is presented in Figure~\ref{fig:2}, examining which characteristics of portrait images change over time. Notably, the analysis reveals a noticeable increase in smiles over time.

\begin{figure}[h!]
    \centering
    \includegraphics[width=\linewidth]{figs/Temporal_DG.png}
    \caption{An illustrative comparison between conventional domain generalization and domain generalization in non-stationary environment: domains in conventional domain generalization are independently sampled from a stationary environment, whereas domain generalization in non-stationary environment considers domains that evolve along a specific direction. As shown in the right plot, data (i.e., images) changes over time due to evolution of visual concepts, fashion, social norms, and population demographics over time and the model trained on past data may not have good performance on future data due to non-stationarity (i.e., temporal shift).}
    \label{fig:1}
\end{figure}

\begin{figure}[h!]
    \centering
    \includegraphics[width=0.8\linewidth]{uai2024-template/figs/all_avg_lip_curve_5yr_std.png}
    \caption{Average lip curvature of male and female students over years. As we can see, miles increasing over time, but women always smile more than men.}
    \label{fig:2}
\end{figure}

\paragraph{Algebraic motivating example for non-stationary domain generalization.} We precisely define the non-stationary mapping for our synthetic datasets as follows.

\begin{itemize}
    \item \textbf{Circle}: A synthetic dataset  containing 30 domains. Features $X:=[X_1,X_2]^T$ in domain $t$ are two-dimensional and Gaussian distributed with mean $\Bar{X}^t = [r\cos(\pi t / 30), r\sin(\pi t / 30)]$ where $r$ is radius of semicircle; the distributions of different domains have the same covariance matrix but different means that uniformly evolve from right to left on a semicircle. Binary label $Y$ are generated based on labeling function $Y=\mathbbm{1}\left[ (X_1-x^o_1)^2 + (X_2-x^o_2)^2 \leq r \right]$, where $(x^o_1, x^o_2)$ are center of semicircle. \newline
    $\Rightarrow \mathbbm{m}_t = \begin{bmatrix}
    \cos(\pi / 30) & -\sin(\pi / 30)\\ 
    \sin(\pi / 30) & \cos(\pi / 30)
    \end{bmatrix} \forall t \in [1, \cdots, 29]$
    \item \textbf{Circle-Hard}: A synthetic dataset adapted from \textbf{Circle} dataset, where mean $\Bar{X}^t$ does not uniformly evolve. Instead, $\Bar{X}^t = [r\cos(\theta_t), r\sin(\theta_t)]$ where $\theta_t = \theta_{t-1} + \pi (t - 1) / 180$ and $\theta_{1} = 0 \, \text{rad}$. \newline
    $\Rightarrow \mathbbm{m}_t = \begin{bmatrix}
    \cos(\pi t / 180) & -\sin(\pi t / 180)\\ 
    \sin(\pi t / 180) & \cos(\pi t / 180)
    \end{bmatrix} \forall t \in [1, \cdots, 19]$
    \item \textbf{RMNIST}: A dataset constructed from MNIST by $R$-degree counterclockwise rotation. We evenly select 30 rotation angles $R$ from $0^{\circ}$ to $180^{\circ}$ with step size $6^{\circ}$; each angle corresponds to a domain. \newline
    $\Rightarrow \mathbbm{m}_t = \begin{bmatrix}
    \cos(6^\circ) & -\sin(6^\circ)\\ 
    \sin(6^\circ) & \cos(6^\circ)
    \end{bmatrix} \forall t \in [1, \cdots, 29]$ 
\end{itemize}

\paragraph{Qualitative evaluation on Circle-Hard dataset.} Figure~\ref{fig:3} visualizes predictions on the Circle-Hard dataset generated by ERM and AIRL (our method). 

\paragraph{Qualitative evaluation on Circle-Hard dataset.} Figure~\ref{fig:3} visualizes predictions on the Circle-Hard dataset generated by ERM and AIRL (our method). 

\begin{figure}[h!]
    \centering
    \includegraphics[width=\linewidth]{figs/uai2024.png}
    \caption{Visualization of predictions on the Circle-Hard dataset generated by ERM and AIRL (our method). We train models on the first 10 domains (right half) and evaluate on the remaining 10 domains (left half). As depicted in this figure, our method, designed to capture non-stationary patterns across domains, generates more accurate predictions for target domains compared to ERM.}
    \label{fig:3}
\end{figure}

 \end{document}

