darknet/src/matrix.h

30 lines
662 B
C
Raw Normal View History

2013-11-14 02:50:38 +08:00
#ifndef MATRIX_H
#define MATRIX_H
typedef struct matrix{
int rows, cols;
float **vals;
2013-11-14 02:50:38 +08:00
} matrix;
typedef struct {
int *assignments;
matrix centers;
} model;
model do_kmeans(matrix data, int k);
2013-11-14 02:50:38 +08:00
matrix make_matrix(int rows, int cols);
void free_matrix(matrix m);
void print_matrix(matrix m);
matrix csv_to_matrix(char *filename);
2016-03-14 14:18:42 +08:00
void matrix_to_csv(matrix m);
2013-11-14 02:50:38 +08:00
matrix hold_out_matrix(matrix *m, int n);
2014-12-12 05:15:26 +08:00
float matrix_topk_accuracy(matrix truth, matrix guess, int k);
2013-12-08 01:38:50 +08:00
void matrix_add_matrix(matrix from, matrix to);
2016-03-14 14:18:42 +08:00
void scale_matrix(matrix m, float scale);
matrix resize_matrix(matrix m, int size);
2013-11-14 02:50:38 +08:00
float *pop_column(matrix *m, int c);
2013-11-14 02:50:38 +08:00
#endif