Exemplo n.º 1
0
    def build(self):
        """ Initialize the weights of the model
        """
        # For projecting on the keyboard space
        self.project_hidden = tfutils.single_layer_perceptron([music.NB_NOTES, self.args.hidden_size],
                                                              'project_hidden')

        # For projecting on the keyboard space
        self.project_keyboard = tfutils.single_layer_perceptron([self.args.hidden_size, music.NB_NOTES],
                                                                'project_keyboard')  # Should we do the activation sigmoid here ?
Exemplo n.º 2
0
    def build(self):
        """ Initialize the weights of the model
        """
        # TODO: Control over the the Cell using module arguments instead of global arguments (hidden_size and num_layer) !!
        # RNN network
        rnn_cell = tf.nn.rnn_cell.BasicLSTMCell(self.args.hidden_size, state_is_tuple=True)  # Or GRUCell, LSTMCell(args.hidden_size)
        if not self.args.test:  # TODO: Should use a placeholder instead
            rnn_cell = tf.nn.rnn_cell.DropoutWrapper(rnn_cell, input_keep_prob=1.0, output_keep_prob=0.9)  # TODO: Custom values
        rnn_cell = tf.nn.rnn_cell.MultiRNNCell([rnn_cell] * self.args.num_layers, state_is_tuple=True)

        self.rnn_cell = rnn_cell

        # For projecting on the keyboard space
        self.project_output = tfutils.single_layer_perceptron([self.args.hidden_size, 12 + 1],  # TODO: HACK: Input/output space hardcoded !!!
                                                               'project_output')  # Should we do the activation sigmoid here ?
Exemplo n.º 3
0
 def build(self):
     """ Initialize the weights of the model
     """
     self.rnn_cell = tfutils.get_rnn_cell(self.args, "deco_cell")
     self.project_key = tfutils.single_layer_perceptron([self.args.hidden_size, 1],
                                                'project_key')