Skip to content Skip to sidebar Skip to footer

Timedistributed With Lstm In Keyword Spotter

I am working on a keyword spotter that processes an audio input and returns the class of the audio based on a list of speech commands similar to what is shown here: https://www.ten

Solution 1:

LSTM layer expects inputs: A 3D tensor with shape [batch, timesteps, feature]Sample code snippet

import tensorflow as tf
inputs = tf.random.normal([32, 10, 8])
lstm = tf.keras.layers.LSTM(4)
output = lstm(inputs)
print(output.shape)

tf.keras.layers.TimeDistributed expects inputs: Input tensor of shape (batch, time, ...)

Working sample code

inputs = tf.keras.Input(shape=(10, 128, 128, 3))
conv_2d_layer = tf.keras.layers.Conv2D(64, (3, 3))
outputs = tf.keras.layers.TimeDistributed(conv_2d_layer)(inputs)
outputs.shape

Post a Comment for "Timedistributed With Lstm In Keyword Spotter"