Py之neurolab:Python库之neurolab的简介、安装、使用方法之详细攻略

简介: Py之neurolab:Python库之neurolab的简介、安装、使用方法之详细攻略

neurolab的简介


   neurolab是一个简单而强大的Python神经网络库。包含基于神经网络、训练算法和灵活的框架来创建和探索其他神经网络类型。NeuroLab一个具有灵活网络配置和Python学习算法的基本神经网络算法库。为了简化库的使用,接口类似于MATLAB(C)的神经网络工具箱(NNT)的包。该库基于包NUMPY(http://NoPy.SimP.org),使用一些学习算法。

neurolab


neurolab的安装


pip install neurolab

image.png


neurolab的使用方法


Support neural networks types

Single layer perceptron

create function: neurolab.net.newp()

example of use: newp

default train function: neurolab.train.train_delta()

support train functions: train_gd, train_gda, train_gdm, train_gdx, train_rprop, train_bfgs, train_cg

Multilayer feed forward perceptron

create function: neurolab.net.newff()

example of use: newff

default train function: neurolab.train.train_gdx()

support train functions: train_gd, train_gda, train_gdm, train_rprop, train_bfgs, train_cg

Competing layer (Kohonen Layer)

create function: neurolab.net.newc()

example of use: newc

default train function: neurolab.train.train_cwta()

support train functions: train_wta

Learning Vector Quantization (LVQ)

create function: neurolab.net.newlvq()

example of use: newlvq

default train function: neurolab.train.train_lvq()

Elman Recurrent network

create function: neurolab.net.newelm()

example of use: newelm

default train function: neurolab.train.train_gdx()

support train functions: train_gd, train_gda, train_gdm, train_rprop, train_bfgs, train_cg

Hopfield Recurrent network

create function: neurolab.net.newhop()

example of use: newhop

Hemming Recurrent network

create function: neurolab.net.newhem()

example of use: newhem


Features:

Pure python + numpy

API like Neural Network Toolbox (NNT) from MATLAB

Interface to use train algorithms form scipy.optimize

Flexible network configurations and learning algorithms. You may change: train, error, initialization and activation functions

Unlimited number of neural layers and number of neurons in layers

Variety of supported types of Artificial Neural Network and learning algorithms

Example:

>>> import numpy as np

>>> import neurolab as nl

>>> # Create train samples

>>> input = np.random.uniform(-0.5, 0.5, (10, 2))

>>> target = (input[:, 0] + input[:, 1]).reshape(10, 1)

>>> # Create network with 2 inputs, 5 neurons in input layer and 1 in output layer

>>> net = nl.net.newff([[-0.5, 0.5], [-0.5, 0.5]], [5, 1])

>>> # Train process

>>> err = net.train(input, target, show=15)

Epoch: 15; Error: 0.150308402918;

Epoch: 30; Error: 0.072265865089;

Epoch: 45; Error: 0.016931355131;

The goal of learning is reached

>>> # Test

>>> net.sim([[0.2, 0.1]]) # 0.2 + 0.1

array([[ 0.28757596]])


 


相关文章
|
2月前
|
监控 数据可视化 数据挖掘
Python Rich库使用指南:打造更美观的命令行应用
Rich库是Python的终端美化利器,支持彩色文本、智能表格、动态进度条和语法高亮,大幅提升命令行应用的可视化效果与用户体验。
212 0
|
1月前
|
数据可视化 关系型数据库 MySQL
【可视化大屏】全流程讲解用python的pyecharts库实现拖拽可视化大屏的背后原理,简单粗暴!
本文详解基于Python的电影TOP250数据可视化大屏开发全流程,涵盖爬虫、数据存储、分析及可视化。使用requests+BeautifulSoup爬取数据,pandas存入MySQL,pyecharts实现柱状图、饼图、词云图、散点图等多种图表,并通过Page组件拖拽布局组合成大屏,支持多种主题切换,附完整源码与视频讲解。
215 4
【可视化大屏】全流程讲解用python的pyecharts库实现拖拽可视化大屏的背后原理,简单粗暴!
|
1月前
|
传感器 运维 前端开发
Python离群值检测实战:使用distfit库实现基于分布拟合的异常检测
本文解析异常(anomaly)与新颖性(novelty)检测的本质差异,结合distfit库演示基于概率密度拟合的单变量无监督异常检测方法,涵盖全局、上下文与集体离群值识别,助力构建高可解释性模型。
302 10
Python离群值检测实战:使用distfit库实现基于分布拟合的异常检测
|
关系型数据库 MySQL 数据库
【100天精通python】Day32:使用python操作数据库_MySQL下载、安装、配置、使用实战
【100天精通python】Day32:使用python操作数据库_MySQL下载、安装、配置、使用实战
170 0
|
Python Windows
Python3+PyCharm环境的安装及配置
近期碰到有同学入门Python还不会安装并配置Python编程环境的,在这里做一期教程手把手教大家安装与配置使用(以 Python 3.9.9 以及 PyCharm 2021.3.1 为例)
1016 0
Python3+PyCharm环境的安装及配置
|
10月前
|
人工智能 编译器 Python
python已经安装有其他用途如何用hbuilerx配置环境-附带实例demo-python开发入门之hbuilderx编译器如何配置python环境—hbuilderx配置python环境优雅草央千澈
python已经安装有其他用途如何用hbuilerx配置环境-附带实例demo-python开发入门之hbuilderx编译器如何配置python环境—hbuilderx配置python环境优雅草央千澈
250 0
python已经安装有其他用途如何用hbuilerx配置环境-附带实例demo-python开发入门之hbuilderx编译器如何配置python环境—hbuilderx配置python环境优雅草央千澈
|
Python Windows
Python安装第三方库太慢?配置好这个速度飞起
Python安装第三方库太慢?配置好这个速度飞起
488 1
|
Linux 测试技术 Python
Python笔记1 安装并配置Python
本文是作者关于Python复习笔记的系列文章第一篇,介绍了Python语言的特点、在不同操作系统上搭建Python环境的方法,包括下载编辑器和配置解释环境,并通过在编辑器中运行“Hello World!”程序来测试环境是否成功搭建。
128 0
|
IDE Linux 开发工具
Python安装与配置
Python安装与配置
334 0

推荐镜像

更多