MJay

Spearmint 본문

Cloud Computing

Spearmint

MJSon 2017. 9. 12. 14:59
Edit

Spearmint

tistory


Practical Bayesian Optimization of Machine Learning Algorithms
Jasper

Code가 몇개 있음

python 설치
sudo apt-get install python-pip python-dev
sudo apt-get install libcupti-dev
sudo apt-get install python-pip python-dev
apt-get install python-numpy
apt-get install python-scipy
apt-get install python-protobuf
git clone https://github.com/google/protobuf.git
apt-get install protobuf-compiler
./bin/make_probufs
python setup.py install
Dependency

Python 2.7
Numpy
SCipy
Google Protocol buffers

오류

protobuf compiler도 설치

./bin/make_probufs 해도 아무일도 안일어난다.

GP-EI MCMC

pip install protobuf==2.6.1

뭐가 나오기는 한다.

첫번쨰로 되는지 다시 해보자
정말

protobuf 문제였으려나

n this case, as braninhoo is an analytic function we tell the GP hyperparameter sampling routine to not try to estimate noise. This parameter is very important to specify correctly for the optimization to proceed properly. If your algorithm is entirely deterministic (e.g. analytic) then specifying that it is noiseless will speed up the optimization considerably. If your algorithm is not deterministic, as we expect for most machine learning algorithms and indeed most expensive experiments, then you should leave this out or set noiseless=0.

이 경우, braninhoo는 GP hyperparameter 샘플링 루틴에 노이즈를 추정하지 말 것을 지시하는 분석 함수이기 때문에이 경우. 이 매개 변수는 최적화가 올바르게 진행되도록 올바르게 지정하는 데 매우 중요합니다. 알고리즘이 완전히 결정적 (예 : 분석) 인 경우 소음이 없다는 것을 지정하면 최적화 속도가 상당히 빨라집니다. 알고리즘이 결정적이지 않은 경우, 대부분의 기계 학습 알고리즘과 실제로 가장 비싼 실험을 기대할 때, 이것을 남겨 두거나 noiseless = 0으로 설정해야합니다.

코드를 분석해봐야겠음

와 진짜 protobuf 문제였음..

hyperparameter를 정할떄 쓰지 않을까?

runtime때 하는거라고 했나? Cherrypick

마르코프 연쇄 몬테카를로 방법(무작위 행보 몬테 카를로 방법 포함)은 마르코프 연쇄의 구성에 기반한 확률 분포로부터 원하는 분포의 정적 분포를 갖는 표본을 추출하는 알고리즘의 한 부류이다.

size는 뭘까 - the number of variables of this type

어떤 공식을 쓰는거같다.

X가 무엇을 위해 구해지는거지?

