-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlearning.h
73 lines (64 loc) · 2.38 KB
/
learning.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* @Descripttion: input the learning/test case to the program
* @version:2.0
* @Author: Quikziii
* @email: [email protected]
* @Date: 2023-01-24
* @LastEditors: Quikziii
* @LastEditTime: 2023-04-30
*/
#ifndef _LEARNING_H
#define _LEARNING_H
/**
* @name: FrontPropagation
* @msg: frontpropagation and return the error
* @param {int} index - (input)the first number of the trainningcase index
* @return {float}the error of the front propagation
*/
float FrontPropagation(int index);
/**
* @name: BackPropagation
* @msg: backpropagation and descent all the weight in the network
* @param {int} index - (input)the first number of the trainningcase index
* @return {}
*/
void BackPropagation(int index);
/**
* @name: Record_Kernel
* @msg: record the kernel which learnt
* @param {char} *fileName - (input)the filelocation which storage the kernel info
* @return {}
*/
void Record_Kernel(char *fileName);
/**
* @name: Write_Kernel
* @msg: write the kernel which learnt by format all value with space
* @param {FILE} *kernelFile - (output)the file to edit
* @param {struct Matrix} **kernel - (input)the kernel which need to be record
* @param {int} kernelAmt - (input)the amount of the kernel
* @return {}
*/
void Write_Kernel(FILE *kernelFile,struct Matrix **kernel,int kernelAmt);
/**
* @name: Write_Matrix
* @msg: write the Matrix which learnt by format
* weightName-channel-row-column\n
* all value with space
* @param {FILE} *kernelFile - (output)the file to edit
* @param {struct Matrix} *weight - (input)the weight which need to be record
* @param {char} *weightName - (input)the Name of the weight
* @return {}
*/
void Write_Matrix(FILE *kernelFile,struct Matrix *weight,struct Matrix *bias);
/**
* @name: Write_BN
* @msg: write the BN which learnt by format
* coeffName-channel\n
* beta[i] gamma[i] mean[i] variance[i]\n byperchannel
* @param {FILE} *kernelFile - (output)the file to edit
* @param {struct BN} *coeff - (input)the BN which need to be record
* @param {char} *coeffName - (input)the Name of the coeff
* @return {}
*/
void Write_BN(FILE *kernelFile, struct BN *coeff);
#endif