mmClassification学习
课程
mim很好用,感觉需要更多地研究一下
流程
下载配置文件和模型
1mim download mmcls --config mobilenetblablabla --dest .
使用API
123456from mmcls.apis import init_model, inference_modelmodel = init_model('config.py', 'model.pth', device='cuda:0')result = inference_model(model, 'pic.jpg')from mmcls.apis import show_result_pyplotshow_result_pyplot(model, 'pic.jpg', result)
修改配置文件
12345678num_classes = 10load_from = 'model_path.pth'type = 'CustomDataset ...
CV小综述
课程
设计图像特征
可以看这篇文章和这篇文章:
方向梯度直方图Histogram of Oriented Gradients/HOG,局部统计像素梯度的方向分布,将物体映射为低维特征向量,简化数据表达。
Dense grid descriptor (HOG, LBP) => Coding: local coordinate, super-vector => Pooling, SPM => Linear SVM
深度学习
用于解决此前难以进行的特征提取
卷积
多头注意力:实现一步特征提取
ResNet
有效性猜想
等同于多模型集成:路径之间的复杂组合,每种组合都视为一个新模型
Loss Surface更加平滑,图很好玩(Visualizing the Loss Landscape of Neural Nets)
改良
ResNet B/C/D:残差模块基部改进
ResNeXt:分组卷积(将通道拆解成两部分,分别进行卷积,再将结果堆叠),降低参数量
SEResNet:通道维度引入注意力机制
某些情况下分组卷积效果更好,可能是由于增强了通道之间 ...
Mechanism: Address Translation
Mechanism: Address Translation
CPU: limited direct execution (LDE)
In virtualizing memory, we will pursue efficiency and control.
CRUX: How to efficiently and flexibly virtualize memory?
Technique: hardware-based address translation / address translation, changing the virtual address provided by the instruction to a physical address.
Interposition is powerful: On of the usual benefits of such an approach is transparency.
Dynamic (Hardware-based) Relocation
base and bounds / dynamic relocation:
...
Interlude: Memory API
Interlude: Memory API
CRUX: How to allocate and manage memory in UNIX/C programs?
Types of Memory
stack memory: allocations and deallocations are managed implicitly by the compiler. For this reason it is sometimes called automatic memory.
Declaring memory on the stack in C is easy. For example, let’s say you need some space in function func() for an integer, called x. To declare such a piece of memory, you just do something like this:
123void func() { int x;}
The compiler does the res ...
The Abstraction: Address Spaces
The Abstraction: Address Spaces
Early Systems
From the perspective of memory, early machine didn’t provide much of an abstraction to users. The OS was a set of routines (a library, really) that sat in memory (starting at physical address 0, for example), and there would be one running program (a process) that currently sat in physical memory and used the rest of memory.
Multiprogramming and Time Sharing
multiprogramming: multiple processes were ready to run at a given time, and the OS would swit ...
Scheduling: Proportional Share
Operating Systems: Three Easy Pieces
We will examine a different type of scheduler known as a proportional-share scheduler, also sometimes referred to as a fair-share scheduler.
An early example of proportional-share scheduling is known as lottery scheduling. The crux is how can we design a scheduler to share the CPU in a proportional manner?
Basic Concept: Tickets Represent Your Share
tickets: used to represent the share of a resource that a process (or user) should receive.
Lottery allocate ...
Scheduling: The Multi-Level Feedback Queue
Scheduling: Introduction
Workload Assumptions
A number of simplifying simplifying assumptions about the process running in the system, sometimes collectively called the workload. We will make the following assumptions about the processes, sometimes called jobs, that are running in the system:
Each job runs for the same amount of time.
All jobs arrive at the same time.
Once started, each job runs to completion.
All jobs only use the CPU.
The run-time of each job is known.
Scheduling Metrics
Tur ...
Mechanism: Limited Direct Execution
Mechanism: Limited Direct Execution
A few challenges:
Performance
Control
Basic Technique: Limited Direct Execution
OS:
Create entry for process list.
Allocate memory for program.
Load program into memory.
Set up stack with argc/argv.
Clear registers. Execute call main().
Program:
Run main().
Execute return from main.
OS:
Free memory of process.
Remove from process list.
Problem #1: Restricted Operations
What if the process wishes to perform some kind of restricted operation, such a ...
Operating Systems: Process API
Interlude: Process API
The fork System Call
123456789101112131415161718192021#include <stdio.h>#include <stdlib.h>#include <unistd.h>int main(int argc, char *argvp[]) { printf("hello world (pid:%d)\n", (int) getpid()); int rc = fork(); if (rc < 0) { // fork failed fprintf(stderr, "fork failed\n"); exit(1); } else if (rc == 0) { // child (new process) printf("hello, I am child (pid:%d)", (int) getpid()); ...
Operating Systems: The Process
Operating Systems: Three Easy Pieces
The Abstraction: The Process
One of the most fundamental abstractions that the OS provides to users: the process (a running program).
The OS creates the illusion of nearly-endless supply of CPUs by virtualizing the CPU.
The basic technique, known as time sharing (分时) of the CPU, allows users to run many concurrent processes.
To implement virtualization of the CPU, and to implement it well, the OS will need both some low-level machinery and some high-level i ...