赞
踩
mxnet.gluon.rnn.GRU官方文档
以下是一个使用的简单用例,详细信息前往官网
# hidden_size = 100 num_layer = 3
layer = mx.gluon.rnn.GRU(100, 3)
layer.initialize()
# seq_len = 5 batch_size = 3 input_size = 10
input = mx.nd.random.uniform(shape=(5, 3, 10))
# by default zeros are used as begin state
output = layer(input)
# manually specify begin state.
# num_layers = 6 batch_size = 3 num_hidden = 128
h0 = mx.nd.random.uniform(shape=(3, 3, 100))
output, hn = layer(input, h0)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。