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]])


 


相关文章
|
4月前
|
Linux 计算机视觉 C++
【解决方案】Building wheel for opencv-python:安装卡顿的原因与解决方案
当你安装OpenCV时,命令行停在Building wheel for opencv-python (PEP 517) ... -似乎卡住了。这并非程序假死,而是其编译耗时巨大。本文将揭示原因,并提供优化安装体验的实用方法。
671 88
|
2月前
|
人工智能 数据安全/隐私保护 异构计算
桌面版exe安装和Python命令行安装2种方法详细讲解图片去水印AI源码私有化部署Lama-Cleaner安装使用方法-优雅草卓伊凡
桌面版exe安装和Python命令行安装2种方法详细讲解图片去水印AI源码私有化部署Lama-Cleaner安装使用方法-优雅草卓伊凡
373 8
桌面版exe安装和Python命令行安装2种方法详细讲解图片去水印AI源码私有化部署Lama-Cleaner安装使用方法-优雅草卓伊凡
|
4月前
|
人工智能 数据挖掘 Linux
Centos安装Python3.7(亲测可用)
本指南详细介绍了在基于Linux(以CentOS系统为例,使用yum包管理器)的系统上安装Python 3.7版本的完整流程。Python是一种广泛使用的高级编程语言,在各种领域如软件开发、数据分析、人工智能和区块链开发等都有着重要的应用。
465 2
|
4月前
|
人工智能 Python
python基本数据类型简介
本文简要介绍了Python的基本数据类型,包括整型、浮点型、字符串、列表、字典和布尔类型,帮助读者对Python数据类型有初步了解。
176 0
|
6月前
|
数据管理 开发者 Python
揭秘Python的__init__.py:从入门到精通的包管理艺术
__init__.py是Python包管理中的核心文件,既是包的身份标识,也是模块化设计的关键。本文从其历史演进、核心功能(如初始化、模块曝光控制和延迟加载)、高级应用场景(如兼容性适配、类型提示和插件架构)到最佳实践与常见陷阱,全面解析了__init__.py的作用与使用技巧。通过合理设计,开发者可构建优雅高效的包结构,助力Python代码质量提升。
596 10
|
算法 UED Python
<LeetCode天梯>攻略集合部分 | 初级算法 | Python(U can save)
<LeetCode天梯>攻略集合部分 | 初级算法 | Python(U can save)
<LeetCode天梯>攻略集合部分 | 初级算法 | Python(U can save)
|
2月前
|
数据采集 机器学习/深度学习 人工智能
Python:现代编程的首选语言
Python:现代编程的首选语言
270 102
|
2月前
|
数据采集 机器学习/深度学习 算法框架/工具
Python:现代编程的瑞士军刀
Python:现代编程的瑞士军刀
299 104
|
2月前
|
人工智能 自然语言处理 算法框架/工具
Python:现代编程的首选语言
Python:现代编程的首选语言
250 103

推荐镜像

更多