MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / init_train_state

Function init_train_state

common/train.cpp:20–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18};
19
20struct train_state * init_train_state() {
21 struct train_state * state = new struct train_state;
22 state->train_its = 0;
23 state->train_samples = 0;
24 state->train_tokens = 0;
25 state->train_epochs = 0;
26 state->shuffle_samples_hash = 0;
27 state->shuffle_sample_count = 0;
28 state->shuffle_next_sample = 0;
29 state->shuffle_rng_state_current = "";
30 state->shuffle_rng_state_next = "";
31
32 state->opt = new struct ggml_opt_context;
33 state->opt->ctx = NULL;
34 state->opt->params = ggml_opt_default_params(GGML_OPT_ADAM);
35 state->opt->params.graph_size = LLAMA_TRAIN_MAX_NODES;
36 state->opt->loss_after = 0.0f;
37
38 return state;
39}
40
41void free_train_state(struct train_state * state) {
42 delete state->opt;

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 1

ggml_opt_default_paramsFunction · 0.50

Tested by

no test coverage detected