Source code for dragon.search_space.bricks.dropout
import torch
from dragon.search_space.dag_encoding import Brick
[docs]
class Dropout(Brick):
def __init__(self, input_shape, rate):
super(Dropout, self).__init__(input_shape)
self.dropout = torch.nn.Dropout(p=rate)
[docs]
def forward(self, X):
X = self.dropout(X)
return X
[docs]
def modify_operation(self, input_shape):
pass