4월, 2018의 게시물 표시

[Deep learning] Gradient Descent Optimizer

이미지
https://icim.nims.re.kr/post/easyMath/70 알기 쉬운 산업수학 알기 쉬운 산업수학 Gradient Descent Optimizer 2017년 12월 13일(수) | 김민중 URL  (1) 주어진 목적함수  f f 의 최솟값(minimum)을 찾아가는 알고리즘으로 다음과 같은 방식으로 최솟값을 찾아간다. 초기값  x 0 x 0 을 임의로 설정, 적당한 Learning rate  α α  설정 n ≥ 0 n ≥ 0 인 정수에 대해서  x n + 1 x n + 1 은 다음과 같이 정의한다. x n + 1 : = x n − α ⋅ ∇ f ( x n ) x n + 1 := x n − α ⋅ ∇ f ( x n ) 주의사항 함수 f f 의 모양이 convex가 아닌 경우 global minimum이 아닌 local minimum으로  x n x n 이 수렴할 가능성이 있다. Learning rate  α α  값이 큰 경우 최솟값으로  x n x n 이 수렴하는 것이 아니라 발산할 수 있다. Learning rate  α α  값이 작은 경우 수렴하는 속도가 지나치게 느릴 수 있다. 방정식  2 ⋅ x = 10 2 ⋅ x = 10  의 근을 Gradient Descent를 이용해서 찾아보자. 목적함수  f ( x ) : = ( 10 − 2 x ) 2 f ( x ) := ( 10 − 2 x ) 2 으로 설정하겠다( f f 의 최솟값인 0이 되게 하는  x x 값이 우리가 원하는 방정식의 근이다). 초기값  x 0 = 0 x 0 = 0 , Learning rate  α = 0.05 α = 0.05 으로 설정 f ′ ( x ) = 4 ( 2 x − 10 ) f ′ ( x ) = 4 ( 2 x − 10 ) 이므로  x 1 x 1 은 다음과 같이 구할 수 있다. x 1 = x 0 − α ⋅ f ′ ( x 0 ) = 0 − 0.05 ⋅ ( − 40 ) = 2 x

[pythonanywhere.com] OSError('Tunnel connection failed: 403 Forbidden',)))

이미지
1. Error message requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.bbc.com', port=443): Max retries exceeded with url: /weather/0/1835848 (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',))) 2.  If you are using a free account at pythonanywhere.com then keep in mind that access to external sites via  urllib2  is restricted to a set of  white listed hosts . Paid account can access any external sites. share improve this answer answered  Nov 19 '13 at 5:46 Miguel 38.1k 6 72 91 3. Reference https://stackoverflow.com/questions/20063726/getting-error-tunnel-connection-failed-403-forbidden-with-mechanize-and-pytho

ing~~~~ [Android][NDK] How to use c++ source in android?

이미지
1. Two method 1-1. NDK [Ref] https://developer.android.com/ndk/samples/sample_hellojni.html?hl=ko 1-2. CMake [Ref] https://developer.android.com/studio/projects/add-native-code.html?hl=ko [Ref] https://developer.android.com/ndk/samples/sample_hellojni.html?hl=ko 2. NDK detail : [Ref : https://www.youtube.com/watch?v=RmPuwdxR1qs ] [Ref : http://kn-gloryo.github.io/Build_NDK_AndroidStudio_detail/] [Ref : http://intellij.my/2017/05/10/how-to-create-a-c-library-with-ndk-on-android-studio/ ] 2-1. Android.mk LOCAL_PATH := $(call my-dir) OPENCV_INSTALL_MODULES := on include $(CLEAR_VARS) include D:/Data/Libraries/opencv-2.4.13.3-android-sdk/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk LOCAL_C_INCLUDES := D:/Data/Libraries/opencv-2.4.13.3-android-sdk/OpenCV-android-sdk/sdk/native/jni/include LOCAL_C_INCLUDES += D:/Data/Libraries/opencv-2.4.13.3-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/opencv LOCAL_C_INCLUDES += D:/Data/Libraries/opencv-2.4.13.3-android-sdk/Op

[Android] Android Studio: Change the Cache Location

1. Problem Too big cache size for gradle / android studio 2. Solution1 Locate the place where you’ve installed you AS (e.g.  C:\Program Files\Android Studio ) Go to the  bin  directory and edit  idea.properties  file Search for  idea . config . path  and  idea . system . path  and edit those. I ended up having something like: 1 2 3 4 5 6 7 #--------------------------------------------------------------------- # idea .config .path = $ { user .home } / no - backup / .AndroidStudioBeta / config   idea .system .path = $ { user .home } / no - backup / .AndroidStudioBeta / system # #--------------------------------------------------------------------- 3. Solution2 In the following example  settings.gradle  file we configure our build cache directory to be the directory  build-cache  in the root directory of our project where we store our  settings.gradle  file:   1 2 3 4 5 6 // File: settings.gradle buildCache

[Android][Opencv][NDK] FLANNException("Invalid index file, cannot read");

1. Problem 2. Solution LOCAL_CFLAGS += -fexceptions LOCAL_PATH := $(call my-dir) OPENCV_INSTALL_MODULES := on include $(CLEAR_VARS) include D:/Data/Libraries/opencv-2.4.13.3-android-sdk/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk LOCAL_C_INCLUDES := D:/Data/Libraries/opencv-2.4.13.3-android-sdk/OpenCV-android-sdk/sdk/native/jni/include LOCAL_C_INCLUDES += D:/Data/Libraries/opencv-2.4.13.3-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/opencv LOCAL_C_INCLUDES += D:/Data/Libraries/opencv-2.4.13.3-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/opencv2 LOCAL_MODULE := liveness-lib LOCAL_SRC_FILES := livenesslib.cpp LOCAL_LDLIBS += -llog -ldl LOCAL_CFLAGS += -fexceptions include $(BUILD_SHARED_LIBRARY) 3. Error Messages armeabi] Compile++ thumb: cvutils-lib <= cvutilslib.cpp In file included from jni/cvutilslib.cpp:6: In file included from jni/cvutils.h:8: In file included from jni/.\lbp\lbp.hpp:7: In file included from c:/Libs/openc