8월, 2017의 게시물 표시

티즈니 활용법

https://distill.pub/2016/misread-tsne/

[pyTorch] trained model save & load

model = MyModel() # ... after training, save your model model.save_state_dict('mytraining.pt') # .. to load your previously training model: model.load_state_dict(torch.load('mytraining.pt'))

Torch install for Mac

https://www.google.co.kr/search?q=torch+install+mac&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=cHinWf7kCfD98weLr5n4DA 1.      touch ~/.bash_profile; open ~/.bash_profile And add these two lines at very bottom: # TORCH export PATH=$PATH:/Users/ /torch/install/bin 1 2 # TORCH export PATH=$PATH:/Users/<your user name>/torch/install/bin

ofx OpenCVExample

header ----------------------------- #pragma once #include "ofMain.h" // for ofxCvColorImage, ofxCvGrayImage, ofxCvContourFinder #include "ofxOpenCv.h" //#define _USE_LIVE_VIDEO        // uncomment this to use a live camera                                 // otherwise, we'll use a movie file class ofApp : public ofBaseApp{     public:         // 예약 메써드         void setup();         void update();         void draw();                 // 이벤트 핸들러         void keyPressed(int key);         void keyReleased(int key);         void mouseMoved(int x, int y ...

RAM by Torch

https://github.com/Element-Research/rnn/blob/master/examples/recurrent-visual-attention.lua 설명 사이트: http://torch.ch/blog/2015/09/21/rmva.html th examples / recurrent - visual - attention . lua --cuda --dataset TranslatedMnist --unitPixels 26 --learningRate 0.001 --glimpseDepth 3 --maxTries 200 --stochastic --glimpsePatchSize 12

RAM by TF (DQN)

이미지
https://github.com/jlindsey15/RAM.git https://github.com/zhongwen/RAM.git

Random Image Extraction from a folder by Bash Script

@echo off setlocal :: Initialization set "ext=jpg" set "source=folder 1" set "target=folder 2" :: Get count of images and select random image for /f %%N in ('dir /b "%source%\*.%ext%"^|find /c /v ""') do ( set /a "imageNum=%random% %% %%N" ) :: Copy the image if %imageNum% gtr 0 (set "skip=skip=%imageNum%") else set "skip=" for /f "%skip% eol=: delims=" %%F in ('dir /b "%source%\*.%ext%"') do ( echo copy /y "%source%\%%F" "%target%\1.%ext%" exit /b )

Deep Colorize

https://github.com/satoshiiizuka/siggraph2016_colorization.git

DQN 종합 선물세트

https://github.com/handong1587/handong1587.github.io/blob/master/_posts/deep_learning/2015-10-09-reinforcement-learning.md

DQN Object Detection

이미지
https://github.com/imatge-upc/detection-2016-nipsws.git

Rank Theorem (계수 정리)

이미지
Rank 란 이 Linearly independent 한 조건식의 수를 의미하는 것으로, Rank(A) = 2 가 됩니다. Rank는 즉, 진짜! 의미있는 조건식의 수 를 의미하는 값으로, 이를 두고 Matrix의 true size를 의미합니다. 나중에 이 Rank의 개념은 해를 구함에 있어서, 중요하게 쓰이는 개념입니다. 잘 기억해 두시길 바랍니다. Rank에는 재미있는 성질들이 있습니다. 복습 겸사, 한 번 Matrix A를 Transpose해서 구해보세요 이 행렬의 Rank 값 또한  2가 나옵니다. 이를 Rank Thereom(계수 정리) 라 합니다.

OpenAI.Gym install

https://github.com/openai/gym.git

jupyter 에 python3 를 추가 하는법

python3 -m pip install ipykernel python3 -m ipykernel install --user

DQN by PyTorch (ipynb)

http://pytorch.org/tutorials/intermediate/reinforcement_q_learning.html

ofxHighDim

