python - 3D tensor input to embedding layer in keras or tensorflow? -
i want build network takes in sentences input predict sentiment. input looks (num of samples x num of sentences x num of words). want feed in embedding layer learn word vectors can summed sentence vector. type of architecture possible in keras? or tensorflow? documentation keras's embedding layer takes in input (nb_samples, sequence_length). there work around possible?
i guess class resolves keras:
class anyshapeembedding(embedding): ''' embedding works inputs of number of dimensions. can accomplished changing output shape computation. ''' #@overrides def compute_output_shape(self, input_shape): return input_shape + (self.output_dim,)
Comments
Post a Comment