设为首页 收藏本站
查看: 547|回复: 0

[经验分享] 【转载】Deep Learning Python Tutorial

[复制链接]

尚未签到

发表于 2015-11-30 14:43:57 | 显示全部楼层 |阅读模式
Overview

This walkthrough demonstrates how to “do” deep learning in Python on some music tasks that may be more interesting to those in the MIR community. To get the most out of this exercise, the reader should already possess a reasonable grasp of basic concepts and terminology; if this isn’t the case, we recommend reviewing any and all information found at the deep learning homepage before proceeding.  
  That said, this prerequisite knowledge is not strictly necessary to complete the tutorial, and you may still find the exercise worthwhile without it.


  
Contents


  • Code Repository
  • Data
  • Setting up Your System

    • Mac OS X
    • Linux
    • Windows
    • Testing your Setup

  • Troubleshooting
  • Virtualization
  • Next Steps
  • Additional Resources


  
Code Repository

All code contained in this tutorial are provided in a git repository hosted on BitBucket. The first thing you’ll want to do is clone it locally with the following from the command line:  
$ cd /some/directory/
$ git clone https://ejhumphrey@bitbucket.org/ejhumphrey/dltutorial.git
$ cd dltutorial


We’ll assume for the remainder of these walkthroughs that you are operating out of this directory.

  
Data
  For your machine learning enjoyment, we provide two datasets that will work seamlessly with the provided source code:

  • Monophonic Instrument Features
  • Chord Annotated Magnitude DFT Coefficients


  
Setting up Your System
  The provided source code has the following dependencies, which must be installed and configured:

  • Python 2.7
  • Numpy >= 1.8
  • Scipy >= 0.11
  • Matplotlib >= 1.1.1
  • Theano >= 0.6
  Note: We have not provided links (yet) to discourage indiscriminate downloading; proceed to the platform-specific advice below to get the right answers for you.
  Additionally, we strongly recommend the following optional tools:

  • IPython – A vastly improved Python shell; install with easy_install ipython(you may need to sudo this).
  • Eclipse – Graphical IDE for humans.
  • PyDev – Python plug-in for Eclipse that makes life much easier.


  
Mac OS X
  First, apply the following OS Version logic:

  • If you have not upgraded to Mavericks (10.9), you should probably do so now.
  • If you cannot upgrade to Mavericks (10.9) due to some software compatibility issue (ProTools is a big one), your mileage may vary. Your best bet is to use the disk images for Python 2.7 and Numpy. Good luck.
  • If you have Mavericks (10.9), great! Proceed with confidence.
  If you are able to use Mavericks, which comes standard with Python 2.7 and Numpy, you’re two-thirds of the way home. Installing Theano requires a few steps:

  • Install XCode from the AppStore
  • In Terminal, run

    • xcode-select --install. Note: Apple does not provide very informative error messages if conditions are already satisfied.
    • Download Theano (git clone git://github.com/Theano/Theano.git)
    • cd Theano
    • python setup.py build
    • python setup.py install

  You should now be good to go; remember to back-out of the Theano directory first (cd ~ for example) before running Python.
  

Linux
  You’ll be following Theano’s instructions closely:
apt-get install python-numpy python-scipy python-matplotlib python-dev libopenblas-dev liblapack-dev g++ python-pip
  And pip (Python package manager) to get theano:
pip install theano
  And that should do it!
  

Windows
  To be honest, our experience with Windows is limited. However, we have it on reasonably good authority the Anaconda distribution should work out of the box. This distribution comes with Numpy, Theano, and IPython (among plenty other third-party libraries), and keeps itself installed in a single directory, making uninstallation as easy as removing that lone directory.
  If you run into any issues (and perhaps even solve them), please contactejhumphrey@nyu.edu and we’ll work on updating this tutorial with your insight and experience.
  

Testing your setup.
  To verify you’ve configured everything correctly, start Python in a terminal and run the following:

>>> import numpy
>>> import theano

  If everything executes without complaining, then you’re all set!


  
Troubleshooting
  If you’ve landed here, make extra sure your path variables (PATH and PYTHONPATH) are configured correctly. This should happen automatically during installation, but things may be wonky for some reason. If you are unfamiliar with manual system configuration, environment variables and the like, we refer you to these resources:

  • Unix Platforms
  • Windows
  If this does not resolve your issues, it is probably due to a Theano issue. There are, generally, three things you can do at this point:

  • Consult the Theano website.
  • Search the theano-users Google group.
  • Try your luck at StackOverflow.
  If, after this, you still cannot manage to import theano, continue to the following section.


  
Virtualization
  In the event that you cannot / don’t want to go through the system configuration process, we additionally provide a VirtualBox disk image of a pre-configured Ubuntu machine you are free to use. All tutorial code is guaranteed to work in this environment, but it may not be as efficient as native code. However, in our experience developing this tutorial, the performance seems mostly comparable.
  To use this virtual image, do the following:

  • Download VirtualBox.
  • Download our Linux System Image
  • Uncompress the image (tar -xzvf linux-image.tgz).
  • Launch VirtualBox.
  • Create a new machine: “Linux”, version “Ubuntu (32-bit)”.
  • Choose “Use existing hard disk” and select the downloaded system image (“.vdi” file extension).
  • Click “Start” in VirtualBox to run.


  
Next Steps
  Congratulations! You’re now ready to dive into deep learning.
  Proceed to the first example: Monophonic Instrument Classification.


  
Additional Resources
  If you find yourself looking for more information, insight, or references at any point, we recommend the following:


    • Theano Deep Learning Tutorials (Python): link
    • Stanford Deep Learning Tutorial (Matlab): link



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-145471-1-1.html 上篇帖子: Python的正则表达式 下篇帖子: Pygame
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表