Skip to content

Commit

Permalink
rm \align
Browse files Browse the repository at this point in the history
  • Loading branch information
astonzhang committed Dec 9, 2019
1 parent 508eaa2 commit fe07daf
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions chapter_generative_adversarial_networks/dcgan.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ class G_block(nn.Block):

In default, the transposed convolution layer uses a $4\times 4$ kernel, $2\times 2$ strides and $1\times 1$ padding. With a input size of $16 \times 16$, it will double input's width and height.

\begin{align}
n_h^{'} \times n_w^{'} &= [(n_h k_h - (n_h-1)(k_h-s_h)- 2p_h] \times [(n_w k_w - (n_w-1)(k_w-s_w)- 2p_w]\\
&= [(k_h + s_h (n_h-1)- 2p_h] \times [(k_w + s_w (n_w-1)- 2p_w]\\
&= [(4 + 2 \times (16-1)- 2 \times 1] \times [(4 + 2 \times (16-1)- 2 \times 1]\\
&= 32 \times 32 .\\
\end{align}


```{.python .input n=6}
x = np.zeros((2, 3, 16, 16))
g_blk = G_block(20)
Expand Down Expand Up @@ -149,13 +141,7 @@ class D_block(nn.Block):
return self.activation(self.batch_norm(self.conv2d(X)))
```

A basic block with default settings will halve the width and height of the inputs. For example, given a input of shape $16 \times 16$:

\begin{align}
n_h^{'} \times n_w^{'} &= \lfloor(n_h-k_h+2p_h+s_h)/s_h\rfloor \times \lfloor(n_w-k_w+2p_w+s_w)/s_w\rfloor\\
&= \lfloor(16-4+2\times 1+2)/2\rfloor \times \lfloor(16-4+2\times 1+2)/2\rfloor\\
&= 8 \times 8 .\\
\end{align}
A basic block with default settings will halve the width and height of the inputs.

```{.python .input n=12}
x = np.zeros((2, 3, 16, 16))
Expand Down

0 comments on commit fe07daf

Please sign in to comment.