//-------------------------------------------------------------- void ofApp::draw(){     // 배경 검정색.     ofBackground(100, 100, 25);         ofPushMatrix();     // 마우스에 따라 이동     ofTranslate(-ofGetMouseX() * (scale - 0.5), -ofGetMouseY() * (scale - 0.5));         // 각 이미지 디스플레이     for (int i=0; i<imagePoints.size(); i++) {         float x = ofMap(imagePoints[i][0], 0, 1, 0, scale * ofGetWidth());         float y = ofMap(imagePoints[i][1], 0, 1, 0, scale * ofGetHeight());                 // 이미지 디스플레이         ofSetColor(255,255,255);         images[i].draw(x, y, imageSize * images[i].getWidth(), imageSize * images[i].getHeight());   ...

Fine tune ResNet 50 with faster rcnn on MSCOCO

https://github.com/Lisandro79/JetsonCaffe/wiki/Fine-tune-ResNet-50-with-faster-rcnn-on-MSCOCO

keras & jupyter ntebook install Ubuntu

$  sudo pip install jupyter $ sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy $ sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/scipy $ pip install --upgrade numpy scipy keras jupyter $ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl $ python -c "import numpy, scipy, keras, tensorflow"

Caffe2 install Mac/Ubuntu

pip install Caffe2-0.7.0-cp27-cp27m-macosx_10_12_x86_64.whl   https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile

pytorch-caffe-darknet-convert

https://github.com/marvis/pytorch-caffe-darknet-convert.git

train caffe models on pytorch

https://github.com/marvis/pytorch-caffe.git

ofColor 로 화소 가지고 놀기. egtColor(), setColor()

void ofApp::mousePressed(int x, int y, int button){         // 채널 정보를 위해     ofPixels & pixels = img1.getPixels();   // 모든 픽셀 취득     int numChannels = pixels.getNumChannels();         int w = img1.getWidth();     int h = img1.getHeight();         ofColor rgb, gray;  // 컬러 변수     if(numChannels >= 3){         for (int x=0; x< w ; x++){             for(int y=0; y< h; y++){                 rgb = img1.getColor(x, y);                 gray=(int)(0.3*rgb.r + 0.6*rgb.g + 0.1*rgb.b);                 //gray= rgb....

ofPixels, getPixels()

    ofPixels & pixels = bikeIcon.getPixels();   // 모든 픽셀 취득?     ofSetColor(0, 0, 255);     // 모든 픽셀에 대해     for(int y = 0; y < h; y++) {         for(int x = 0; x < w; x++) {             int index = y * w + x;             unsigned char cur = pixels[index];  // 역시 씨불불 이군.             float size = 1 - ((float) cur / 255);   // 네거티브             ofDrawCircle(200 + x * diameter, 500 + y * diameter, 1 + size * diameter / 2);  // 픽셀밝기를 반지름으로 바꿔 원들 표시.         }     }

ofAlphaBlending

이미지

Fast Mask RCNN by TF

https://github.com/CharlesShang/FastMaskRCNN.git

torch-twrl for DQN

https://github.com/twitter/torch-twrl

MS COCO Dataset Download site

http://mscoco.org/dataset/#download

강화학습 Markov Decision Process

- 강화학습을 수식화 할수 있는 일반적인 방법은 마르코프 결정 프로세스 - 에이전트: 게이머, 당신 - 환경: 게임, 패드, 볼 위치, 방향, 장애물, 타깃 등 - 보상: 점수 증가

깔끔한 파이썬 학습 사이트

http://pythonstudy.xyz/python/basics

Random_Train_Val_Split.py

# !/usr/bin/env python2 # # Copyright 2015-2016 Carnegie Mellon University # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import argparse import errno import os import random import shutil def mkdirP ( path ): try : os.makedirs(path) except OSError as exc: # Python >2.5 if exc.errno == errno. EEXIST and os.path.isdir(path): pass else : raise def getImgs (...