当前位置:网站首页>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
...
};
待续...
边栏推荐
- How to build programming ideas and improve programming ideas
- Cholesterol-PEG-FITC,Fluorescein-PEG-CLS,胆固醇-聚乙二醇-荧光素水溶性
- 『独家』互联网 BAT 大厂 Android高级工程师面试题:174道题目让你做到面试无忧
- 算法---跳跃游戏(Kotlin)
- MySQL数据库基础_常用数据类型_表设计
- Some time function records commonly used in mysql
- [Central Task Scheduling System - Communication Development]
- darknet 结构体汇总
- 2. 类与对象——封装
- 7 天找个 Go 工作,Gopher 要学的条件语句,循环语句 ,第3篇
猜你喜欢

Qihua stores the future and interprets the origin of distributed

4. 继承

SAP Product Enhancement Technology Review

The ceiling-level microservice boss summed up this 451-page note to tell you that microservices should be learned this way

数据库内核面试中我不会的问题(4)

SAP 产品增强技术回顾

使用.NET简单实现一个Redis的高性能克隆版(七-完结)

运动健康服务场景事件订阅,让应用推送“更懂用户”

LeetCode·每日一题·1417.重新格式化字符串·模拟

本地开发好的 SAP UI5 应用部署到 ABAP 服务器时,中文字符变成乱码的原因分析和解决方案
随机推荐
VMWare中安装的win10,新增其他盘符,如:E盘,F盘等
困扰所有SAP顾问多年的问题终于解决了
rem如何使用
1元限时秒杀 | 接口抓包分析与Mock实战训练营
漫画手绘之临摹篇
Neuropathic pain classification picture Daquan, neuropathic pain classification
神经网络可视化有3D版本了,美到沦陷!(已开源)
CCF大会腾源会专场即将召开,聚焦基础软件与开发语言未来发展
Simple implementation of a high-performance clone of Redis using .NET (seven-end)
阿里内网疯传的P8“顶级”分布式架构手册被我拿到了
爆料!前华为微服务专家纯手打500页落地架构实战笔记,已开源
&gt; 家乡旅游景点网页作业制作 网页代码运用了DIV盒子的使用方法,如盒子的嵌套、浮动、margin、border、backgro
Install nodejs
【学习笔记】尚未用过的图论知识
MySQL表sql语句增删查改_查询
AcWing 273. 分级(线性DP+结论)
Revelations!The former Huawei microservice expert wrote 500 pages of practical notes on the landing architecture, which has been open sourced
BAT "exclusive" Internet giant Android senior engineer interview questions: 174 questions allow you to do the interview
09什么是继承
【Mysql系列】04_事务