Guest User

Untitled

a guest
Dec 9th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 2.24 KB | None | 0 0
  1. \documentclass[twocolumn]{article}
  2.  
  3. \usepackage{algorithm2e}
  4. \usepackage{showframe}
  5.  
  6. \begin{document}
  7.  
  8. \begin{algorithm}%[H]
  9. {\small
  10. \SetAlgoLined
  11. \SetKwInOut{Input}{Input}
  12. \SetKwInOut{Output}{Output}
  13. \SetKwInOut{Assign}{Assign}
  14. \SetKwInOut{Initialization}{Initialization}
  15. \SetKwInOut{Iteration}{Iteration}
  16. \SetKwInOut{Require}{Require}
  17. \SetKwInOut{End}{End}
  18. \SetKwInOut{Solution}{Solution}
  19. %\Require{} ${\mathbf \alpha}, \beta, {\mathbf \gamma}_d$, Corpus{\small
  20. \Input{${\mathbf \alpha}, \beta, {\mathbf \gamma}_d$, Corpus (labeled and unlabeled)}
  21. %\Output{Ticket-topic matrix $\mat{U} \in {\mathbb R}_{\geq 0}^{n \times k}$, term-topic matrix $\mat{V} \in {\mathbb R}_{\geq 0}^{m \times k}$ and concept-topic matrix $\mat{W} \in {\mathbb R}_{\geq 0}^{h \times k}$}
  22. \Initialization{ Initialize ${\bf \alpha} = (\alpha_1, \alpha_2, \ldots, \alpha_k)$\;
  23.                             \hspace*{2.2cm}${\beta}$\;
  24.                                                       \hspace*{2.2cm}$\gamma = (\gamma_1, \gamma_2, \ldots, \gamma_d)$\;
  25. Initialize $D \times T$ matrix ${\mathbf \Theta}$, $D \times T \times S$ matrix ${\mathbf \Pi}$, $T \times S \times V$ matrix $\Phi$;}
  26. \For{i = 1 to {\em max} Gibbs sampling iterations}
  27.     { \For{all documents $d \in \{1,2, \ldots, D\}$}
  28.        { \For {all words $w_t,\, t \in \{1,2, \ldots, N_d\}$}
  29.                         {Exclude $w_t$ associated with topic $j$ and sentiment label $k$ from variables $N_{d,j}, N_{d,j,k}$, $N_{j,k,i}, N_j,k$ and $N_d$\;    
  30.                         Sample a new topic sentiment pair $\bar{z}$ and $\bar{l}$ using Eqn.~\ref{computedJointpWTS}\;
  31.                Update variables $N_{d,j}, N_{d,j,k}$, $N_{j,k,i}, N_j,k$ and $N_d$ using the new topic label $\bar{z}$ and sentiment label $\bar{k}$\;
  32.                                                                     }
  33.                                         }
  34.                                         \For{every 5 iterations}
  35.                                          {Update hyperparameter $\bar{\alpha}$ with the maximum likelihood estimation according to Eqn~\ref{mAlpha} as discussed below}
  36.                                         \eIf{number of iterations $\geq$ {\em max} Gibbs sampling iterations}
  37.                                         {Update the matrices $\Theta, \Pi$ and $\Phi$ with new sampling results given by Eqns~\ref{Mtheta},~\ref{Mpi} and~\ref{Mvarpsi}  }{{\rm True}}
  38.                                     }
  39.     %\End{}
  40. %\Return{\mat{V}, \mat{W}$\;}
  41. }
  42.  \caption{Gibbs sampling procedure for LJST}
  43. \end{algorithm}
  44.  
  45. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment