简单来说神经网络和我们一般的编程区别在于: 一个是输入数据和函数规则, 然后得到结果. 而神经网络是输入数据和答案, 通过迭代学习, 神经网络能学习出函数规则.如下图: 举个简单的例子, 这里有两组数据: X: -1, 0, 1, 2, 3, 4 Y: -3, -1, 1, 3, 5, 7 你可以把 x 看做是数据, y 看做是答案, 现在你要做的是找到其中的函数关系, 这个关系能够帮助我们, 用 x 去预测 Y 的值(假设你没有学过解方程组). 最常用的方法就是归纳法, 首先你根据第一对数据猜一个对应关系规则, 拿着这个规则计算答案值, 评估计算的答案和真实答案差多远, 然后在调整你的规则, 继续评估, 直到你的规则能够拟合所有的数据. 这就是神经网络的逻辑过程. 我们来看一个简单的神经网络的例子 1.Import: 加载所需模块 import tensorflow as tf ## /Users/zero/anaconda3/envs/tfdeeplearning/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.6 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5 ## return f(*args, **kwds) import numpy as np from tensorflow import keras 2.

Continue reading

R vs python

Representing Data in R – Python equivalent import pandas as pd import numpy as np # 'characters' is equivalent to string firstName = 'jeff' print((type(firstName), firstName)) <type 'str'> jeff # 'numeric' is equivalent to float heightCM = 188.2 print((type(heightCM), heightCM)) <type 'float'> 188.2 # integer is equivalent to integer numberSons = 1 print((type(numberSons), numberSons)) <type 'int'> 1 # 'logical' is equivalent to Boolean teachingCoursera = True print((type(teachingCoursera), teachingCoursera)) <type 'bool'> True # 'vectors' is equivalent to numpy array or Python list (I will use array everywhere for consistency) heights = np.

Continue reading

Author's picture

Jixing Liu

Reading And Writing

Data Scientist

China