本文整理汇总了Python中model.Model.set_source方法的典型用法代码示例。如果您正苦于以下问题:Python Model.set_source方法的具体用法?Python Model.set_source怎么用?Python Model.set_source使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Model
的用法示例。
在下文中一共展示了Model.set_source方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pennlstmbig
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import set_source [as 别名]
def pennlstmbig():
model = Model(name="pennlstm", n_epochs=10000, momentum=0., lr=1., threshold=100.)
params = {'name': 'pennword', 'unroll': 50, 'out_len': 10000, 'batch_size': 100}
model.set_source(TextSource, params) \
.attach(FCL, {'out_len': 200}) \
.attach(LSTML, {'out_len': 200, 'init': RANDN}) \
.attach(FCL, {'out_len': 10000}) \
.attach(BiasL, {}) \
.attach(SoftmaxC, {})
return model
示例2: pennchr
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import set_source [as 别名]
def pennchr():
model = Model(name="pennchr", n_epochs=10000, momentum=0.5, lr=0.5)
params = {'name': 'pennchr', 'unroll': 20, 'out_len': 256}
model.set_source(TextSource, params) \
.attach(FCL, {'out_len': 600, 'hiddens' : ['qqq']}) \
.attach(BiasL, {}) \
.attach(TanhL, {}) \
.add_hidden('qqq') \
.attach(FCL, {'out_len': 256}) \
.attach(BiasL, {}) \
.attach(SoftmaxC, {})
return model
示例3: mock_lstm
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import set_source [as 别名]
def mock_lstm():
classes = 4
params = {'freq': 2, 'classes': classes, 'batch_size': 10, \
'unroll': 6}
model = Model(name="mock_lstm", n_epochs=15, lr=1., momentum=0., threshold=20.)
model.set_source(MockSource, params) \
.attach(FCL, {'out_len': 20}) \
.attach(LSTML, {'out_len': 20, 'init': RANDN}) \
.attach(FCL, {'out_len': 256}) \
.attach(BiasL, {}) \
.attach(SoftmaxC, {})
return model
示例4: mock
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import set_source [as 别名]
def mock():
classes = 4
params = {'freq': 2, 'classes': classes, 'batch_size': 10, \
'unroll': 5}
model = Model(name="mock", n_epochs=5)
model.set_source(MockSource, params) \
.attach(FCL, {'out_len': 50, 'hiddens' : ['qqq']}) \
.attach(BiasL, {}) \
.attach(TanhL, {}) \
.add_hidden('qqq') \
.attach(FCL, {'out_len': 256}) \
.attach(BiasL, {}) \
.attach(SoftmaxC, {})
return model