当前位置:网站首页>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 cache avalanche, penetration, breakdown
- [combinatorics] generating function (use generating function to solve the number of solutions of indefinite equation)
- As soon as we enter "remote", we will never regret, and several people will be happy and several people will be sad| Community essay solicitation
- [combinatorics] generating function (generating function application scenario | using generating function to solve recursive equation)
- 2022-2028 global sepsis treatment drug industry research and trend analysis report
- How do microservices aggregate API documents? This wave of operation is too good
- Niuke monthly race 31 minus integer
- 分布式的任务分发框架-Gearman
- English grammar_ Adjective / adverb Level 3 - multiple expression
- [combinatorics] exponential generating function (properties of exponential generating function | exponential generating function solving multiple set arrangement)
猜你喜欢
[combinatorics] generating function (generating function application scenario | using generating function to solve recursive equation)
Micro service component sentinel console call
English语法_形容词/副词3级 - 倍数表达
win32:堆破坏的dump文件分析
English語法_名詞 - 分類
SQL injection -day16
What problems can cross-border e-commerce sellers solve with multi platform ERP management system
The number of incremental paths in the grid graph [dfs reverse path + memory dfs]
PHP MySQL inserts data
CTO and programmer were both sentenced for losing control of the crawler
随机推荐
How do microservices aggregate API documents? This wave of operation is too good
Computer graduation design PHP campus address book telephone number inquiry system
OpenSSL的SSL/BIO_get_fd
Win 11 major updates, new features love love.
Redis core technology and practice - learning notes (VIII) sentinel cluster: sentinel hung up
[Tongxin UOS] scanner device management driver installation
Module 9 operation
The second largest gay dating website in the world was exposed, and the status of programmers in 2022
BFS - topology sort
[linux]centos 7 reports an error when installing MySQL "no package MySQL server available" no package ZABBIX server MySQL available
SQL injection -day16
PHP MySQL create database
分布式的任务分发框架-Gearman
Kotlin的協程:上下文
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
[combinatorics] generating function (positive integer splitting | unordered | ordered | allowed repetition | not allowed repetition | unordered not repeated splitting | unordered repeated splitting)
Line by line explanation of yolox source code of anchor free series network (5) -- mosaic data enhancement and mathematical understanding
小程序 多tab 多swiper + 每个tab分页
Bloom filter [proposed by bloom in 1970; redis cache penetration solution]
PHP MySQL inserts data