def remove_maxpools(self, domain): from plnn.model import reluify_maxpool, simplify_network if any(map(lambda x: type(x) is nn.MaxPool1d, self.layers)): new_layers = simplify_network(reluify_maxpool(self.layers, domain)) self.layers = new_layers
def remove_maxpools(self, domain, no_opt=False): if any(map(lambda x: type(x) is nn.MaxPool1d, self.layers)): new_layers = simplify_network( reluify_maxpool(self.layers, domain, no_opt)) self.layers = new_layers