当前位置:网站首页>Summary of darknet structures
Summary of darknet structures
2022-08-11 11:00:00 【Mr.Q】
目录
这里对darknetSummarize the structures used.
1. list.h文件
1.1 node
// cfg文件每一个[xxx]代表一个片区(section),通常表示的是一个 层(layer)
// 链表中的每个node,都是一个section.
// 双向链表的节点定义
typedef struct node{
void *val; // 存放的是指向实际值的指针.
struct node *next; // 指向当前节点的下一节点
struct node *prev; // 指向当前节点的上一节点
} node;
1.2 list
// 网络配置双向链表,存储cfg网络配置文件.
// // 双向链表
typedef struct list{
int size; // 配置文件的节点数,即section个数,通常就是layer层数
node *front; // 头指针,指针链表第一个节点
node *back; // 尾指针,指针链表最后一个节点
} list;2. parser.c文件
2.1 section
typedef struct{
char *type; // 字符串
list *options; // 双向链表
}section;一个section结构体变量,Corresponds to a network layer configuration.
(1) type可能的值:[net], [maxpool], [convolutional], [avgpool], [softmax]等等;
(2) options:双向链表,利用尾插法,Insert the properties after the square brackets one by one;
例如.*.cfg配置文件内容如下.
[net]
batch=128
subdivisions=1
height=28
width=28
channels=3
max_crop=32
min_crop=32
hue=.1
saturation=.75
exposure=.75
learning_rate=0.1
policy=poly
power=4
max_batches = 5000
momentum=0.9
decay=0.0005
[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=16
size=1
stride=1
pad=1
activation=leaky
correspondingly obtained,The doubly linked list stores the following contents,网状结构.

2.2 size_params
typedef struct size_params{
int batch;
int inputs; // h*w*c
int h;
int w;
int c;
int index;
int time_steps;
int train; // 为0,则Inference only,为1,Inference & Training
network net;
} size_params;3. option_list.h
3.1 kvp
kvpStructure variables store key-value pairs,比如网络层convolutional有属性batch_normlize=1, filters=2.
/// <summary>
/// 存放属性,比如filter=3.
/// </summary>
typedef struct{
char *key; // filter
char *val; // 3
int used; // 0代表未被使用
} kvp;4. darknet.h
4.1 network
net网络
typedef struct network {
int n; // The number of layers in the network
int batch; // 批次大小
uint64_t *seen; // How many images have already been processed
float epoch; // 迭代大小
int subdivisions; // subdivision,对batch size进行进一步的划分,In order to facilitate some small memoryGPUcan also run programs.
layer *layers; // Definition of each layer,layer结构体指针.
float *output; // 输出
learning_rate_policy policy; // 学习率更新策略,枚举类型,包括CONSTANT, STEP, EXP, POLY, STEPS, SIG, RANDOM, SGDR
float learning_rate; // 学习率
float learning_rate_min;
float learning_rate_max;
int batches_per_cycle;
int batches_cycle_mult;
float momentum; // 动量大小
float decay; // 衰减系数
...
} network;4.2 layer
layer网络层
// layer.h
struct layer {
LAYER_TYPE type; // 网络层的名称,枚举类型,比如CONVOLUTIONAL、 MAXPOOL
ACTIVATION activation; // 激活函数名称,枚举类型,比如RELU, RELU6, RELIE, LINEAR
ACTIVATION lstm_activation; // 激活函数名称,枚举类型
COST_TYPE cost_type; // 损失函数名称,枚举类型,包含SSE, MASKED, L1, SEG, SMOOTH,WGAN
// 定义函数指针
void(*forward) (struct layer, struct network_state); // 前向传播
void(*backward) (struct layer, struct network_state); // 反向传播
void(*update) (struct layer, int, float, float, float); // 更新函数
void(*forward_gpu) (struct layer, struct network_state);
void(*backward_gpu) (struct layer, struct network_state);
void(*update_gpu) (struct layer, int, float, float, float, float);
layer *share_layer; // 结构体指针,指向layer结构体变量
int train; // 标志符,1表示训练.
int avgpool; // 标志符, ?
int batch_normalize; // 标志符, ?
int shortcut; // 标志符, ?
int batch; // batch size
int dynamic_minibatch; // ?
int forced;
int flipped;
int inputs; // 输入图片(特征)的元素个数?
int outputs; // 输入图片(特征)的元素个数?
float mean_alpha;
int nweights; // The number of elements in the weight matrix,即nThe number of all elements of a multi-channel convolution kernel
int nbiases; // The number of bias term elements,对于卷积层,The number of offset items==卷积核个数,对于全连接层,The number of offset items==神经元个数
int extra;
int truths;
int h, w, c; // The scale of the feature map.
int out_h, out_w, out_c; // The scale of the output feature map
int n; // 卷积核个数
int max_boxes;
int truth_size;
int groups; // 组数,默认是1,Packet convolution technique.
int group_id;
int size; // 卷积核的长宽,默认长宽相等.
int side;
int stride; // 步长
int stride_x; // x方向的步长
int stride_y;
int dilation; // 空洞卷积参数,默认是1
...
};
待续...
边栏推荐
- form-making notes on climbing pits (jeecg project replaces form designer)
- The crawler is encapsulated into an api
- openresty概述及Lua语言的嵌入
- ID3v2 Library以便能够设置
- 不可思议,全靠这份Android面试题,斩获多家互联网大厂offer
- 宝塔一键部署WordPress(含宝塔添加站点、阿里云安全组配置、阿里云子域名解析)
- 你必须懂的一些MySQL索引技巧
- form-making爬坑笔记(jeecg项目替换表单设计器)
- 大疆2022秋招笔试 —— 最小时间差、数组的最小偏移量
- 如何建立编程思想和提高编程思想
猜你喜欢
![Use Function Compute to package and download OSS files [Encounter Pit Collection]](/img/07/b5f9dc7272e12dbd07d559e79157f9.png)
Use Function Compute to package and download OSS files [Encounter Pit Collection]

悠漓带你玩转C语言(详解操作符1)

虚拟机使用 WinSCP & Putty

openresty概述及Lua语言的嵌入

1. 类与对象——什么是对象

SAP 产品增强技术回顾

Qihua stores the future and interprets the origin of distributed

Database indexes and their underlying data structures

放苹果

Analyzes how Flink task than YARN container memory limit
随机推荐
沃土云创计划重磅来袭
6.1 总线的概念和结构形态
为什么有些人不喜欢出身底层的人?
mysql常用的一些时间函数记录
突破次元壁垒,让身边的玩偶手办在屏幕上动起来!
a-upload上传图片去掉预览icon
【Study Notes】Unused graph theory knowledge
C# Call AutoNavi Map API to obtain latitude, longitude and positioning [Detailed 4D explanation with complete code]
不可思议,全靠这份Android面试题,斩获多家互联网大厂offer
【Mask2Former】 解决代码中一些问题
【Mysql系列】03_系统设计
servlet——servlet介绍 | 发布动态资源
chrome is set to dark mode (including the entire webpage)
MySQL数据库基础_常用数据类型_表设计
【每日一题】640. 求解方程
CCF大会腾源会专场即将召开,聚焦基础软件与开发语言未来发展
Getting Started with Chrome Plug-in Development - Nanny Level Raiders
如何建立编程思想和提高编程思想
Simple implementation of a high-performance clone of Redis using .NET (seven-end)
字符函数和字符串函数的进阶