资源简介
matlab代码,宽度学习matlab代码,宽度学习matlab代码
代码片段和文件信息
import numpy as np
from sklearn import preprocessing
from numpy import random
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
import pandas as pd
def show_accuracy(predictLabelLabel):
Label = np.ravel(Label).tolist()
predictLabel = predictLabel.tolist()
count = 0
for i in range(len(Label)):
if Label[i] == predictLabel[i]:
count += 1
return (round(count/len(Label)5))
class node_generator:
def __init__(selfwhiten = False):
self.Wlist = []
self.blist = []
self.nonlinear = 0
self.whiten = whiten
def sigmoid(selfdata):
return 1.0/(1+np.exp(-data))
def linear(selfdata):
return data
def tanh(selfdata):
return (np.exp(data)-np.exp(-data))/(np.exp(data)+np.exp(-data))
def relu(selfdata):
return np.maximum(data0)
def orth(selfW):
for i in range(0W.shape[1]):
w = np.mat(W[:i].copy()).T
w_sum = 0
for j in range(i):
wj = np.mat(W[:j].copy()).T
w_sum += (w.T.dot(wj))[00]*wj
w -= w_sum
w = w/np.sqrt(w.T.dot(w))
W[:i] = np.ravel(w)
return W
def generator(selfshapetimes):
for i in range(times):
W = 2*random.random(size=shape)-1
if self.whiten == True:
W = self.orth(W)
b = 2*random.random()-1
yield (Wb)
def generator_nodes(self data times batchsize nonlinear):
self.Wlist = [elem[0] for elem in self.generator((data.shape[1]batchsize)times)]
self.blist = [elem[1] for elem in self.generator((data.shape[1]batchsize)times)]
self.nonlinear = {‘linear‘:self.linear
‘sigmoid‘:self.sigmoid
‘tanh‘:self.tanh
‘relu‘:self.relu
}[nonlinear]
nodes = self.nonlinear(data.dot(self.Wlist[0])+self.blist[0])
for i in range(1len(self.Wlist)):
nodes = np.column_stack((nodes self.nonlinear(data.dot(self.Wlist[i])+self.blist[i])))
return nodes
def transform(selftestdata):
testnodes = self.nonlinear(testdata.dot(self.Wlist[0])+self.blist[0])
for i in range(1len(self.Wlist)):
testnodes = np.column_stack((testnodes self.nonlinear(testdata.dot(self.Wlist[i])+self.blist[i])))
return testnodes
def update(selfotherW otherb):
self.Wlist += otherW
self.blist += otherb
class scaler:
def __init__(self):
self._mean = 0
self._std = 0
def fit_transform(selftraindata):
self._mean = traindata.mean(axis = 0)
self._std = traindata.std(axis = 0)
return (traindata-self._mean)/self._std
def transform(selftestdata):
return (testdata-self._mean)/self.
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-06-19 10:37 Broad-Learning-System-master\
文件 1203 2018-06-19 10:37 Broad-Learning-System-master\.gitignore
目录 0 2018-06-19 10:37 Broad-Learning-System-master\BroadLearning\
文件 6927 2018-06-19 10:37 Broad-Learning-System-master\BroadLearning\bls.py
文件 11338 2018-06-19 10:37 Broad-Learning-System-master\BroadLearning\bls_addinput.py
文件 8632 2018-06-19 10:37 Broad-Learning-System-master\BroadLearning\bls_enhence.py
文件 9265 2018-06-19 10:37 Broad-Learning-System-master\BroadLearning\bls_enhmap.py
文件 8465 2018-06-19 10:37 Broad-Learning-System-master\BroadLearning\bls_mapping.py
文件 1073 2018-06-19 10:37 Broad-Learning-System-master\LICENSE
文件 33 2018-06-19 10:37 Broad-Learning-System-master\README.md
相关资源
- LEACH源代码
- BPSK,QPSK Matlab仿真代码
- MOEA/D的MATLAB代码
- MATLAB源程序代码分享:MATLAB实现牛顿
- 基于小波变换的数字水印嵌入与提取
- matlab使用libsvm进行分类代码.rar
- 地心地固坐标系ECEF转地心惯性系ECI
- matlab 去除人脸图像中的雀斑,人脸美
- RGB到YIQ,RGB到HSI和HSI到RGB,RGB到YcbC
- 数据包络法DEA)matlab代码
- 人工鱼群算法Matlab代码
- 基于Matlab随机时间序列预测模型数据
- 快速傅里叶变换算法matlab实现
- 基于粒子群算法的无功优化MATLAB源代
- rs码编译码的matlab代码
- 通信信号特征参数的提取matlab代码
- MATLAB图像分割提取算法源代码---车牌
- am调制解调系统仿真matlab代码
- l-bfgs的matlab代码
- MATLAB画三维球体、半球体、圆柱、山
- nurbs曲线matlab程序代码
- 卷积神经网络matlab代码
- matlab模拟光纤光栅算法与代码
- OIF计算代码matlab
- 空间后方交会matlab源代码
- Isomapmatlab,官方源代码
- Matlab余弦相似度算法判断图片相似度
- SISO系统的多径瑞利信道理想信道估计
- 神经网络滑模控制器设计的matlab源代
- 关于肤色分割的matlab源代码
评论
共有 条评论