.no_alloc = false,
};
- //struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_ADAM);
+ //struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_TYPE_ADAM);
//opt_params.adam.alpha = 0.01f;
- struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_LBFGS);
+ struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_TYPE_LBFGS);
// original threads: 8
int nthreads = 8;
printf("t0 = %f\n", ggml_get_f32_1d(t0, 0));
printf("t1 = %f\n", ggml_get_f32_1d(t1, 0));
- GGML_ASSERT(res == GGML_OPT_OK);
+ GGML_ASSERT(res == GGML_OPT_RESULT_OK);
GGML_ASSERT(is_close(ggml_get_f32_1d(t0, 0), 5.0f, 1e-3f));
GGML_ASSERT(is_close(ggml_get_f32_1d(t1, 0), 10.0f, 1e-3f));
enum ggml_opt_result res = ggml_opt(NULL, opt_params, f);
- GGML_ASSERT(res == GGML_OPT_OK);
+ GGML_ASSERT(res == GGML_OPT_RESULT_OK);
GGML_ASSERT(is_close(ggml_get_f32_1d(t0, 0), 5.0f, 1e-2f));
GGML_ASSERT(is_close(ggml_get_f32_1d(t1, 0), 10.0f, 1e-2f));
}
enum ggml_opt_result res = ggml_opt(NULL, opt_params, f);
- GGML_ASSERT(res == GGML_OPT_OK);
+ GGML_ASSERT(res == GGML_OPT_RESULT_OK);
GGML_ASSERT(is_close(ggml_get_f32_1d(f, 0), 0.0f, 1e-3f));
GGML_ASSERT(is_close(ggml_get_f32_1d(t0, 0), 0.0f, 1e-3f));
GGML_ASSERT(is_close(ggml_get_f32_1d(t1, 0), 0.0f, 1e-3f));
enum ggml_opt_result res = ggml_opt(NULL, opt_params, f);
- GGML_ASSERT(res == GGML_OPT_OK);
+ GGML_ASSERT(res == GGML_OPT_RESULT_OK);
GGML_ASSERT(is_close(ggml_get_f32_1d(f, 0), 0.0f, 1e-3f));
GGML_ASSERT(is_close(ggml_get_f32_1d(t0, 0), 1.0f, 1e-3f));
GGML_ASSERT(is_close(ggml_get_f32_1d(t1, 0), 3.0f, 1e-3f));
.no_alloc = false,
};
- //struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_ADAM);
- struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_LBFGS);
+ //struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_TYPE_ADAM);
+ struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_TYPE_LBFGS);
opt_params.n_threads = (argc > 1) ? atoi(argv[1]) : 8;
enum ggml_opt_result res = ggml_opt(NULL, opt_params, f);
- GGML_ASSERT(res == GGML_OPT_OK);
+ GGML_ASSERT(res == GGML_OPT_RESULT_OK);
// print results
for (int i = 0; i < 16; i++) {