2월, 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

[Android studio][NDK] Your project contains C++ files but it is not using a supported native build system.

1. Error message     Error:Execution failed for task ':app:compileDebugNdk'. > Error: Your project contains C++ files but it is not using a supported native build system.   Consider using CMake or ndk-build integration. For more information, go to:    https://d.android.com/r/studio-ui/add-native-code.html   Alternatively, you can use the experimental plugin:    https://developer.android.com/r/tools/experimental-plugin.html 2. Solution Add this line to your  gradle.properties  file android . useDeprecatedNdk = true 3. Reference https://stackoverflow.com/questions/40065871/error-your-project-contains-c-files-but-it-is-not-using-a-supported-native-bu

[Opencv] Opencv 2.1 source download

1. Opencv source :  v 2.1  https://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.1/OpenCV-2.1.0-win32-vs2008.exe/download?use_mirror=jaist&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencvlibrary%2Ffiles%2Fopencv-win%2F2.1%2FOpenCV-2.1.0-win32-vs2008.exe%2Fdownload%3Fuse_mirror%3Djaist%26r%3Dhttps%253A%252F%252Fsourceforge.net%252Fprojects%252Fopencvlibrary%252Ffiles%252Fopencv-win%252F2.1%252FOpenCV-2.1.0-win32-vs2008.exe%252Fdownload%253Fuse_mirror%253Djaist%2526r%253Dhttps%25253A%25252F%25252Fsourceforge.net%25252Fprojects%25252Fopencvlibrary%25252Ffiles%25252Fopencv-win%25252F2.1%25252FOpenCV-2.1.0-win32-vs2008.exe%25252Fdownload%25253Fuse_mirror%25253Djaist%252526r%25253Dhttps%2525253A%2525252F%2525252Fsourceforge.net%2525252Fprojects%2525252Fopencvlibrary%2525252Ffiles%2525252Fopencv-win%2525252F2.1%2525252FOpenCV-2.1.0-win32-vs2008.exe%2525252Fdownload%2525253Fuse_mirror%2525253Djaist%25252526r%2525253Dhttps%252525253A%252525252F%252525252Fsourceforge.net%252

[Opencv][Compile error] Error LNK2026 module unsafe for SAFESEH image.

1. Error message Error LNK2026 module unsafe for SAFESEH image. 2. Solution To solve this issue, please take the steps below: 1. Open the project propert pages dialog     right-click the project -> properties  2. Click linker below the node of configuration properties 3. Click command line 4. Write down " /SAFESEH:NO  " in additional options then click apply 3. Reference https://social.msdn.microsoft.com/Forums/ko-KR/4039184d-d765-45bf-9d72-25f5c6f8d5b4/error-lnk2026-module-unsafe-for-safeseh-image?forum=vcgeneral

[Opencv][Compile error] Error C2371 'int8_t': redefinition; different basic types

1. Error message Error C2371 'int8_t': redefinition; different basic types 2. Solution Add " signed"  like this typedef signed __int8 int8_t ; 3. Reference https://stackoverflow.com/questions/16415058/visual-studio-2008-error-c2371-int8-t-redefinition-different-basic-types 1 @user63898 - I guess because  __int8  can be signed or unsigned and the compiler is being pedantic when comparing the  typedef 's to insist that the modifiers are the same. Although  signed  is default (according to MSDN) a compiler option can make  unsigned  the default.  –  Roger Rowland   May 7 '13 at 12:56  

[Opencv][Compile error] Severity Code Description Project File Line Suppression State Error C3861 'bind2nd': identifier not found cvaux

1. Error message Severity Code Description Project File Line Suppression State Error C3861 'bind2nd': identifier not found cvaux 2. Solution #include <functional> 3. Reference https://sourceforge.net/p/stlport/discussion/490891/thread/95f92a62/ https://stackoverflow.com/questions/21834325/vs2012-bind2nd-is-not-a-member-of-std