资源预览内容
第1页 / 共121页
第2页 / 共121页
第3页 / 共121页
第4页 / 共121页
第5页 / 共121页
第6页 / 共121页
第7页 / 共121页
第8页 / 共121页
第9页 / 共121页
第10页 / 共121页
亲,该文档总共121页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
lasagne Documentation Release 0.2.dev1 Lasagne contributors March 03, 2016 Contents 1User Guide3 1.1Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 1.3Layers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 1.4Creating custom layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 1.5Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 2API Reference23 2.1lasagne.layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 2.2lasagne.updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 2.3lasagne.init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 2.4lasagne.nonlinearities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 2.5lasagne.objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 2.6lasagne.regularization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 2.7lasagne.random . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 2.8lasagne.utils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 3Indices and tables109 Bibliography111 Python Module Index113 i ii lasagne Documentation, Release 0.2.dev1 Lasagne is a lightweight library to build and train neural networks in Theano. Lasagne is a work in progress, input is welcome. The available documentation is limited for now. The project is on GitHub. Contents1 lasagne Documentation, Release 0.2.dev1 2Contents CHAPTER1 User Guide The Lasagne user guide explains how to install Lasagne, how to build and train neural networks using Lasagne, and how to contribute to the library as a developer. 1.1 Installation Lasagne has a couple of prerequisites that need to be installed fi rst, but it is not very picky about versions. The single exception is Theano: Due to its tight coupling to Theano, you will have to install a recent version of Theano (usually more recent than the latest offi cial release!) fi tting the version of Lasagne you choose to install. Most of the instructions below assume you are running a Linux or Mac system; please do not hesitate to suggest instructions for Windows via the Edit on GitHub link on the top right! If you run into any trouble, please check the Theano installation instructions which cover installing the prerequisites for a range of operating systems, or ask for help on our mailing list. 1.1.1 Prerequisites Python + pip Lasagne currently requires Python 2.7 or 3.4 to run. Please install Python via the package manager of your operating system if it is not included already. Python includes pip for installing additional modules that are not shipped with your operating system, or shipped in an old version, and we will make use of it below. We recommend installing these modules into your home directory via -user, or into a virtual environment via virtualenv. C compiler Theano requires a working C compiler, and numpy/scipy require a compiler as well if you install them via pip. On Linux, the default compiler is usually gcc, and on Mac OS, its clang. Again, please install them via the package manager of your operating system. numpy/scipy + BLAS Lasagne requires numpy of version 1.6.2 or above, and Theano also requires scipy 0.11 or above. Numpy/scipy rely on a BLAS library to provide fast linear algebra routines. They will work fi ne without one, but a lot slower, so it is worth getting this right (but this is less important if you plan to use a GPU). 3 lasagne Documentation, Release 0.2.dev1 If you install numpy and scipy via your operating systems package manager, they should link to the BLAS library installed in your system. If you install numpy and scipy via pip install numpy and pip install scipy, make sure to have development headers for your BLAS library installed (e.g., the libopenblas-dev package on Debian/Ubuntu) while running the installation command. Please refer to the numpy/scipy build instructions if in doubt. Theano The version to install depends on the Lasagne version you choose, so this will be handled below. 1.1.2 Stable Lasagne release Lasagne 0.1 requires a more recent version of Theano than the one available on PyPI. To install a version that is known to work, run the following command: pip install -r https:/raw.githubusercontent.com/Lasagne/Lasagne/v0.1/requirements.txt Warning:An even more recent version of Theano will often work as well, but at the time of writing, a simple pip install Theano will give you a version that is too old. To install release 0.1 of Lasagne from PyPI, run the following command: pip install Lasagne=
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号