def __call__(self, nn, train_history):
        with open(self.out_file+'_layers', 'w') as f:
            f.write("## Layer information")
            f.write("\n")

            layers_contain_conv2d = is_conv2d(list(nn.layers_.values()))
            if not layers_contain_conv2d or (nn.verbose < 2):
                layer_info = self._get_layer_info_plain(nn)
                legend = None
            else:
                layer_info, legend = self._get_layer_info_conv(nn)
            f.write(layer_info)
            if legend is not None:
                file.write(legend)
            f.write(" \n")
    def __call__(self, nn, train_history):
        with open(self.out_file+'_layers', 'w') as f:
            f.write("## Layer information")
            f.write("\n")

            layers_contain_conv2d = is_conv2d(list(nn.layers_.values()))
            if not layers_contain_conv2d or (nn.verbose < 2):
                layer_info = self._get_layer_info_plain(nn)
                legend = None
            else:
                layer_info, legend = self._get_layer_info_conv(nn)
            f.write(layer_info)
            if legend is not None:
                file.write(legend)
            f.write(" \n")
Example #3
0
 def test_is_conv2d_layer(self, nn, cnn, is_conv2d):
     assert is_conv2d(nn.layers_['input']) is False
     assert is_conv2d(cnn.layers_['pool2']) is False
     assert is_conv2d(cnn.layers_['conv1']) is True
Example #4
0
 def test_is_conv2d_net_true(self, cnn, is_conv2d):
     assert is_conv2d(cnn.layers_.values()) is True
Example #5
0
 def test_is_conv2d_net_false(self, nn, is_conv2d):
     assert is_conv2d(nn.layers_.values()) is False
Example #6
0
 def test_is_conv2d_layer(self, nn, cnn, is_conv2d):
     assert is_conv2d(nn.layers_['input']) is False
     assert is_conv2d(cnn.layers_['pool2']) is False
     assert is_conv2d(cnn.layers_['conv1']) is True
Example #7
0
 def test_is_conv2d_net_true(self, cnn, is_conv2d):
     assert is_conv2d(cnn.layers_.values()) is True
Example #8
0
 def test_is_conv2d_net_false(self, nn, is_conv2d):
     assert is_conv2d(nn.layers_.values()) is False
Example #9
0
 def test_is_conv2d_layer(self, nn, cnn, is_conv2d):
     assert is_conv2d(nn.layers_["input"]) is False
     assert is_conv2d(cnn.layers_["pool2"]) is False
     assert is_conv2d(cnn.layers_["conv1"]) is True