【问题标题】:How to obtain new data from the given starting point?如何从给定的起点获取新数据?
【发布时间】:2019-06-01 14:53:54
【问题描述】:

我是神经网络和 matlab 的新手。我的问题 -> 我有一些 XY 图表(X 数据,Y 时间)。所有图表都有相同的时间,但不同的 X 值。我也有一个起点 Z。我想根据上述 XY 图得到从 Z 开始的实际图。我使用 matlab 中提供的“nntool”进行了尝试。我尝试了一些算法,例如 TRAINBR、TRAINLM、TRAINB 等。但训练后的网络的输出从不从 Z 开始。我尝试排列我的数据,更改输入范围,尝试使用更多的层数、时期、神经元等。没有任何效果。请告诉我如何解决这个问题。不需要使用 nntool 本身。您可以提出任何更好的选择...请帮助我...示例图片是here...

【问题讨论】:

  • 请展示您的绘图以及数据的外观。而且,您想在这项任务中实现什么目标?
  • 感谢回复...问题也加了图...
  • 请回复...某人.....

标签: matlab graph neural-network training-data nntool


【解决方案1】:

据我推断,您正在尝试进行插值。天真地可以通过将数据的平均值转移到 Z 来做到这一点。我没有 MATLAB,但阅读 Python 代码应该不难。

import matplotlib.pyplot as plt
import numpy as np

Z = 250

# Creating some fake data
y = np.zeros((1000,3))
y[:,0] = np.arange(1000)-500
y[:,1] = np.arange(1000)
y[:,2] = np.arange(1000)+500

x = np.arange(1000)

# Plotting fake data
plt.plot(x,y)

#Take mean along Y axis
ymean = np.mean(y,axis=1)

# Shift the mean to the desired Z after shifting it to origin
Zdash = ymean + (Z - ymean[0]) 

plt.plot(x,y)
plt.plot(x,Zdash)

【讨论】:

  • 感谢您的回复...但我想知道您如何获得 x 的值以绘制 plt.plot(x,Zdash)...
  • 这是一维绘图。只有 Y 变化,而 X 被均匀采样 x = np.arange(1000)
猜你喜欢
  • 2014-05-05
  • 2013-07-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多