2
\documentclass[12pt]{article}
\usepackage{array}
\usepackage{float}
\usepackage[table,xcdraw]{xcolor}
\usepackage[utf8]{inputenc}
\usepackage{ragged2e}
\usepackage{tabularx}
\begin{document}
\begin{table}[htbp]
\begin{center}
\begin{tabular}{|c|l|l|}
\hline
\textbf{Feature} & \multicolumn{1}{|c|}{\textbf{Q-Learning}} & \multicolumn{1}{|c|}{\textbf{DDQN}} \\ \hline
Function Approximation & No, uses a Q-table for state-action values. & Yes, uses deep neural networks to approximate Q-values. \\ \hline
Scalability & Limited to small state and action spaces. & Scales well to large and continuous state spaces. \\ \hline
Overestimation Bias & Prone to overestimation of Q-values. & Reduces overestimation bias by decoupling action selection and evaluation. \\ \hline
Learning Stability & Can be unstable and diverge in complex environments. & More stable learning process due to target network. \\ \hline
Exploration Efficiency & Simple exploration mechanisms like $\epsilon$-greedy. & Efficient exploration with experience replay and target network updates.\\ \hline
Sample Efficiency & Low, requires a large number of interactions with the environment. & Higher, reuses past experiences for learning.\\ \hline
Convergence Speed & Slower, especially in large or complex environments. & Faster convergence due to stable training and reduced bias.\\ \hline
\end{tabular}
\caption{Difference between Q-Learning and DDQN}
\label{tab:Ql_vs_SRS}
\end{center}
\end{table}
\end{document}

The result I get is this enter image description here I cannot see DDQN column at all and it is outside of range of page. How can I solve this problem?

1

1 Answer 1

5

You need to allow automatic line-breaking in at least columns 2 and 3, and ideally in all three columns. Unfortunately, the c and l column types do not allow automatic line-breaking.

I suggest you switch from a tabular to a tabularx environment and set its target width to \textwidth. In the code below, I use the L column type for all three columns; the L column type is just like the basic X column type of the tabularx environment, except that it doesn't impose full justification (while still allowing hyphenation).

Separately, I'd also give the table a much more open and inviting "look" by getting rid of all vertical rules and using fewer, but well-spaced, horizontal rules. And, do consider not using bold-facing for the material in the header row.

enter image description here

\documentclass[12pt]{article}
%\usepackage{array} % 'array' is loaded automatically by 'tabularx'
\usepackage{amsmath} % for '\nobreakdash' macro
\usepackage[table,xcdraw]{xcolor}
%\usepackage[utf8]{inputenc} % that's the default nowadays
\usepackage[T1]{fontenc}
\usepackage[english]{babel}

\usepackage{ragged2e,tabularx}
\newcolumntype{L}{>{\RaggedRight}X}
\usepackage{booktabs} % for well-spaced horizontal rules

\begin{document}

\begin{table}[htbp]
\setlength\tabcolsep{4pt} % default: 6pt

\begin{tabularx}{\textwidth}{@{}LLL@{}}
\toprule
Feature & Q-Learning & DDQN \\ 
\midrule
Function Approximation & No, uses a Q-table for state-action values. 
                       & Yes, uses deep neural networks to approximate Q\nobreakdash-values. \\ 
                       \addlinespace
Scalability            & Limited to small state and action spaces. 
                       & Scales well to large and continuous state spaces. \\ 
                       \addlinespace
Overestimation Bias    & Prone to overestimation of Q\nobreakdash-values. 
                       & Reduces overestimation bias by decoupling action selection and evaluation. \\ 
                       \addlinespace
Learning Stability     & Can be unstable and diverge in complex environments. 
                       & More stable learning process due to target network. \\ 
                       \addlinespace
Exploration Efficiency & Simple exploration mechanisms like $\epsilon$\nobreakdash-greedy. 
                       & Efficient exploration with experience replay and target network updates. \\ 
                       \addlinespace
Sample Efficiency      & Low, requires a large number of interactions with the environment. 
                       & Higher, reuses past experiences for learning. \\ 
                       \addlinespace
Convergence Speed      & Slower, especially in large or complex environments. 
                       & Faster convergence due to stable training and reduced bias. \\ 
\bottomrule
\end{tabularx}

\caption{Differences between Q-Learning and DDQN}
\label{tab:Ql_vs_SRS}

\end{table}

\end{document}
3
  • 1
    Thanks @Mico How can I put it in a horizontal line for each row?
    – MacTavish
    Commented May 25 at 7:40
  • @MacTavish - You could replace the \addlinespace instructions with \midrule. Speaking for myself (who else?), though, I'd go with the more open look provided by the \addlinespace approach to row separation.
    – Mico
    Commented May 25 at 7:55
  • 1
    Got it @Mico Thanks
    – MacTavish
    Commented May 25 at 8:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .