Skip to content

Commit

Permalink
Add doctest block for maxout mlp
Browse files Browse the repository at this point in the history
  • Loading branch information
paniabhisek committed May 29, 2020
1 parent 40d8d6e commit 81c42b8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions maxout.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ def __init__(self, input_size,
:param linear_neurons: number of neurons in each linear
layer before max operation
:type linear_neurons: :py:obj:`int`
:Example:
>>> from time import time
>>> import torch
>>> def fun(times):
... s = time()
... for i in range(times):
... torch.nn.Linear(784, 2048)(torch.randn(10, 784))
... print(time() - s)
...
>>> fun(100)
1.0891399383544922
>>> def fun1(times):
... s = time()
... torch.nn.Linear(784, 2048 * times)(torch.randn(10, 784))
... print(time() - s)
...
>>> fun1(100)
1.425891399383545
"""
super(MaxoutMLP, self).__init__()

Expand Down

0 comments on commit 81c42b8

Please sign in to comment.