Deep Learning, which is also introduced in here, is easy to write, but I was able to put it in homebrew, so I will write how to do it.
If you are using Scipy Superpack, it is better to delete it first.
If you enter Scipy from the repository of here, you can also enter theano. I put Python in homebrew.
brew tap samueljohn/python
brew install scipy
pip install Theano
In 0.6rc2, various errors occur when testing.
python -c 'import theano; theano.test()'
E00001 #include <Python.h>
00002 #include <iostream>
00003 #include <numpy/arrayobject.h>
00004 #include <math.h>
00005 #include <numpy/arrayscalars.h>
00006 //////////////////////
00007 //// Support Code
00008 //////////////////////
00009
00010
00011 struct __struct_compiled_op_d294414d3fa581b0e3ab72b870c38ab1 {
00012 PyObject* __ERROR;
00013
00014 PyObject* storage_V3;
(Omission)
Problem occurred during compilation with the command line below:
g++ -dynamiclib -g -O3 -Wno-write-strings -Wno-unused-label -Wno-unused-variable -fno-math-errno -D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY -D NPY_ARRAY_ALIGNED=NPY_ALIGNED -D NPY_ARRAY_WRITEABLE=NPY_WRITEABLE -D NPY_ARRAY_UPDATE_ALL=NPY_UPDATE_ALL -D NPY_ARRAY_C_CONTIGUOUS=NPY_C_CONTIGUOUS -D NPY_ARRAY_F_CONTIGUOUS=NPY_F_CONTIGUOUS -fPIC -undefined dynamic_lookup -framework Python -m64 -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -o /Users/user/.theano/compiledir_Darwin-12.2.1-x86_64-i386-64bit-i386-2.7.3/tmpvvh7I_/d294414d3fa581b0e3ab72b870c38ab1.so /Users/user/.theano/compiledir_Darwin-12.2.1-x86_64-i386-64bit-i386-2.7.3/tmpvvh7I_/mod.cpp -L/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib
Perhaps you couldn't compile the dynamically generated C code.
Take a moment to upgrade to the development version of git.
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
Although there were some warnings, the test passed successfully.
Clone the code for the Deep Learning Tutorial (http://deeplearning.net/tutorial/intro.html). (A summary of the data used can be found in Getting Started)
git clone git://github.com/lisa-lab/DeepLearningTutorials.git
Let's move Logistic Regression Sample.
cd DeepLearningTutorials/code
python logistic_sgd.py
I got an output like this. The error numbers are about the same.
…
epoch 74, minibatch 83/83, validation error 7.479167 %
epoch 74, minibatch 83/83, test error of best model 7.489583 %
Optimization complete with best validation score of 7.479167 %,with test performance 7.489583 %
The code run for 75 epochs, with 3.206806 epochs/sec
By the way, matplotlib did not come in this way. .. .. I was in trouble. </ Strike>
→ I just didn't reinstall Command Line Tools after updating XCode. .. .. It was too rudimentary.
And Qiita doesn't support strikethrough. Spicy. .. ..
If you are in trouble, brew doctor
is important.
Recommended Posts