I have this algorithm steps I coded in LaTeX as follows:
\begin{algorithm}
\caption{Deep Q-Learning with Experience Replay}
\label{alg:DQN}
\begin{algorithmic}
\State Initialize replay memory $\mathcal{D}$ to capacity $N$
\State Initialize action-value function $Q$ with two random sets of weights $\theta, \theta'$
\For{$episode = 1,M$}
\For{$t = 1,T$}
\State
Select a random action $a_t$ with probability $\varepsilon$.
\State
Otherwise, select $a_t = {\arg\max}_a Q(s_t, a; \theta)$
\State Execute action $a_t$, collect reward $r_{t+1}$ and observe next state $s_{t+1}$
\State Store the transition $(s_t, a_t, r_{t+1}, s_{t+1})$ in $\mathcal{D}$
\State Sample mini-batch of transitions $(s_j, a_j, r_{j+1}, s_{j+1})$ from $\mathcal{D}$
\State Set $ y_j = \begin{cases}
r_{j+1}, & \mbox{if } s_{j+1}\mbox{ is terminal} \\
r_{j+1} + \gamma \max_{a'} Q(s_{j+1}, a'; \theta'), & \mbox{otherwise}
\end{cases}$
\State Perform a gradient descent step using targets $y_j$ with respect to the online parameters $\theta$
\State Every $C$ steps, set $\theta' \leftarrow \theta$
\EndFor
\EndFor
\end{algorithmic}
\end{algorithm}
Is there a way to convert this photo or algorithm to a word document without using an image of a latex document?
I tried to use insert equation in MS word but it didn't work.
Best Answer
This is a method I use often. (A 5 minute job)
(1) Prepare your LaTeX file with the content to be converted. In this example called
Test2WORD.tex
. You can use a system font that is already on your system. Here I am usingcalibri
, the font I will be using in my main word document.File Test2WORD.tex
(2) Compile and generate
Test2WORD.pdf
Output
(3) Open
Test2WORD.pdf
using ms-word (I am using word 2013).The Word document is in the selected font and is fully editable. See the yellow highlight I made.
I found two places that need to be corrected (in red).