06 2018 档案
摘要:import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from sklearn import datasets import random from PIL import Image from tensorflow.examples.tutorials.mnist import input_da...
阅读全文
摘要:import tensorflow as tf import numpy as np import string,random n=10 #街道名称 street_names=['abbey','baker','canal','donner','elm'] #街道类型 street_types=['rd','st','ln','pass','ave'] #邮编 rand_zips=[ rand...
阅读全文
摘要:import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import requests sess=tf.Session() house_url='https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data...
阅读全文
摘要:#在TensorFlow实现一个soft margin 支持向量机 #损失函数 惩罚项 使用L2范数 # 1/n*Σmax(0, y(Ax-b)) +Σ||A||^2 import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from sklearn import datasets sess=tf.S...
阅读全文
摘要:弹性网络回归算法是综合lasso回归和岭回归的一种回归算法,通过在损失函数中增加L1正则和L2正则项,进而控制单个系数对结果的影响
阅读全文
摘要:import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from sklearn import datasets sess=tf.Session() #加载鸢尾花集 iris=datasets.load_iris() #宽度 长度 x_vals=np.array([x[3] for x in iris...
阅读全文
摘要:import matplotlib.pyplot as plt import numpy as np import tensorflow as tf sess=tf.Session() x_vals=np.linspace(0,10,100) y_vals=x_vals+np.random.normal(0,1,100) #装换成矩阵 reshape成 (None,1) x_vals_co...
阅读全文
摘要:import matplotlib.pyplot as plt import numpy as np from sklearn import datasets import tensorflow as tf sess=tf.Session() iris=datasets.load_iris() #print(iris) target=np.array([1. if x==0 else 0. ...
阅读全文

浙公网安备 33010602011771号