'Initializes parameters required to run this network.
Args:
component: parent ComponentBuilderBase object.
Parameters used to construct the network:
hidden_layer_sizes: comma-separated list of ints, indicating the
number of hidden units in each hidden layer.
layer_norm_input (False): Whether or not to apply layer normalization
on the concatenated input to the network.
layer_norm_hidden (False): Whether or not to apply layer normalization
to the first set of hidden layer activations.
nonlinearity (\'relu\'): Name of function from module "tf.nn" to apply to
each hidden layer; e.g., "relu" or "elu".
dropout_keep_prob (-1.0): The probability that an input is not dropped.
If >= 1.0, disables dropout.  If < 0.0, uses the global |dropout_rate|
hyperparameter.
dropout_per_sequence (False): If true, sample the dropout mask once per
sequence, instead of once per step.  See Gal and Ghahramani
(https://arxiv.org/abs/1512.05287).
dropout_all_layers (False): If true, apply dropout to the input of all
hidden layers, instead of just applying it to the network input.
Hyperparameters used:
dropout_rate: The probability that an input is not dropped.  Only used
when the |dropout_keep_prob| parameter is negative.'

def __init__(self, component):

    self._attrs = get_attrs_with_defaults(component.spec.network_unit.parameters, defaults={'hidden_layer_sizes': '', 'layer_norm_input': False, 'layer_norm_hidden': False, 'nonlinearity': 'relu', 'dropout_keep_prob': (-1.0), 'dropout_per_sequence': False, 'dropout_all_layers': False})
    self._hidden_layer_sizes = (map(int, self._attrs['hidden_layer_sizes'].split(',')) if self._attrs['hidden_layer_sizes'] else [])
    super(FeedForwardNetwork, self).__init__(component)
    self._dropout_rate = self._attrs['dropout_keep_prob']
    if (self._dropout_rate < 0.0):
        self._dropout_rate = component.master.hyperparams.dropout_rate
    self._layer_norm_input = None
    self._layer_norm_hidden = None
    if self._attrs['layer_norm_input']:
        self._layer_norm_input = LayerNorm(self._component, 'concat_input', self._concatenated_input_dim, tf.float32)
        self._params.extend(self._layer_norm_input.params)
    if self._attrs['layer_norm_hidden']:
        self._layer_norm_hidden = LayerNorm(self._component, 'layer_0', self._hidden_layer_sizes[0], tf.float32)
        self._params.extend(self._layer_norm_hidden.params)
    self._nonlinearity = getattr(tf.nn, self._attrs['nonlinearity'])
    self._weights = []
    last_layer_dim = self._concatenated_input_dim
    for (index, hidden_layer_size) in enumerate(self._hidden_layer_sizes):
        weights = tf.get_variable(('weights_%d' % index), [last_layer_dim, hidden_layer_size], initializer=tf.random_normal_initializer(stddev=0.0001))
        self._params.append(weights)
        if ((index > 0) or (self._layer_norm_hidden is None)):
            self._params.append(tf.get_variable(('bias_%d' % index), [hidden_layer_size], initializer=tf.constant_initializer(0.2, dtype=tf.float32)))
        self._weights.append(weights)
        self._layers.append(Layer(component, name=('layer_%d' % index), dim=hidden_layer_size))
        last_layer_dim = hidden_layer_size
    if self._hidden_layer_sizes:
        self._layers.append(Layer(component, 'last_layer', last_layer_dim))
    self._regularized_weights.extend(self._weights)
    if component.num_actions:
        self._params.append(tf.get_variable('weights_softmax', [last_layer_dim, component.num_actions], initializer=tf.random_normal_initializer(stddev=0.0001)))
        self._params.append(tf.get_variable('bias_softmax', [component.num_actions], initializer=tf.zeros_initializer()))
        self._layers.append(Layer(component, name='logits', dim=component.num_actions))
