rbf neural network in R

本文介绍了使用R语言实现RBF神经网络来拟合非线性曲线的过程。由于RBF网络对初始参数敏感,作者采用了K-means聚类进行初始化。

之前工作用到神经网络拟合nonliear curve
语言用的R语言
找不到源码所以自己参照别人的matlab 代码实现了一个
RBF网络具体介绍见参考文章
参考文章

RBF网络对初始参数设置比较敏感
所以对初始delta 和 center 我利用了kmean 聚类初始化

library(dplyr)
library(data.table)
rbf <- NULL
#Guassian径向基函数
Green <- function(x, c, delta){
        greenValue <- exp(-1.0 * sum((x - c)^2) / (2 * delta^2))
}
hiddenSize <- 2
# cols <- 5
# rows <- 7
# train.x <- matrix(runif(cols * rows), ncol = 1)
# train.y <- matrix(runif( cols * rows), ncol = 1)
 x <- seq(0,3.14*2, by = 0.01)
 y <- sin(x) + runif(length(x))
train.x <- x %>% data.matrix()
train.y <- y %>% data.matrix()

kmeans.parameters <- kmeans(train.x, hiddenSize)

init.centers <- kmeans.parameters$centers
init.delta <- kmeans.parameters$withinss/kmeans.parameters$size + 0.2

rbf$hiddenSize <- hiddenSize
rbf$inputSize <- ncol(train.x)
rbf$outputSize <- ncol(train.y)
rbf
Uncover the power of artificial neural networks by implementing them through R code. About This Book Develop a strong background in neural networks with R, to implement them in your applications Build smart systems using the power of deep learning Real-world case studies to illustrate the power of neural network models Who This Book Is For This book is intended for anyone who has a statistical background with knowledge in R and wants to work with neural networks to get better results from complex data. If you are interested in artificial intelligence and deep learning and you want to level up, then this book is what you need! What You Will Learn Set up R packages for neural networks and deep learning Understand the core concepts of artificial neural networks Understand neurons, perceptrons, bias, weights, and activation functions Implement supervised and unsupervised machine learning in R for neural networks Predict and classify data automatically using neural networks Evaluate and fine-tune the models you build. In Detail Neural networks are one of the most fascinating machine learning models for solving complex computational problems efficiently. Neural networks are used to solve wide range of problems in different areas of AI and machine learning. This book explains the niche aspects of neural networking and provides you with foundation to get started with advanced topics. The book begins with neural network design using the neural net package, then you'll build a solid foundation knowledge of how a neural network learns from data, Table of Contents Chapter 1. Neural Network and Artificial Intelligence Concepts Chapter 2. Learning Process in Neural Networks Chapter 3. Deep Learning Using Multilayer Neural Networks Chapter 4. Perceptron Neural Network Modeling – Basic Models Chapter 5. Training and Visualizing a Neural Network in R Chapter 6. Recurrent and Convolutional Neural Networks Chapter 7. Use Cases of Neural Networks – Advanced Topics
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值