layer
layer 구조체
Layer 구조체 입니다.
struct layer{
LAYER_TYPE type;
ACTIVATION activation;
COST_TYPE cost_type;
void (*forward) (struct layer, struct network);
void (*backward) (struct layer, struct network);
void (*update) (struct layer, update_args);
int batch_normalize;
int shortcut;
int batch;
int forced;
int flipped;
int inputs;
int outputs;
int nweights;
int nbiases;
int extra;
int truths;
int h,w,c; /// input height, width, channel
int out_h, out_w, out_c; /// output height, width, channel
int n; /// number of filter(= output channel)
int max_boxes;
int groups;
int size; /// kernel size
int side;
int stride;
int reverse;
int flatten;
int spatial;
int pad;
int sqrt;
int flip;
int index;
int binary;
int xnor;
int steps;
int hidden;
int truth;
float smooth;
float dot;
float angle;
float jitter;
float saturation;
float exposure;
float shift;
float ratio;
float learning_rate_scale;
float clip;
int noloss;
int softmax;
int classes;
int coords;
int background;
int rescore;
int objectness;
int joint;
int noadjust;
int reorg;
int log;
int tanh;
int *mask;
int total;
float alpha;
float beta;
float kappa;
float coord_scale;
float object_scale;
float noobject_scale;
float mask_scale;
float class_scale;
int bias_match;
int random;
float ignore_thresh;
float truth_thresh;
float thresh;
float focus;
int classfix;
int absolute;
int onlyforward;
int stopbackward;
int dontload;
int dontsave;
int dontloadscales;
int numload;
float temperature;
float probability;
float scale;
char * cweights;
int * indexes;
int * input_layers;
int * input_sizes;
int * map;
int * counts;
float ** sums;
float * rand;
float * cost;
float * state;
float * prev_state;
float * forgot_state;
float * forgot_delta;
float * state_delta;
float * combine_cpu;
float * combine_delta_cpu;
float * concat;
float * concat_delta;
float * binary_weights;
float * biases;
float * bias_updates;
float * scales;
float * scale_updates;
float * weights;
float * weight_updates;
float * delta;
float * output;
float * loss;
float * squared;
float * norms;
float * spatial_mean;
float * mean;
float * variance;
float * mean_delta;
float * variance_delta;
float * rolling_mean;
float * rolling_variance;
float * x;
float * x_norm;
float * m;
float * v;
float * bias_m;
float * bias_v;
float * scale_m;
float * scale_v;
float *z_cpu;
float *r_cpu;
float *h_cpu;
float * prev_state_cpu;
float *temp_cpu;
float *temp2_cpu;
float *temp3_cpu;
float *dh_cpu;
float *hh_cpu;
float *prev_cell_cpu;
float *cell_cpu;
float *f_cpu;
float *i_cpu;
float *g_cpu;
float *o_cpu;
float *c_cpu;
float *dc_cpu;
float * binary_input;
struct layer *input_layer; /// rnn input layer
struct layer *self_layer; /// rnn self layer
struct layer *output_layer; /// rnn output layer
struct layer *reset_layer;
struct layer *update_layer;
struct layer *state_layer;
struct layer *input_gate_layer;
struct layer *state_gate_layer;
struct layer *input_save_layer;
struct layer *state_save_layer;
struct layer *input_state_layer;
struct layer *state_state_layer;
struct layer *input_z_layer;
struct layer *state_z_layer;
struct layer *input_r_layer;
struct layer *state_r_layer;
struct layer *input_h_layer;
struct layer *state_h_layer;
struct layer *wz;
struct layer *uz;
struct layer *wr;
struct layer *ur;
struct layer *wh;
struct layer *uh;
struct layer *uo;
struct layer *wo;
struct layer *uf;
struct layer *wf;
struct layer *ui;
struct layer *wi;
struct layer *ug;
struct layer *wg;
tree *softmax_tree;
size_t workspace_size;
};type: 레이어의 종류를 나타내는 열거형(enum) 변수activation: 활성화 함수를 나타내는 열거형 변수cost_type: 비용 함수를 나타내는 열거형 변수forward: 레이어의 순전파(forward propagation) 연산을 수행하는 함수 포인터backward: 레이어의 역전파(backward propagation) 연산을 수행하는 함수 포인터update: 레이어의 가중치(weight)와 편향(bias) 값을 업데이트하는 함수 포인터batch_normalize: 배치 정규화(batch normalization)를 수행할지 여부를 나타내는 정수 변수shortcut: shortcut 연결을 사용할지 여부를 나타내는 정수 변수batch: 미니배치 크기를 나타내는 정수 변수forced: 강제로 레이어를 수행할지 여부를 나타내는 정수 변수flipped: 입력 데이터를 뒤집어서 사용할지 여부를 나타내는 정수 변수inputs: 레이어의 입력 개수를 나타내는 정수 변수outputs: 레이어의 출력 개수를 나타내는 정수 변수nweights: 가중치(weight)의 개수를 나타내는 정수 변수nbiases: 편향(bias)의 개수를 나타내는 정수 변수extra: 추가 파라미터 값의 개수를 나타내는 정수 변수truths: 레이블(label) 데이터의 개수를 나타내는 정수 변수h,w,c: 입력 데이터의 높이, 너비, 채널(channel)을 나타내는 정수 변수out_h, out_w, out_c: 출력 데이터의 높이, 너비, 채널을 나타내는 정수 변수n: 필터(filter)의 개수(출력 채널 수)를 나타내는 정수 변수max_boxes: bounding box의 최대 개수를 나타내는 정수 변수groups: 그룹 수를 나타내는 정수 변수size: 컨볼루션(kernel)의 크기를 나타내는 정수 변수side: max pooling 연산의 윈도우 크기를 나타내는 정수 변수stride: 스트라이드(stride) 크기를 나타내는 정수 변수reverse: RNN 레이어에서 시퀀스의 역순으로 처리할지 여부를 나타내는 플래그flatten: 입력 데이터를 1차원 벡터로 평탄화할지 여부를 나타내는 플래그spatial: 컨볼루션 레이어에서 공간적인 정보를 유지할지 여부를 나타내는 플래그
pad: 입력 데이터 주변에 패딩을 추가할 크기를 나타내는 값sqrt: 배치 정규화 계층에서 분산에 더해줄 작은 값으로, 분산이 0이 되는 것을 방지flip: 이미지를 수평으로 뒤집을지 여부를 나타내는 플래그index: 컨볼루션 레이어에서 사용할 필터의 인덱스binary: 이진 분류를 위한 활성화 함수 사용 여부를 나타내는 플래그xnor: XNOR-Networks를 위한 플래그steps: RNN 레이어에서 시퀀스의 길이hidden: RNN 레이어에서 숨겨진 상태의 차원 수truth: YOLO 계열의 레이어에서 참값의 크기smooth: 경사 하강법에서 사용할 스무딩 계수dot: 배치 정규화 계층에서 공분산을 계산할 때 사용되는 값angle: RoI Pooling 레이어에서 RoI를 회전시키는 각도jitter: 데이터 확장을 위한 이미지의 크기 변화 폭을 나타내는 값saturation: 데이터 확장을 위한 채도 변화 폭을 나타내는 값exposure: 데이터 확장을 위한 밝기 변화 폭을 나타내는 값shift: 데이터 확장을 위한 이미지 이동 변화 폭을 나타내는 값ratio: 데이터 확장을 위한 이미지 비율 변화 폭을 나타내는 값learning_rate_scale: 가중치 업데이트 시 학습률을 곱할 스케일 값을 나타내는 값clip: 경사 하강법에서 사용할 기울기 클리핑 임계값noloss: 손실이 없는 레이어인지 여부softmax: 소프트맥스 레이어인지 여부classes: 분류해야 할 클래스의 개수coords: 바운딩 박스 좌표의 개수background: 배경 클래스가 존재하는지 여부rescore: bbox의 신뢰도를 다시 계산하는지 여부objectness: bbox의 objectness를 계산하는지 여부joint: 다른 레이어와 연결되는지 여부noadjust: 학습 가능한 파라미터가 있는지 여부reorg: Reorg 레이어인지 여부log: 로그 레이어인지 여부tanh: 하이퍼볼릭 탄젠트 레이어인지 여부mask: 마스크 배열total: 마스크 배열의 총 길이
alpha: 경사 하강법의 학습률beta: 경사 하강법의 모멘텀 계수kappa: RPN 레이어의 균형 매개변수
coord_scale: bbox 좌표의 손실 가중치object_scale: bbox objectness의 손실 가중치noobject_scale: bbox non-objectness의 손실 가중치mask_scale: 마스크의 손실 가중치class_scale: 클래스의 손실 가중치bias_match: 바이어스를 맞추는지 여부random: 무작위로 초기화하는지 여부ignore_thresh: 무시 임계값truth_thresh: 진실 임계값thresh: 임계값focus: focal loss 매개변수classfix: 클래스 인덱스 매핑 매개변수absolute: 절대값을 사용하는지 여부
onlyforward: 순전파만 수행하는지 여부stopbackward: 역전파를 중지하는지 여부dontload: 레이어의 가중치를 로드하지 않는지 여부dontsave: 레이어의 가중치를 저장하지 않는지 여부dontloadscales: 레이어의 스케일을 로드하지 않는지 여부numload: 가중치를 로드한 횟수
temperature: Softmax 온도probability: 드롭아웃 확률scale: 배치 정규화 매개변수cweights: 클래스 가중치 파일 이름indexes: 인덱스 배열input_layers: 현재 레이어에 입력으로 들어오는 레이어의 인덱스 배열input_sizes: 입력 레이어의 크기 배열map: 이전 레이어와 현재 레이어 간의 매핑 정보counts: 이전 레이어와 현재 레이어 간의 매핑 정보에 따른 각각의 노드 수sums: 이전 레이어와 현재 레이어 간의 매핑 정보에 따른 가중치 합rand: 무작위 값cost: 비용state: 현재 레이어의 상태 값prev_state: 이전 레이어의 상태 값forgot_state: 현재 레이어에서 사용되는 이전 레이어의 상태 값forgot_delta: 현재 레이어에서 사용되는 이전 레이어의 상태 값의 변화량state_delta: 현재 레이어의 상태 값의 변화량combine_cpu: 두 레이어를 결합하기 위한 값combine_delta_cpu: 결합한 레이어의 변화량
concat: 레이어를 연결하기 위한 값concat_delta: 연결한 레이어의 변화량
binary_weights: 이진 가중치biases: 편향 값bias_updates: 편향 값의 업데이트scales: 스케일 값scale_updates: 스케일 값의 업데이트weights: 가중치 값weight_updates: 가중치 값의 업데이트delta: 오차 값output: 출력 값loss: 손실 값squared: 제곱 값norms: 노름 값spatial_mean: 공간 평균 값mean: 평균 값variance: 분산 값mean_delta: 평균 값의 변화량variance_delta: 분산 값의 변화량rolling_mean: 이동 평균 값rolling_variance: 이동 분산 값x: 입력 값x_norm: 정규화된 입력 값m: 이동 평균v: 이동 분산bias_m: 편향 이동 평균bias_v: 편향 이동 분산scale_m: 배치 정규화(Batch Normalization)에서 사용되는 moving meanscale_v: 배치 정규화에서 사용되는 moving variance
z_cpu, r_cpu, h_cpu, prev_state_cpu: LSTM 네트워크의 게이트를 구성하는 변수들
temp_cpu, temp2_cpu, temp3_cpu: 임시 저장용 변수들
dh_cpu, hh_cpu, prev_cell_cpu, cell_cpu, f_cpu, i_cpu, g_cpu, o_cpu, c_cpu, dc_cpu: LSTM 네트워크의 셀(Cell)을 구성하는 변수들binary_input: 이진(Binary) 입력값input_layer, self_layer, output_layer: RNN(Recurrent Neural Network) 구조에서 사용되는 입력 레이어, 자기 순환 레이어, 출력 레이어reset_layer, update_layer, state_layer: LSTM 네트워크에서 사용되는 reset, update, state 게이트를 구성하는 레이어input_gate_layer, state_gate_layer, input_save_layer, state_save_layer, input_state_layer, state_state_layer: LSTM 네트워크에서 사용되는 게이트와 셀을 구성하는 레이어input_z_layer, state_z_layer, input_r_layer, state_r_layer, input_h_layer, state_h_layer: LSTM 네트워크의 게이트를 구성하는 레이어
wz, uz, wr, ur, wh, uh, uo, wo, uf, wf, ui, wi, ug, wg: LSTM 네트워크에서 사용되는 가중치와 편향
softmax_tree: Softmax 함수에서 사용되는 트리(Tree) 구조
workspace_size: 사용 가능한 메모리 공간의 크기
Last updated
Was this helpful?