import tensorflow as tf

            data_batch.append(d)
            timestamps_batch.append(t)
            label_batch.append(l)
    
        h5f.close()

    if len(timestamps_batch) > 0:
        yield np.array(data_batch), np.array(timestamps_batch), np.array(label_batch)


def cnn_bi_lstm_model(x, amp_factor, bil_lstm_win_size, num_classes):
    logits = cnn_model(x, amp_factor=amp_factor)
    logits = tf.reshape(logits, [-1, bil_lstm_win_size, 256*amp_factor])

    forward_cell = tf.nn.rnn_cell.LSTMCell(128)
    backward_cell = tf.nn.rnn_cell.LSTMCell(128)
    encoder_outputs,_ = tf.nn.bidirectional_dynamic_rnn(
            forward_cell,
            backward_cell,
            logits,
            dtype=tf.float32
        )
    encoder_outputs = tf.concat(encoder_outputs, axis=2)
    logits = tf.reshape(tf.layers.dense(encoder_outputs, units=num_classes), [-1, bil_lstm_win_size, num_classes])
