本文整理汇总了Python中neuralnilm.RealApplianceSource.start方法的典型用法代码示例。如果您正苦于以下问题:Python RealApplianceSource.start方法的具体用法?Python RealApplianceSource.start怎么用?Python RealApplianceSource.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neuralnilm.RealApplianceSource
的用法示例。
在下文中一共展示了RealApplianceSource.start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: outputs
# 需要导入模块: from neuralnilm import RealApplianceSource [as 别名]
# 或者: from neuralnilm.RealApplianceSource import start [as 别名]
# but with 5 outputs (so each seq includes entire appliance activation,
# and to make it easier to plot every appliance),
# and long seq length,
# then make one long mains by concatenating each seq
source_dict_copy = deepcopy(source_dict)
source_dict_copy.update(dict(
logger=logger,
seq_length=2048,
border=100,
output_one_appliance=False,
input_stats=input_stats,
target_is_start_and_end_and_mean=False,
window=("2014-12-10", None)
))
mains_source = RealApplianceSource(**source_dict_copy)
mains_source.start()
N_BATCHES = 1
logger.info("Preparing synthetic mains data for {} batches.".format(N_BATCHES))
mains = None
targets = None
TARGET_I = 2
for batch_i in range(N_BATCHES):
batch = mains_source.queue.get(timeout=30)
mains_batch, targets_batch = batch.data
if mains is None:
mains = mains_batch
targets = targets_batch[:, :, TARGET_I]
else:
mains = np.concatenate((mains, mains_batch))
targets = np.concatenate((targets, targets_batch[:, :, TARGET_I]))