\begin{Verbatim}[commandchars=\\\{\}]
\PYG{k+kn}{import} \PYG{n+nn}{cyanure} \PYG{k+kn}{as} \PYG{n+nn}{ars}
\PYG{c+c1}{\PYGZsh{}load ckn\PYGZus{}mnist dataset 10 classes, n=60000, p=2304}
\PYG{n}{data}\PYG{o}{=}\PYG{n}{np}\PYG{o}{.}\PYG{n}{load}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}ckn\PYGZus{}mnist.npz\PYGZsq{}}\PYG{p}{);} \PYG{n}{y}\PYG{o}{=}\PYG{n}{data}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}y\PYGZsq{}}\PYG{p}{];} \PYG{n}{X}\PYG{o}{=}\PYG{n}{data}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}X\PYGZsq{}}\PYG{p}{]}
\PYG{c+c1}{\PYGZsh{}center and normalize the rows of X in\PYGZhy{}place, without performing any copy}
\PYG{n}{ars}\PYG{o}{.}\PYG{n}{preprocess}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{centering}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{,}\PYG{n}{normalize}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{,}\PYG{n}{columns}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)}
\PYG{c+c1}{\PYGZsh{}declare a multinomial logistic classifier with group Lasso regularization}
\PYG{n}{classifier}\PYG{o}{=}\PYG{n}{ars}\PYG{o}{.}\PYG{n}{MultiClassifier}\PYG{p}{(}\PYG{n}{loss}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}logistic\PYGZsq{}}\PYG{p}{,}\PYG{n}{penalty}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}l2\PYGZsq{}}\PYG{p}{)}
\PYG{c+c1}{\PYGZsh{} uses the auto solver by default, performs at most 500 epochs}
\PYG{n}{classifier}\PYG{o}{.}\PYG{n}{fit}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{y}\PYG{p}{,}\PYG{n}{lambd}\PYG{o}{=}\PYG{l+m+mf}{0.01}\PYG{o}{/}\PYG{n}{X}\PYG{o}{.}\PYG{n}{shape}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{],}\PYG{n}{nepochs}\PYG{o}{=}\PYG{l+m+mi}{500}\PYG{p}{,}\PYG{n}{tol}\PYG{o}{=}\PYG{l+m+mf}{1e\PYGZhy{}3}\PYG{p}{)}
\end{Verbatim}
