layer.h & layer.c 定義了深度學(xué)習(xí)基本元素——層的各種屬性&操作
| 類型 | 名稱 | 意義 |
|---|---|---|
| enum LAYER_TYPE | type | 層的類型 |
| enum ACTIVATION | activation | 激活函數(shù)類型 |
| COST_TYPE | cost_type | 代價(jià)函數(shù)類型 |
| void * | forward(...) | 前饋函數(shù)指針 |
| void * | backward(...) | 反饋函數(shù)指針 |
| void * | update(...) | 參數(shù)更新函數(shù)指針 |
| void * | forward_gpu(...) | gpu 前饋函數(shù)指針 |
| void * | backward_gpu(...) | gpu 反饋函數(shù)指針 |
| void * | update_gpu(...) | gpu 參數(shù)更新函數(shù)指針 |
| int | batch_normalize | 是否進(jìn)行 batch_normalize |
| int | shortcut | ? |
| int | batch | 批量大小 |
| int | forced | ? |
| int | flipped | 是否是翻轉(zhuǎn)的 |
| int | inputs | 輸入feature map 元素個(gè)數(shù)(1個(gè)batch) |
| int | outputs | 輸出feature map 元素個(gè)數(shù)(1個(gè)batch) |
| int | nweights | filter 中 weight 元素個(gè)數(shù) |
| int | nbiases | filter 中 bias 元素個(gè)數(shù) |
| int | extra | ? |
| int | truths | ground truth box 數(shù)目( e.g. 30*5) |
| int | h,w,c | 輸入feature map 的高度,寬度,厚度(channel數(shù)) |
| int | out_h,out_w,out_c | 輸出feature map 的高度,寬度,厚度(channel數(shù)) |
| int | n | 不同層有不同含義,region_layer 表示每個(gè)cell boxes 數(shù)目,route_layer 表示有多少個(gè)層參與拼接 |
| int | max_boxes | 最大 ground truth box數(shù)目 |
| int | groups | ?softmax_tree 相關(guān) |
| int | size | ?可能指一個(gè)預(yù)測(cè)的box的元素個(gè)數(shù)(=coords+classes+1) |
| int | side | ?可能是最后一層feature map長寬 |
| int | stride | 滑動(dòng)步長大小 |
| int | reverse | 是否翻轉(zhuǎn) |
| int | flatten | 是否攤平 |
| int | pad | feature map 補(bǔ)0數(shù)目 |
| int | sqrt | 是否開根號(hào) |
| int | flip | 是否翻轉(zhuǎn) |
| int | binary | 是否二進(jìn)制權(quán)重 |
| int | xnor | 是否二進(jìn)制權(quán)重&feature_map |
| int | steps | 迭代次數(shù) |
| int | hidden | ? |
| int | truth | ?是否ground truth |
| float | smooth | ?是否平滑 |
| float | dot | ? |
| float | angle | 角度調(diào)整幅度 |
| float | jitter | 抖動(dòng)調(diào)整幅度 |
| float | saturation | 飽和度調(diào)整幅度 |
| float | exposure | 過曝調(diào)整幅度 |
| float | shift | 平移調(diào)整幅度 |
| float | ration | 長寬調(diào)整幅度 |
| float | learning_rate_scale | 學(xué)習(xí)速率 scale 比例 |
| int | softmax | ?是否采用softmax |
| int | classes | 類別數(shù)目(20) |
| int | coords | 坐標(biāo)個(gè)數(shù)(4) |
| int | background | ?是否是背景 |
| int | rescore | 是否重定義分?jǐn)?shù)(loss中 has object 的 confidence loss,0則回歸到1,1則回歸到IOU) |
| int | objectness | ? |
| int | does_cost | ?計(jì)算cost |
| int | joint | ?鏈接 |
| int | noadjust | ?不調(diào)整 |
| int | reorg | ?是否重新組織順序 |
| int | log | ?取對(duì)數(shù) |
| int | adam | 是否采用adam sgd |
| float | B1 | ?adam參數(shù) |
| float | B2 | ? |
| float | eps | ? |
| int | t | ? |
| float | alpha | ? |
| float | beta | ? |
| float | kappa | ?adam參數(shù) |
| float | coord_scale | loss中坐標(biāo)loss系數(shù) |
| float | object_scale | loss中有物體loss系數(shù) |
| float | noobject_scale | loss中沒有物體loss系數(shù) |
| float | class_scale | loss中物體分類softmax loss系數(shù) |
| int | bias_match | ? |
| int | random | ? |
| float | thresh | 閾值 |
| int | classfix | ? |
| int | absolute | ? |
| int | onlyforward | 是否只進(jìn)行前饋操作 |
| int | stopbackward | 是否停止反饋操作 |
| int | dontload | ? |
| int | dontloadscales | ? |
| float | temperature | ? |
| float | probability | ?準(zhǔn)確率 |
| float | scale | ?scale比例 |
| char * | cweights | ?濾波器weight參數(shù)值 |
| int * | indexes | 數(shù)據(jù)坐標(biāo)值(在max pool中用來指示輸入feature map的) |
| int * | input_layers | |
| int * | input_sizes | |
| int * | map | |
| float * | rand | |
| float * | cost | |
| float * | state | ?RNN LSTM |
| float * | prev_state | ? |
| float * | forgot_state | ? |
| float * | forgot_delta | ? |
| float * | state_delta | ?RNN LSTM |
| float * | concat | ? |
| float * | concat_delta | ? |
| float * | binary_weights | 濾波器二進(jìn)制weights值 |
| float * | biases | 濾波器biases參數(shù)值 |
| float * | bias_updates | 濾波器biases參數(shù)更新大小 |
| float * | scales | ?scale值 |
| float * | scale_updates | ?scale更新值 |
| float * | weights | 濾波器weight參數(shù)值 |
| float * | weight_updates | 濾波器weight參數(shù)更新大小 |
| float * | delta | ???????梯度 |
| float * | output | 輸出 feature map值 (注意沒有輸入feature map值,因?yàn)橐话憔褪巧弦粚拥妮敵?,從network中拿) |
| float * | squared | ?平方值 |
| float * | norms | ?l1 l2正則化值 |
| float * | spatial_mean | ?空間平均值 |
| float * | mean | ?平均值 |
| float * | variance | ?方差 |
| float * | mean_delta | ?平均梯度 |
| float * | variance_delta | ?方差梯度 |
| float * | rolling_mean | ?波動(dòng)平均 |
| float * | rolling_variance | ?波動(dòng)方差 |
| 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 * | binary_input | |
| struct layer * | input_layer | |
| struct layer * | self_layer | |
| struct layer * | output_layer | |
| struct layer * | input_gate_layer | RNN LSTM |
| struct layer * | state_gate_layer | RNN LSTM |
| struct layer * | input_save_layer | RNN LSTM |
| struct layer * | state_save_layer | RNN LSTM |
| struct layer * | input_state_layer | RNN LSTM |
| struct layer * | state_state_layer | RNN LSTM |
| struct layer * | input_z_layer | RNN LSTM |
| struct layer * | state_z_layer | RNN LSTM |
| struct layer * | input_r_layer | RNN LSTM |
| struct layer * | state_r_layer | RNN LSTM |
| struct layer * | input_h_layer | RNN LSTM |
| struct layer * | state_h_layer | RNN LSTM |
| tree * | softmax_tree | “界門綱目科屬種”樹,分詞樹,trie樹 |
| size_t | workspace_size |
然后 layer.c 中實(shí)現(xiàn)了釋放“對(duì)象”(內(nèi)存)的函數(shù),此處不再贅述