本文整理汇总了Python中hpelm.HPELM.add_data方法的典型用法代码示例。如果您正苦于以下问题:Python HPELM.add_data方法的具体用法?Python HPELM.add_data怎么用?Python HPELM.add_data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hpelm.HPELM
的用法示例。
在下文中一共展示了HPELM.add_data方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_AddDataToFile_SingleAddition
# 需要导入模块: from hpelm import HPELM [as 别名]
# 或者: from hpelm.HPELM import add_data [as 别名]
def test_AddDataToFile_SingleAddition(self):
X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]]))
T = self.makeh5(np.array([[1], [2], [3], [4]]))
hpelm = HPELM(2, 1)
hpelm.add_neurons(3, "lin")
fHH = self.makefile()
fHT = self.makefile()
hpelm.add_data(X, T, fHH=fHH, fHT=fHT)
示例2: test_AddDataToFile_MixedSequentialAsync
# 需要导入模块: from hpelm import HPELM [as 别名]
# 或者: from hpelm.HPELM import add_data [as 别名]
def test_AddDataToFile_MixedSequentialAsync(self):
X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]]))
T = self.makeh5(np.array([[1], [2], [3], [4]]))
hpelm = HPELM(2, 1)
hpelm.add_neurons(3, "lin")
fHH = self.makefile()
fHT = self.makefile()
hpelm.add_data(X, T, fHH=fHH, fHT=fHT)
hpelm.add_data_async(X, T, fHH=fHH, fHT=fHT)
示例3: test_ValidationCorr_ReturnsConfusion
# 需要导入模块: from hpelm import HPELM [as 别名]
# 或者: from hpelm.HPELM import add_data [as 别名]
def test_ValidationCorr_ReturnsConfusion(self):
X = self.makeh5(np.random.rand(10, 3))
T = self.makeh5(np.random.rand(10, 2))
hpelm = HPELM(3, 2, classification="c")
hpelm.add_neurons(6, "tanh")
fHH = self.makefile()
fHT = self.makefile()
hpelm.add_data(X, T, fHH=fHH, fHT=fHT)
_, _, confs = hpelm.validation_corr(fHH, fHT, X, T, steps=3)
self.assertGreater(np.sum(confs[0]), 1)
示例4: test_ValidationCorr_Works
# 需要导入模块: from hpelm import HPELM [as 别名]
# 或者: from hpelm.HPELM import add_data [as 别名]
def test_ValidationCorr_Works(self):
X = self.makeh5(np.random.rand(30, 3))
T = self.makeh5(np.random.rand(30, 2))
hpelm = HPELM(3, 2, norm=1e-6)
hpelm.add_neurons(6, "tanh")
fHH = self.makefile()
fHT = self.makefile()
hpelm.add_data(X, T, fHH=fHH, fHT=fHT)
nns, err, confs = hpelm.validation_corr(fHH, fHT, X, T, steps=3)
self.assertGreater(err[0], err[-1])
示例5: test_SolveCorr_Works
# 需要导入模块: from hpelm import HPELM [as 别名]
# 或者: from hpelm.HPELM import add_data [as 别名]
def test_SolveCorr_Works(self):
X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]]))
T = self.makeh5(np.array([[1], [2], [3], [4]]))
hpelm = HPELM(2, 1)
hpelm.add_neurons(3, "lin")
fHH = self.makefile()
fHT = self.makefile()
hpelm.add_data(X, T, fHH=fHH, fHT=fHT)
hpelm.solve_corr(fHH, fHT)
self.assertIsNot(hpelm.nnet.get_B(), None)
示例6: test_ParallelBasicPython_Works
# 需要导入模块: from hpelm import HPELM [as 别名]
# 或者: from hpelm.HPELM import add_data [as 别名]
def test_ParallelBasicPython_Works(self):
X = np.random.rand(1000, 10)
T = np.random.rand(1000, 3)
hX = modules.make_hdf5(X, self.fnameX)
hT = modules.make_hdf5(T, self.fnameT)
model0 = HPELM(10, 3)
model0.add_neurons(10, 'lin')
model0.add_neurons(5, 'tanh')
model0.add_neurons(15, 'sigm')
model0.save(self.fmodel)
model1 = HPELM(10, 3)
model1.load(self.fmodel)
os.remove(self.fnameHT)
os.remove(self.fnameHH)
model1.add_data(self.fnameX, self.fnameT, istart=0, icount=100, fHH=self.fnameHH, fHT=self.fnameHT)
model2 = HPELM(10, 3)
model2.load(self.fmodel)
model2.add_data(self.fnameX, self.fnameT, istart=100, icount=900, fHH=self.fnameHH, fHT=self.fnameHT)
model3 = HPELM(10, 3)
model3.load(self.fmodel)
model3.solve_corr(self.fnameHH, self.fnameHT)
model3.save(self.fmodel)
model4 = HPELM(10, 3)
model4.load(self.fmodel)
model4.predict(self.fnameX, self.fnameY)
err = model4.error(self.fnameT, self.fnameY, istart=0, icount=198)
self.assertLess(err, 1)
err = model4.error(self.fnameT, self.fnameY, istart=379, icount=872)
self.assertLess(err, 1)