3.1-AIND-VUI-speech-recognition-project/sample_models.py
def bidirectional_rnn_model(input_dim, units, output_dim=29):
    """ Build a bidirectional recurrent network for speech
    """
    # Main acoustic input
    input_data = Input(name='the_input', shape=(None, input_dim))
    # TODO: Add bidirectional recurrent layer
    bidir_rnn = Bidirectional( GRU(units, return_sequences=True,merge_mode='concat') )(input_data)
    # TODO: Add a TimeDistributed(Dense(output_dim)) layer
    time_dense = TimeDistributed(Dense(output_dim)) (bidir_rnn)
    # Add softmax activation layer
    y_pred = Activation('softmax', name='softmax')(time_dense)
    # Specify the model
    model = Model(inputs=input_data, outputs=y_pred)
    model.output_length = lambda x: x
    print(model.summary())
    return model
 Build a bidirectional recurrent network for speech
    
Build a bidirectional recurrent network for speech
Build a bidirectional recurrent network for speech
def bidirectional_rnn_model(input_dim, units, output_dim=29):
    input_data = Input(name='the_input', shape=(None, input_dim))
    bidir_rnn = Bidirectional( GRU(units, return_sequences=True,merge_mode='concat') )(input_data)
    time_dense = TimeDistributed(Dense(output_dim)) (bidir_rnn)
    y_pred = Activation('softmax', name='softmax')(time_dense)
    model = Model(inputs=input_data, outputs=y_pred)
    model.output_length = lambda x: x
    print(model.summary())
    return model
def bidirectional_rnn_model ( input_dim , units , output_dim = 29 ) : input_data = Input ( name = 'the_input' , shape = ( None , input_dim ) ) bidir_rnn = Bidirectional ( GRU ( units , return_sequences = True , merge_mode = 'concat' ) ) ( input_data ) time_dense = TimeDistributed ( Dense ( output_dim ) ) ( bidir_rnn ) y_pred = Activation ( 'softmax' , name = 'softmax' ) ( time_dense ) model = Model ( inputs = input_data , outputs = y_pred ) model . output_length = lambda x : x print ( model . summary ( ) ) return model
Build a bidirectional recurrent network for speech
Build a bidirectional recurrent network for speech
""" Build a bidirectional recurrent network for speech
    """ # Main acoustic input # TODO: Add bidirectional recurrent layer # TODO: Add a TimeDistributed(Dense(output_dim)) layer # Add softmax activation layer # Specify the model
input_dim
units
output_dim