DL optimisers

This commit is contained in:
Roland Grinis 2022-05-21 21:00:45 +01:00
parent 3c92bfda59
commit a35bfad44a
3 changed files with 130 additions and 1 deletions

View File

@ -191,7 +191,7 @@ tasks {
withType<Test>{
systemProperty("java.library.path", "$cppBuildDir/jnoa")
//systemProperty("java.library.path",
// "${System.getProperty("user.home")}/devspace/noa/build/jnoa")
// "${System.getProperty("user.home")}/devspace/noa/cmake-build-release/jnoa")
}
}

View File

@ -1191,6 +1191,134 @@ JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_stepAdamOptim
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_zeroGradAdamOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: rmsOptim
* Signature: (JDDDDDZ)J
*/
JNIEXPORT jlong JNICALL Java_space_kscience_kmath_noa_JNoa_rmsOptim
(JNIEnv *, jclass, jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jboolean);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: disposeRmsOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_disposeRmsOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: stepRmsOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_stepRmsOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: zeroGradRmsOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_zeroGradRmsOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: adamWOptim
* Signature: (JDDDDDZ)J
*/
JNIEXPORT jlong JNICALL Java_space_kscience_kmath_noa_JNoa_adamWOptim
(JNIEnv *, jclass, jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jboolean);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: disposeAdamWOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_disposeAdamWOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: stepAdamWOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_stepAdamWOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: zeroGradAdamWOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_zeroGradAdamWOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: adagradOptim
* Signature: (JDDDDD)J
*/
JNIEXPORT jlong JNICALL Java_space_kscience_kmath_noa_JNoa_adagradOptim
(JNIEnv *, jclass, jlong, jdouble, jdouble, jdouble, jdouble, jdouble);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: disposeAdagradOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_disposeAdagradOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: stepAdagradOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_stepAdagradOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: zeroGradAdagradOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_zeroGradAdagradOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: sgdOptim
* Signature: (JDDDDZ)J
*/
JNIEXPORT jlong JNICALL Java_space_kscience_kmath_noa_JNoa_sgdOptim
(JNIEnv *, jclass, jlong, jdouble, jdouble, jdouble, jdouble, jboolean);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: disposeSgdOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_disposeSgdOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: stepSgdOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_stepSgdOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: zeroGradSgdOptim
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_space_kscience_kmath_noa_JNoa_zeroGradSgdOptim
(JNIEnv *, jclass, jlong);
/*
* Class: space_kscience_kmath_noa_JNoa
* Method: swapTensors

View File

@ -6,6 +6,7 @@
package space.kscience.kmath.noa
import java.io.File
import kotlin.test.Ignore
import kotlin.test.Test
import kotlin.test.assertTrue