# Path: cortex/built_ins/networks/fully_connected.py
# class FullyConnectedNet(BaseNet):
# 
#     def __init__(self, dim_in, dim_out=None, dim_h=64, dim_ex=None,
#                  nonlinearity='ReLU', n_levels=None, output_nonlinearity=None,
#                  normalize_input=False, **layer_args):
#         super(FullyConnectedNet, self).__init__(
#             nonlinearity=nonlinearity, output_nonlinearity=output_nonlinearity)
# 
#         dim_h = self.get_h(dim_h, n_levels=n_levels)
# 
#         if normalize_input:
#             self.models.add_module('initial_bn', nn.BatchNorm1d(dim_in))
# 
#         dim_in = self.add_linear_layers(dim_in, dim_h, dim_ex=dim_ex,
#                                         **layer_args)
#         self.add_output_layer(dim_in, dim_out)


from cortex.built_ins.networks.fully_connected import FullyConnectedNet
from torch import nn


def test_fully_connected_build():
    """

    Asserts: True if a the FullyConnectedNet has correct layers and
             attributes.

    """
    dim_in = 4096
    dim_out = 10
    dim_h = 64
    dim_ex = None
    nonlinearity = 'ReLU'
    n_levels = None
    output_nonlinearity = None
    layer_args = {}

    expected_name_linear = 'linear_({}/{})'.format(dim_in, dim_h)
    expected_name_relu = 'linear_({}/{})_{}'.format(dim_in, dim_h, 'ReLU')
    expected_name_out = 'linear_({}/{})_{}'.format(dim_h, dim_out, 'out')


# Path: cortex/built_ins/networks/fully_connected.py
# class FullyConnectedNet(BaseNet):
# 
#     def __init__(self, dim_in, dim_out=None, dim_h=64, dim_ex=None,
#                  nonlinearity='ReLU', n_levels=None, output_nonlinearity=None,
#                  normalize_input=False, **layer_args):
#         super(FullyConnectedNet, self).__init__(
#             nonlinearity=nonlinearity, output_nonlinearity=output_nonlinearity)
# 
#         dim_h = self.get_h(dim_h, n_levels=n_levels)
# 
#         if normalize_input:
#             self.models.add_module('initial_bn', nn.BatchNorm1d(dim_in))
# 
#         dim_in = self.add_linear_layers(dim_in, dim_h, dim_ex=dim_ex,
#                                         **layer_args)
#         self.add_output_layer(dim_in, dim_out)


# Path: tests/built_ins/networks/test_fully_connected.py
from cortex.built_ins.networks.fully_connected import FullyConnectedNet
from torch import nn



def test_fully_connected_build():
    """

    Asserts: True if a the FullyConnectedNet has correct layers and
             attributes.

    """
    dim_in = 4096
    dim_out = 10
    dim_h = 64
    dim_ex = None
    nonlinearity = 'ReLU'
    n_levels = None
    output_nonlinearity = None
    layer_args = {}

    expected_name_linear = 'linear_({}/{})'.format(dim_in, dim_h)
    expected_name_relu = 'linear_({}/{})_{}'.format(dim_in, dim_h, 'ReLU')
    expected_name_out = 'linear_({}/{})_{}'.format(dim_h, dim_out, 'out')


    fully_connected_net = FullyConnectedNet(dim_in, dim_out, dim_h, dim_ex,