91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)

資源截圖

代碼片段和文件信息

import?torch
import?numpy?as?np
from?torch?import?nn?optim?unsqueeze
from?torch.autograd?import?Variable
from?torch.utils.data?import?DatasetDataLoader
import?pandas?as?pd
from?torchvision?import?datasets?transforms


#?圖像增強
train_trainsform?=?transforms.Compose([
transforms.Scale(40)
transforms.RandomHorizontalFlip()
transforms.RandomCrop(32)
transforms.ToTensor()
transforms.Normalize([0.50.50.5]?[0.50.50.5])
])

test_transform?=?transforms.Compose([
transforms.ToTensor()
transforms.Normalize([0.50.50.5]?[0.50.50.5])
])

def?conv3x3(in_planes?out_planes?stride?=?1):
‘‘‘
3X3?convolution?with?padding
‘‘‘
return?nn.Conv2d(
in_planes
out_planes
kernel_size?=?3
stride?=?stride
padding?=?1
bias?=?False)

class?BasicBlock(nn.Module):

def?__init__(self?in_planes?out_planes?
stride?=?1?downsample?=?None):
super(BasicBlock?self).__init__()
self.conv1?=?conv3x3(in_planes?out_planesstride)
self.bn1?=?nn.BatchNorm2d(out_planes)
self.relu?=?nn.ReLU(in_planes?=?True)
self.conv2?=?conv3x3(out_planes?out_planes)
self.bn2?=?nn.BatchNorm2d(out_planes)
self.downsample?=?downsample
self.stride?=?stride

def?forward(self?x):
residual?=?x

out?=?self.conv1(x)
out?=?self.bn1(out)
out?=?self.relu(out)

out?=?self.conv2(out)
out?=?self.bn2(out)

if?self.downsample?is?not?None:
residual?=?self.downsample(x)

out?+=?residual
out?=?self.relu(out)

return?out

#?定義ResNet網絡
class?ResNet(nn.Module):
def?__init__(self?block?layers?num_classes?=?10):
super(ResNet?self).__init__()
self.in_channels?=?16
self.conv?=?conv3x3(3?16)
self.bn?=?nn.BatchNorm2d(16)
self.relu?=?nn.ReLU(inplace?=?True)
self.layer1?=?self.make_layer(block?16?layers[0])
self.layer2?=?self.make_layer(block?32?layers[0]?2)
self.layer3?=?self.make_layer(block?64?layers[1]?2)
self.avg_pool?=?nn.AvgPool2d(8)
self.fc?=?nn.Linear(64?num_classes)


def?make_layer(self?block?out_channels?blocks?stride?=?1)
downsample?=?None
if?(stride?!=?1)?or?(self.in_channels?!=?out_channels):
downsample?=?nn.Sequential(
conv3x3(self.in_channels?out_channels?stride?=?stride)
nn.BatchNorm2d(out_channels)

layers?=?[]
layers.append(block(self.in_channelsout_channels?stride?downsample))
self.in_channels?=?out_channels

for?i?in?range(1?blocks):
layers.append(block(out_channels?out_channels))
renturn?nn.Sequential(*layers)

def?forward(self?x):
out?=?self.conv(x)
out?=?self.bn(out)
out?=?self.relu(out)
out?=?self.layer1(out)
out?=?self.layer2(out)
out?=?self.layer3(out)
out?=?self.avg_pool(out)
out?=?out.view(out.size(0)?-1)
out?=?self.fc(out)
return?out



?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-04-27?22:53??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\
?????目錄???????????0??2019-04-27?22:52??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\
?????目錄???????????0??2019-04-24?17:11??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\cifar10\
?????文件????????2853??2019-04-24?17:11??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\cifar10\ResNet.py
?????目錄???????????0??2019-04-24?16:58??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\CNN\
?????文件????????2396??2019-04-24?10:11??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\CNN\AlexNet.py
?????文件????????1915??2019-04-24?16:51??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\CNN\GoogLeNet.py
?????文件????????1021??2019-04-24?16:51??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\CNN\leNet.py
?????文件????????1468??2019-04-24?16:58??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\CNN\ResNet.py
?????文件????????3082??2019-04-24?16:51??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\CNN\SimpleCNN.py
?????文件????????1642??2019-04-24?16:52??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\CNN\VGG.py
?????目錄???????????0??2019-04-27?22:52??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\GAN\
?????文件????????1872??2019-04-27?00:29??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\GAN\auto_encoder.py
?????文件????????1903??2019-04-27?16:33??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\GAN\CNNGAN.py
?????文件????????2538??2019-04-27?11:49??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\GAN\GANsample.py
?????文件????????1569??2019-04-27?11:21??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\GAN\VAE_encode.py
?????目錄???????????0??2019-04-24?19:51??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\mini\
?????文件????????1382??2019-04-24?16:51??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\mini\CNNnet.py
?????文件?????????930??2019-04-24?19:51??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\mini\LSTM.py
?????文件????????2129??2019-04-22?11:47??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\mini\mini.py
?????文件????????1511??2019-04-22?10:44??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\mini\net.py
?????目錄???????????0??2019-04-27?22:50??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\NN\
?????文件????????2137??2019-04-21?19:41??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\NN\linear.py
?????目錄???????????0??2019-04-24?16:51??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\NN\LogisticRegression\
?????文件????????3875??2019-04-21?19:36??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\NN\LogisticRegression\data.txt
?????文件????????1795??2019-04-24?16:51??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\NN\LogisticRegression\LogisticRegression.py
?????文件????????2126??2019-04-21?22:21??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\NN\poly_model.py
?????目錄???????????0??2019-04-27?22:49??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\pytorch_Basics\
?????文件????????1123??2019-04-21?08:41??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\pytorch_Basics\test.py
?????目錄???????????0??2019-04-27?22:51??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\RNN\
?????文件????????2846??2019-04-26?17:45??深度學習入門之PyTorch-廖星宇(高清pdf及源碼文件)\code\RNN\CharLSTM.py
............此處省略10個文件信息

評論

共有 條評論