2
3 SOURCE="${BASH_SOURCE[0]}"
4
5 # resolve $SOURCE until the file is no longer a symlink
6 while [ -h "$SOURCE" ]; do
7 DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
8 SOURCE="$(readlink "$SOURCE")"
9
10 # if $SOURCE was a relative symlink, we need to resolve it
11 # relative to the path where the symlink file was located
12 [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
13 done
14 DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
15
16 CMD="python ${DIR}/../spearmint/main.py $@"
17 PYTHONPATH=${DIR}/.. ${CMD}

chooser는 뭘까?

driver는 뭐라고했더라

. The ‘method’ argument specifies the chooser module (acquisition function) to use and ‘method-args’ specifies chooser specific arguments.

bayesian optimization이거 acquisiton function의 최고점을 구하는거였나?

0이 될수도 있겠는데?

식을 최소화 시켜주게 만들어지는거같다.

GPEIOptChooser: The GP EI MCMC algorithm from the paper. Jobs are first sampled densely from a dense grid on the unit hypercube and then the best candidates are optimized ‘fine-tuned’ according to EI.

%23%23%23%20Spearmint%0A@%5Btistory%5D%0APractical%20Bayesian%20Optimization%20of%20Machine%20Learning%20Algorithms%0AJasper%0A%0ACode%uAC00%20%uBA87%uAC1C%20%uC788%uC74C%0A%0A%23%23%23%23%23%20python%20%uC124%uCE58%0A%0A%60%60%60%0Asudo%20apt-get%20install%20python-pip%20python-dev%0Asudo%20apt-get%20install%20libcupti-dev%0Asudo%20apt-get%20install%20python-pip%20python-dev%0Aapt-get%20install%20python-numpy%0Aapt-get%20install%20python-scipy%0Aapt-get%20install%20python-protobuf%0Agit%20clone%20https%3A//github.com/google/protobuf.git%0Aapt-get%20install%20protobuf-compiler%0A./bin/make_probufs%0Apython%20setup.py%20install%0A%60%60%60%0A%0A%23%23%23%23%23%20Dependency%0A%0APython%202.7%0ANumpy%0ASCipy%0AGoogle%20Protocol%20buffers%0A%0A%23%23%23%23%20%uC624%uB958%0A%0A%21%5BAlt%20text%5D%28./1504746903976.png%29%0A%0A%0Aprotobuf%20compiler%uB3C4%20%uC124%uCE58%0A%0A%21%5BAlt%20text%5D%28./1504747471290.png%29%0A%0A./bin/make_probufs%20%uD574%uB3C4%20%uC544%uBB34%uC77C%uB3C4%20%uC548%uC77C%uC5B4%uB09C%uB2E4.%0A%0AGP-EI%20MCMC%0A%0Apip%20install%20protobuf%3D%3D2.6.1%0A%0A%21%5BAlt%20text%5D%28./1504751230292.png%29%0A%0A%0A%uBB50%uAC00%20%uB098%uC624%uAE30%uB294%20%uD55C%uB2E4.%20%0A%0A%uCCAB%uBC88%uCA30%uB85C%20%uB418%uB294%uC9C0%20%uB2E4%uC2DC%20%uD574%uBCF4%uC790%0A%uC815%uB9D0%20%0A%0Aprotobuf%20%20%uBB38%uC81C%uC600%uC73C%uB824%uB098%0A%0An%20this%20case%2C%20as%20braninhoo%20is%20an%20analytic%20function%20we%20tell%20the%20GP%20hyperparameter%20sampling%20routine%20to%20not%20try%20to%20estimate%20noise.%20This%20parameter%20is%20very%20important%20to%20specify%20correctly%20for%20the%20optimization%20to%20proceed%20properly.%20If%20your%20algorithm%20is%20entirely%20deterministic%20%28e.g.%20analytic%29%20then%20specifying%20that%20it%20is%20noiseless%20will%20speed%20up%20the%20optimization%20considerably.%20If%20your%20algorithm%20is%20not%20deterministic%2C%20as%20we%20expect%20for%20most%20machine%20learning%20algorithms%20and%20indeed%20most%20expensive%20experiments%2C%20then%20you%20should%20leave%20this%20out%20or%20set%20noiseless%3D0.%0A%0A%uC774%20%uACBD%uC6B0%2C%20braninhoo%uB294%20GP%20hyperparameter%20%uC0D8%uD50C%uB9C1%20%uB8E8%uD2F4%uC5D0%20%uB178%uC774%uC988%uB97C%20%uCD94%uC815%uD558%uC9C0%20%uB9D0%20%uAC83%uC744%20%uC9C0%uC2DC%uD558%uB294%20%uBD84%uC11D%20%uD568%uC218%uC774%uAE30%20%uB54C%uBB38%uC5D0%uC774%20%uACBD%uC6B0.%20%uC774%20%uB9E4%uAC1C%20%uBCC0%uC218%uB294%20%uCD5C%uC801%uD654%uAC00%20%uC62C%uBC14%uB974%uAC8C%20%uC9C4%uD589%uB418%uB3C4%uB85D%20%uC62C%uBC14%uB974%uAC8C%20%uC9C0%uC815%uD558%uB294%20%uB370%20%uB9E4%uC6B0%20%uC911%uC694%uD569%uB2C8%uB2E4.%20%uC54C%uACE0%uB9AC%uC998%uC774%20%uC644%uC804%uD788%20%uACB0%uC815%uC801%20%28%uC608%20%3A%20%uBD84%uC11D%29%20%uC778%20%uACBD%uC6B0%20%uC18C%uC74C%uC774%20%uC5C6%uB2E4%uB294%20%uAC83%uC744%20%uC9C0%uC815%uD558%uBA74%20%uCD5C%uC801%uD654%20%uC18D%uB3C4%uAC00%20%uC0C1%uB2F9%uD788%20%uBE68%uB77C%uC9D1%uB2C8%uB2E4.%20%uC54C%uACE0%uB9AC%uC998%uC774%20%uACB0%uC815%uC801%uC774%uC9C0%20%uC54A%uC740%20%uACBD%uC6B0%2C%20%uB300%uBD80%uBD84%uC758%20%uAE30%uACC4%20%uD559%uC2B5%20%uC54C%uACE0%uB9AC%uC998%uACFC%20%uC2E4%uC81C%uB85C%20%uAC00%uC7A5%20%uBE44%uC2FC%20%uC2E4%uD5D8%uC744%20%uAE30%uB300%uD560%20%uB54C%2C%20%uC774%uAC83%uC744%20%uB0A8%uACA8%20%uB450%uAC70%uB098%20noiseless%20%3D%200%uC73C%uB85C%20%uC124%uC815%uD574%uC57C%uD569%uB2C8%uB2E4.%0A%0A%uCF54%uB4DC%uB97C%20%uBD84%uC11D%uD574%uBD10%uC57C%uACA0%uC74C%20%0A%0A%uC640%20%uC9C4%uC9DC%20protobuf%20%uBB38%uC81C%uC600%uC74C..%20%0A%0Ahyperparameter%uB97C%20%uC815%uD560%uB584%20%uC4F0%uC9C0%20%uC54A%uC744%uAE4C%3F%0A%0Aruntime%uB54C%20%uD558%uB294%uAC70%uB77C%uACE0%20%uD588%uB098%3F%20Cherrypick%0A%0A%0A%uB9C8%uB974%uCF54%uD504%20%uC5F0%uC1C4%20%uBAAC%uD14C%uCE74%uB97C%uB85C%20%uBC29%uBC95%28%uBB34%uC791%uC704%20%uD589%uBCF4%20%uBAAC%uD14C%20%uCE74%uB97C%uB85C%20%uBC29%uBC95%20%uD3EC%uD568%29%uC740%20%uB9C8%uB974%uCF54%uD504%20%uC5F0%uC1C4%uC758%20%uAD6C%uC131%uC5D0%20%uAE30%uBC18%uD55C%20%uD655%uB960%20%uBD84%uD3EC%uB85C%uBD80%uD130%20%uC6D0%uD558%uB294%20%uBD84%uD3EC%uC758%20%uC815%uC801%20%uBD84%uD3EC%uB97C%20%uAC16%uB294%20%uD45C%uBCF8%uC744%20%uCD94%uCD9C%uD558%uB294%20%uC54C%uACE0%uB9AC%uC998%uC758%20%uD55C%20%uBD80%uB958%uC774%uB2E4.%20%0A%0Asize%uB294%20%uBB58%uAE4C%20-%20the%20number%20of%20variables%20of%20this%20type%20%0A%0A%uC5B4%uB5A4%20%uACF5%uC2DD%uC744%20%uC4F0%uB294%uAC70%uAC19%uB2E4.%0A%0AX%uAC00%20%uBB34%uC5C7%uC744%20%uC704%uD574%20%uAD6C%uD574%uC9C0%uB294%uAC70%uC9C0%3F%0A%0A%60%60%60%0A%0A%20%202%0A%20%203%20SOURCE%3D%22%24%7BBASH_SOURCE%5B0%5D%7D%22%0A%20%204%0A%20%205%20%23%20resolve%20%24SOURCE%20until%20the%20file%20is%20no%20longer%20a%20symlink%0A%20%206%20while%20%5B%20-h%20%22%24SOURCE%22%20%5D%3B%20do%0A%20%207%20%20%20DIR%3D%22%24%28%20cd%20-P%20%22%24%28%20dirname%20%22%24SOURCE%22%20%29%22%20%26%26%20pwd%20%29%22%0A%20%208%20%20%20SOURCE%3D%22%24%28readlink%20%22%24SOURCE%22%29%22%0A%20%209%0A%2010%20%20%20%23%20if%20%24SOURCE%20was%20a%20relative%20symlink%2C%20we%20need%20to%20resolve%20it%0A%2011%20%20%20%23%20relative%20to%20the%20path%20where%20the%20symlink%20file%20was%20located%0A%2012%20%20%20%5B%5B%20%24SOURCE%20%21%3D%20/*%20%5D%5D%20%26%26%20SOURCE%3D%22%24DIR/%24SOURCE%22%0A%2013%20done%0A%2014%20DIR%3D%22%24%28%20cd%20-P%20%22%24%28%20dirname%20%22%24SOURCE%22%20%29%22%20%26%26%20pwd%20%29%22%0A%2015%0A%2016%20CMD%3D%22python%20%24%7BDIR%7D/../spearmint/main.py%20%24@%22%0A%2017%20PYTHONPATH%3D%24%7BDIR%7D/..%20%24%7BCMD%7D%0A%60%60%60%0A%0Achooser%uB294%20%uBB58%uAE4C%3F%0A%0Adriver%uB294%20%uBB50%uB77C%uACE0%uD588%uB354%uB77C%0A%0A.%20The%20%27method%27%20argument%20specifies%20the%20chooser%20module%20%28acquisition%20function%29%20to%20use%20and%20%27method-args%27%20specifies%20chooser%20specific%20arguments.%0A%20%0A%20bayesian%20optimization%uC774%uAC70%20acquisiton%20function%uC758%20%uCD5C%uACE0%uC810%uC744%20%uAD6C%uD558%uB294%uAC70%uC600%uB098%3F%0A%0A%21%5BAlt%20text%5D%28./1504765103958.png%29%0A%0A0%uC774%20%uB420%uC218%uB3C4%20%uC788%uACA0%uB294%uB370%3F%0A%0A%21%5BAlt%20text%5D%28./1504765663832.png%29%0A%0A%0A%uC2DD%uC744%20%uCD5C%uC18C%uD654%20%uC2DC%uCF1C%uC8FC%uAC8C%20%uB9CC%uB4E4%uC5B4%uC9C0%uB294%uAC70%uAC19%uB2E4.%0A%0A%21%5BAlt%20text%5D%28./1504765964144.png%29%0A%0A%21%5BAlt%20text%5D%28./1504766019660.png%29%0A%0AGPEIOptChooser%3A%20The%20GP%20EI%20MCMC%20algorithm%20from%20the%20paper.%20Jobs%20are%20first%20sampled%20densely%20from%20a%20dense%20grid%20on%20the%20unit%20hypercube%20and%20then%20the%20best%20candidates%20are%20optimized%20%27fine-tuned%27%20according%20to%20EI.%0A