本文整理汇总了Python中blocks.bricks.recurrent.LSTM.name方法的典型用法代码示例。如果您正苦于以下问题:Python LSTM.name方法的具体用法?Python LSTM.name怎么用?Python LSTM.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类blocks.bricks.recurrent.LSTM
的用法示例。
在下文中一共展示了LSTM.name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from blocks.bricks.recurrent import LSTM [as 别名]
# 或者: from blocks.bricks.recurrent.LSTM import name [as 别名]
def __init__(self, dim, activation=None, depth=2, name=None,
lstm_name=None, **kwargs):
super(LSTMstack, self).__init__(name=name, **kwargs)
# use the name allready processed by superclass
name = self.name
self.dim = dim
self.children = []
self.depth = depth
for d in range(self.depth):
layer_node = LSTM(dim, activation, name=lstm_name)
layer_node.name = '%s_%s_%d'%(name, layer_node.name, d)
if d > 0:
# convert states of previous layer to inputs of new layer
layer_name = '%s_%d_%d'%(name, d-1, d)
input_dim = layer_node.get_dim('inputs')
self.children.append(Linear(dim, input_dim,
use_bias=True,
name=layer_name))
self.children.append(layer_node)