@@ -1017,15 +1017,15 @@ void sample_softmax(struct ggml_tensor * logits, struct ggml_tensor * probs, str
1017
1017
}
1018
1018
}
1019
1019
1020
- void print_probs1 (struct ggml_tensor * probs, int i) {
1020
+ void print_row (struct ggml_tensor * probs, int i) {
1021
1021
for (int k = 0 ; k < probs->ne [0 ]; ++k) {
1022
1022
float p = ggml_get_f32_1d (probs, i*probs->ne [0 ] + k);
1023
1023
printf (" %.2f" , p);
1024
1024
}
1025
1025
printf (" \n " );
1026
1026
}
1027
1027
1028
- void print_probs (struct ggml_tensor * probs) {
1028
+ void print_matrix (struct ggml_tensor * probs) {
1029
1029
assert (probs->n_dims == 2 );
1030
1030
for (int i=0 ; i<probs->ne [1 ]; ++i) {
1031
1031
for (int k = 0 ; k < probs->ne [0 ]; ++k) {
@@ -1177,7 +1177,7 @@ int main(int argc, char ** argv) {
1177
1177
size_t compute_size = 1024ll *1024ll *1024ll ;
1178
1178
uint8_t * compute_addr = new uint8_t [compute_size];
1179
1179
1180
- int n_examples = 256 ;
1180
+ int n_examples = 25600 ;
1181
1181
int n_tokens = model.hparams .n_ctx ;
1182
1182
int n_vocab = model.hparams .n_vocab ;
1183
1183
@@ -1213,7 +1213,7 @@ int main(int argc, char ** argv) {
1213
1213
get_example_targets (64 *ex+16 , tokens_input2, targets2);
1214
1214
// get_example_targets(64*ex+32, tokens_input3, targets3);
1215
1215
// get_example_targets(64*ex+48, tokens_input4, targets4);
1216
- // print_probs (targets);
1216
+ // print_matrix (targets);
1217
1217
// print_tokens(tokens_input, n_vocab);
1218
1218
1219
1219
struct ggml_tensor * logits1 = forward (&model, &kv_self, ctx0, &gf, tokens_input1, n_tokens, n_past);
@@ -1245,7 +1245,7 @@ int main(int argc, char ** argv) {
1245
1245
// sample_softmax(logits1, before_opt_probs, before_opt_best_samples);
1246
1246
1247
1247
// printf("probabilities before optimization:\n");
1248
- // print_probs (before_opt_probs);
1248
+ // print_matrix (before_opt_probs);
1249
1249
// printf("best samples before optimization:\n");
1250
1250
// print_tokens(before_opt_best_samples, n_vocab);
1251
1251
@@ -1275,7 +1275,7 @@ int main(int argc, char ** argv) {
1275
1275
if (ex % 64 == 0 ) {
1276
1276
sample_softmax (logits1, after_opt_probs, after_opt_best_samples);
1277
1277
// printf("probabilities after optimization:\n");
1278
- // print_probs (after_opt_probs);
1278
+ // print_matrix (after_opt_probs);
1279
1279
printf (" best samples after optimization:\n " );
1280
1280
print_tokens (after_opt_best_samples, n_vocab);
1281
1281
}
@@ -1326,7 +1326,7 @@ int main(int argc, char ** argv) {
1326
1326
// int sample_at = n_tokens-1;
1327
1327
int token = ggml_get_i32_1d (best_samples, sample_ctx-1 );
1328
1328
1329
- // print_probs1 (probs, sample_at);
1329
+ // print_row (probs, sample_at);
1330
1330
print_token (token, n_vocab);
1331
1331
1332
1332
lshift_examples (tokens_input, targets, 1 );
0 commit comments