2017.08.14:神经网络入门

这篇博客介绍了使用Python 3.4进行神经网络学习的基础知识,包括数据集生成、梯度下降参数设定、反向传播公式应用和前向传播原理。作者提供了一个简单的3节点隐藏层的神经网络模型,并探讨了其训练过程。
摘要由CSDN通过智能技术生成

Langage:Python

Version:3.4

Reference:http://blog.csdn.net/dream_an/article/details/51782161

神经网络专题

#needed modules

import matplotlib.pyplot as plt
import numpy as np
import sklearn
import sklearn.datasets
import sklearn.linear_model
import matplotlib

# Generate a dataset and plot it

np.random.seed(0)
x, y = sklearn.datasets.make_moons(200, noise=0.20)
plt.scatter(x[:,0], x[:,1], s=40, c=y, cmap=plt.cm.Spectral)

%If you type these codes on the terminal, the following picture will show:

figure_1


%

 # training set size

num_examples = len(x) 

# input layer dimensionality

nn_input_dim = 2 

# output layer dimensionality

nn_output_dim = 2 

# Gradient descent parameters (I picked these by hand)

# learning rate for gradient descent

epsilon = 0.01

 # regularization strength

reg_lambda = 0.01

# Helper function to plot a decision boundary.
# If you don't fully understand this function don't worry, i

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值