Skip to content

Instantly share code, notes, and snippets.

@opilar
Last active June 20, 2017 14:35
Show Gist options
  • Save opilar/7885533e5ad4e01e799e193925dee07e to your computer and use it in GitHub Desktop.
Save opilar/7885533e5ad4e01e799e193925dee07e to your computer and use it in GitHub Desktop.
% Настраиваем общее для всех языков оформление листинга
\lstset{
tabsize=4, % длина табуляции в пробелах
formfeed=\newpage, % реакция на символ "form feed"
extendedchars=true, % используем неанглийские буквы
basicstyle=\ttfamily, % базовый стиль
commentstyle=\rmfamily\itshape, % стиль для комментариев
showspaces=false,
showstringspaces=false,
numbersep=1em, % расстояние (по горизонтали) от номеров строк до кода
}
\begin{lstlisting}[language=Python]
class Network(object):
def __init__(self, sizes):
self.num_layers = len(sizes)
self.sizes = sizes
self.biases = [np.random.randn(y, 1) for y in sizes[1:]]
self.weights = [np.random.randn(y, x)
for x, y in zip(sizes[:-1], sizes[1:])]
\end{lstlisting}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment