本文整理汇总了Python中neuralnilm.Net.fit方法的典型用法代码示例。如果您正苦于以下问题:Python Net.fit方法的具体用法?Python Net.fit怎么用?Python Net.fit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neuralnilm.Net
的用法示例。
在下文中一共展示了Net.fit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RealApplianceSource
# 需要导入模块: from neuralnilm import Net [as 别名]
# 或者: from neuralnilm.Net import fit [as 别名]
from __future__ import print_function, division
from neuralnilm import Net, RealApplianceSource
from lasagne.nonlinearities import sigmoid
source = RealApplianceSource(
'/data/dk3810/ukdale.h5',
['fridge freezer', 'hair straighteners', 'television'],
max_input_power=1000, max_output_power=300,
window=("2013-06-01", "2014-06-01")
)
net = Net(
source=source,
n_cells_per_hidden_layer=[50,50,50],
output_nonlinearity=sigmoid,
learning_rate=1e-1,
n_dense_cells_per_layer=50
)
net.fit(n_iterations=1600)
net.plot_costs()
net.plot_estimates()
示例2: Uniform
# 需要导入模块: from neuralnilm import Net [as 别名]
# 或者: from neuralnilm.Net import fit [as 别名]
'type': DimshuffleLayer,
'pattern': (0, 2, 1)
},
{
'type': Conv1DLayer,
'num_filters': 80,
'filter_length': 5,
'stride': 5,
'nonlinearity': sigmoid
},
{
'type': DimshuffleLayer,
'pattern': (0, 2, 1)
},
{
'type': LSTMLayer,
'num_units': 80,
'W_in_to_cell': Uniform(5)
},
{
'type': DenseLayer,
'num_units': source.n_outputs,
'nonlinearity': sigmoid
}
]
)
net.print_net()
net.compile()
net.fit()
示例3: ToySource
# 需要导入模块: from neuralnilm import Net [as 别名]
# 或者: from neuralnilm.Net import fit [as 别名]
from __future__ import print_function, division
from neuralnilm import Net, ToySource
from lasagne.nonlinearities import sigmoid
source = ToySource(
seq_length=300,
n_seq_per_batch=30
)
net = Net(
source=source,
n_cells_per_hidden_layer=[10],
output_nonlinearity=sigmoid,
learning_rate=1e-1
)
net.fit(n_iterations=1000)
net.plot_costs()
net.plot_estimates()