当前位置:网站首页>Reappearance of ASPP (atlas spatial pyramid pooling) code
Reappearance of ASPP (atlas spatial pyramid pooling) code
2022-07-03 18:21:00 【ZRX_ GIS】
import torch
import torch.nn as nn
import torch.nn.functional as F
class ASPP(nn.Module):
def __init__(self, in_channels, out_channels):
super(ASPP, self).__init__()
dilations = [1, 6, 12, 18]
self.layer1 = nn.Sequential(
nn.Conv2d(in_channels, out_channels, kernel_size=1, stride=1,
padding=0, dilation=dilations[0], bias=False),
nn.BatchNorm2d(out_channels), nn.ReLU()
)
self.layer2 = nn.Sequential(
nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1,
padding=dilations[1], dilation=dilations[1], bias=False),
nn.BatchNorm2d(out_channels), nn.ReLU()
)
self.layer3 = nn.Sequential(
nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1,
padding=dilations[2], dilation=dilations[2], bias=False),
nn.BatchNorm2d(out_channels), nn.ReLU()
)
self.layer4 = nn.Sequential(
nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1,
padding=dilations[3], dilation=dilations[3], bias=False),
nn.BatchNorm2d(out_channels), nn.ReLU()
)
self.layer5 = nn.Sequential(
nn.AdaptiveAvgPool2d((1, 1)),
nn.Conv2d(2048, 256, 1, stride=1, bias=False),
nn.BatchNorm2d(256),
nn.ReLU()
)
self.conv = nn.Conv2d(1280,256,1,bias=False)
self.batch_nor = nn.BatchNorm2d(256)
def forward(self,x):
x1 = self.layer1(x)
x2 = self.layer2(x)
x3 = self.layer3(x)
x4 = self.layer4(x)
x5 = self.layer5(x)
x5 = F.interpolate(x5,size=x1.size()[2:],mode='nilinear',align_corners=True)
x = torch.cat((x1,x2,x3,x4,x5),dim=1)
return x
边栏推荐
- Redis on local access server
- Fedora 21 installs lamp host server
- A. Berland Poker &1000【简单数学思维】
- The second largest gay dating website in the world was exposed, and the status of programmers in 2022
- Line by line explanation of yolox source code of anchor free series network (6) -- mixup data enhancement
- Computer graduation design PHP campus address book telephone number inquiry system
- Redis core technology and practice - learning notes (IX): slicing cluster
- Win 11 major updates, new features love love.
- 统计图像中各像素值的数量
- 2022-2028 global plasmid DNA cdmo industry research and trend analysis report
猜你喜欢

基于人脸识别的课堂考勤系统 tkinter+openpyxl+face_recognition

Classroom attendance system based on face recognition tkinter+openpyxl+face_ recognition

How do microservices aggregate API documents? This wave of operation is too good

What London Silver Trading software supports multiple languages

(9) Opencv Canny edge detection

English grammar_ Noun classification

Should I be laid off at the age of 40? IBM is suspected of age discrimination, calling its old employees "dinosaurs" and planning to dismiss, but the employees can't refute it
![Golang string (string) and byte array ([]byte) are converted to each other](/img/41/20f445ef9de4adf2a2aa97828cb67f.jpg)
Golang string (string) and byte array ([]byte) are converted to each other

Win 11 major updates, new features love love.

PHP MySQL create database
随机推荐
This diversion
Have you learned the correct expression posture of programmers on Valentine's day?
4. Load balancing and dynamic static separation
Enterprise custom form engine solution (12) -- form rule engine 2
Administrative division code acquisition
Life perception 1
PHP MySQL inserts data
(8) HS corner detection
Theoretical description of linear equations and summary of methods for solving linear equations by eigen
Computer graduation design PHP campus address book telephone number inquiry system
Computer graduation design PHP sports goods online sales system website
win32:堆破壞的dump文件分析
A. Odd Selection【BruteForce】
Win32: dump file analysis of heap corruption
[linux]centos 7 reports an error when installing MySQL "no package MySQL server available" no package ZABBIX server MySQL available
Solve the problem of inaccurate network traffic monitored by ZABBIX with SNMP
Three gradient descent methods and code implementation
Keepalived setting does not preempt resources
PHP MySQL inserts multiple pieces of data
小程序 多tab 多swiper + 每个tab分页