pylearn2安装及测试

本文提供了一步一步的指导,教你如何使用Pylearn2库来安装、配置环境、安装并测试机器学习模型。包括下载、配置环境变量、安装、测试过程以及使用数据集进行模型训练和查看权重。



Pylearn2 是建立在Theano之上的一个机器学习库,可以参考:http://deeplearning.net/software/pylearn2/

早前我已经用《Install Theano in Linux without root authority (sodu)》,所以现在也只需要仿照着安装即可。

1. Download:

  1. $ git clone git://github.com/lisa-lab/pylearn2.git  

2. 配置环境变量,我一般用.bash_profile, 也可以放在.bashrc里

  1. export PYLEARN2_DATA_PATH=/path/to/data  

3. 安装,进入pylearn2

  1. $ python setup.py build  
  1. $ python setup.py install --prefix=$PYTHON_HOME  

4. 测试,可以看http://deeplearning.net/software/pylearn2/tutorial/index.html#tutorial,首先下载数据集cifar-10: http://www.cs.toronto.edu/~kriz/cifar.html

  1. $ wget http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz  
  1. $ tar -zxvf cifar-10*  
4.1. 生成数据子集,进入 $PYLEARN2_HOME/pylearn2/scripts/tutorials/grbm_smd/

  1. $ python make_dataset.py  
4.2 训练模型

  1. $ python ../../train.py cifar_grbm_smd.yaml  
4.3 视察模型

  1. $ python ../../show_weights.py cifar_grbm_smd.pkl  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值