本文整理汇总了Python中neuralnilm.RealApplianceSource.subsample_target方法的典型用法代码示例。如果您正苦于以下问题:Python RealApplianceSource.subsample_target方法的具体用法?Python RealApplianceSource.subsample_target怎么用?Python RealApplianceSource.subsample_target使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neuralnilm.RealApplianceSource
的用法示例。
在下文中一共展示了RealApplianceSource.subsample_target方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: exp_a
# 需要导入模块: from neuralnilm import RealApplianceSource [as 别名]
# 或者: from neuralnilm.RealApplianceSource import subsample_target [as 别名]
def exp_a(name):
global source
source_dict_copy = deepcopy(source_dict)
source = RealApplianceSource(**source_dict_copy)
source.subsample_target = 4
net_dict_copy = deepcopy(net_dict)
net_dict_copy.update(dict(experiment_name=name, source=source))
net_dict_copy['layers_config'] = [
{
'type': BidirectionalRecurrentLayer,
'num_units': 25,
'gradient_steps': GRADIENT_STEPS,
'W_in_to_hid': Normal(std=1.),
'nonlinearity': tanh
},
{
'type': FeaturePoolLayer,
'ds': 2, # number of feature maps to be pooled together
'axis': 1, # pool over the time axis
'pool_function': T.mean
},
{
'type': BidirectionalRecurrentLayer,
'num_units': 10,
'gradient_steps': GRADIENT_STEPS,
'W_in_to_hid': Normal(std=1/sqrt(25)),
'nonlinearity': tanh
},
{
'type': FeaturePoolLayer,
'ds': 2, # number of feature maps to be pooled together
'axis': 1, # pool over the time axis
'pool_function': T.mean
},
{
'type': BidirectionalRecurrentLayer,
'num_units': 5,
'gradient_steps': GRADIENT_STEPS,
'W_in_to_hid': Normal(std=1/sqrt(10)),
'nonlinearity': tanh
},
{
'type': BidirectionalRecurrentLayer,
'num_units': 10,
'gradient_steps': GRADIENT_STEPS,
'W_in_to_hid': Normal(std=1/sqrt(5)),
'nonlinearity': tanh
},
{
'type': BidirectionalRecurrentLayer,
'num_units': 25,
'gradient_steps': GRADIENT_STEPS,
'W_in_to_hid': Normal(std=1/sqrt(10)),
'nonlinearity': tanh
},
{
'type': DenseLayer,
'num_units': source.n_outputs,
'nonlinearity': None,
'W': Normal(std=(1/sqrt(25)))
}
]
net = Net(**net_dict_copy)
return net