Inception-Resnet-v1、Inception-Resnet-v2学习笔记

news2024/10/6 6:48:55

 Inception-Resnet-v1、Inception-Resnet-v2来自2016年谷歌发表的这篇论文:Inception-v4 Inception-ResNet and the Impact of Residual Connections on Learning,附论文链接:

[1602.07261] Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning (arxiv.org)

https://arxiv.org/pdf/1602.07261.pdf (下载)

        这篇文章提出了Inception-V4、Inception-ResNet-V1、Inception-ResNet-V2三个模型。         Inception-V4在Inception-V3的基础上进一步改进了Inception模块,提升了模型性能和计算效率,但没有使用残差模块, Inception-ResNet将Inception模块和深度残差网络ResNet结合,提出了三种包含残差连接的Inception模块,残差连接显著加快了训练收敛速度。经过模型集成和图像多尺度裁剪处理后,模型Top-5错误率降低至3.1%。

        ① Inception-ResNet-V1网络结构(整体结构v1和v2相同,主要区别在于通道数):

相较于原始Inception模块,Inception-Resnet-v1进行了改进:

        上图是 Inception 架构初始版本 。

Inception初始版本

优点:

  1. 增加了网络的宽度
  2. 增加了网络对尺度的适应性
  3. 加入池化操作,减少空间大小,减少过拟合
  4. 每个卷积层后跟ReLU,增加了非线性特征

缺点:所有卷积都在上一层的所有输出上做,造成5×5卷积之后特征图厚度过大。

改进:3×3和5×5卷积层前以及池化层后加入1×1卷积降维。

        上图是 Inception-Resnet-v1中的Inception架构改良版本 

        来看看 Inception-Resnet-v1的具体结构吧。


        stride 2 代表步长为2 ,V 是TF中的padding="Valid" == pytorch中的padding=0 ,没有标 V 是TF中的padding="Same" == pytorch中的padding=1 with zero padding(用0填充)。 

        需要注意的是,文中Conv s=2的padding为1;s=1的padding为0。

        此外,我对图中结构进行了计算,经过不对称卷积(如IR-B模块,经过1X7,7X1的卷积按照原文特征图的大小会发生变化,但输出的结果表明这里的特征图大小并没有发生变化),它的H和W仍然不变,这里是因为它添加了0,保证特征图的大小不发生变化。

Reduction-A结构 


        ② Inception-ResNet-V2网络结构(整体结构v1和v2相同,主要区别在于通道数):

               这三个网络中的参数略有不同: 

 Inception-ResNet-v2网络的35×35→17×17和17×17→8×8图缩减模块A、B:

 Inception-ResNet-v2网络的Reduction-A、B

        Inception-ResNet v1 的计算成本和 Inception v3 的接近;Inception-ResNetv2 的计算成本和 Inception v4 的接近。它们有不同的 stem,两个网络都有模块 A、B、C 和缩减块结构。唯一的不同在于超参数设置。

 ③ 代码实现:

(1)Inception-Resnet-v1:

# 先定义3X3的卷积,用于代码复用
class conv3x3(nn.Module):
    def __init__(self, in_planes, out_channels, stride=1, padding=0):
        super(conv3x3, self).__init__()
        self.conv3x3 = nn.Sequential(
             nn.Conv2d(in_planes, out_channels, kernel_size=3, stride=stride, padding=padding),#卷积核为3x3
             nn.BatchNorm2d(out_channels),#BN层,防止过拟合以及梯度爆炸
             nn.ReLU()#激活函数
        )
        
    def forward(self, input):
        return self.conv3x3(input)
        
class conv1x1(nn.Module):
    def __init__(self, in_planes, out_channels, stride=1, padding=0):
        super(conv1x1, self).__init__()
        self.conv1x1 = nn.Sequential(
             nn.Conv2d(in_planes, out_channels, kernel_size=1, stride=stride, padding=padding),#卷积核为1x1
             nn.BatchNorm2d(out_channels),
             nn.ReLU()
        )

    def forward(self, input):
        return self.conv1x1(input)

Stem模块:输入299*299*3,输出35*35*256.    

class StemV1(nn.Module):
    def __init__(self, in_planes):
        super(StemV1, self).__init__()

        self.conv1 = conv3x3(in_planes =in_planes,out_channels=32,stride=2, padding=0)
        self.conv2 = conv3x3(in_planes=32, out_channels=32,  stride=1, padding=0)
        self.conv3 = conv3x3(in_planes=32, out_channels=64, stride=1, padding=1)
        self.maxpool = nn.MaxPool2d(kernel_size=3,  stride=2, padding=0)
        self.conv4 = conv3x3(in_planes=64, out_channels=64,  stride=1, padding=1)
        self.conv5 = conv1x1(in_planes =64,out_channels=80,  stride=1, padding=0)
        self.conv6 = conv3x3(in_planes=80, out_channels=192, stride=1, padding=0)
        self.conv7 = conv3x3(in_planes=192, out_channels=256,  stride=2, padding=0)

    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        x = self.conv3(x)
        x = self.maxpool(x)
        x = self.conv4(x)
        x = self.conv5(x)
        x = self.conv6(x)
        x = self.conv7(x)

        return x

IR-A模块*5:输入35*35*256,输出35*35*256.     

class Inception_ResNet_A(nn.Module):
    def __init__(self, input ):
        super(Inception_ResNet_A, self).__init__()
        self.conv1 = conv1x1(in_planes =input,out_channels=32,stride=1, padding=0)
        self.conv2 = conv3x3(in_planes=32, out_channels=32, stride=1, padding=1)
        self.line =  nn.Conv2d(96, 256, 1, stride=1, padding=0, bias=True)

        self.relu = nn.ReLU()

    def forward(self, x):

        c1 = self.conv1(x)
        # print("c1",c1.shape)
        c2 = self.conv1(x)
        # print("c2", c2.shape)
        c3 = self.conv1(x)
        # print("c3", c3.shape)
        c2_1 = self.conv2(c2)
        # print("c2_1", c2_1.shape)
        c3_1 = self.conv2(c3)
        # print("c3_1", c3_1.shape)
        c3_2 = self.conv2(c3_1)
        # print("c3_2", c3_2.shape)
        cat = torch.cat([c1, c2_1, c3_2],dim=1)#torch.Size([4, 96, 15, 15])
        # print("x",x.shape)

        line = self.line(cat)
        # print("line",line.shape)
        out =x+line
        out = self.relu(out)

        return out

Reduction-A模块:输入35*35*256,输出17*17*896.    

class Reduction_A(nn.Module):
    def __init__(self, input,n=384,k=192,l=224,m=256):
        super(Reduction_A, self).__init__()
        self.maxpool = nn.MaxPool2d(kernel_size=3,  stride=2, padding=0)
        self.conv1 = conv3x3(in_planes=input, out_channels=n,stride=2,padding=0)
        self.conv2 = conv1x1(in_planes=input, out_channels=k,padding=1)
        self.conv3 = conv3x3(in_planes=k,  out_channels=l,padding=0)
        self.conv4 = conv3x3(in_planes=l,  out_channels=m,stride=2,padding=0)

    def forward(self, x):

        c1 = self.maxpool(x)
        # print("c1",c1.shape)
        c2 = self.conv1(x)
        # print("c2", c2.shape)
        c3 = self.conv2(x)
        # print("c3", c3.shape)
        c3_1 = self.conv3(c3)
        # print("c3_1", c3_1.shape)
        c3_2 = self.conv4(c3_1)
        # print("c3_2", c3_2.shape)
        cat = torch.cat([c1, c2,c3_2], dim=1)

        return cat

IR-B模块*10:输入17*17*896,输出17*17*896.    

class Inception_ResNet_B(nn.Module):
    def __init__(self, input):
        super(Inception_ResNet_B, self).__init__()
        self.conv1 = conv1x1(in_planes =input,out_channels=128,stride=1, padding=0)
        self.conv1x7 = nn.Conv2d(in_channels=128,out_channels=128,kernel_size=(1,7), padding=(0,3))
        self.conv7x1 = nn.Conv2d(in_channels=128, out_channels=128,kernel_size=(7,1), padding=(3,0))
        self.line = nn.Conv2d(256, 896, 1, stride=1, padding=0, bias=True)

        self.relu = nn.ReLU()

    def forward(self, x):

        c1 = self.conv1(x)
        # print("c1",c1.shape)
        c2 = self.conv1(x)
        # print("c2", c2.shape)
        c2_1 = self.conv1x7(c2)
        # print("c2_1", c2_1.shape)

        c2_1 = self.relu(c2_1)

        c2_2 = self.conv7x1(c2_1)
        # print("c2_2", c2_2.shape)

        c2_2 = self.relu(c2_2)

        cat = torch.cat([c1, c2_2], dim=1)
        line = self.line(cat)
        out =x+line

        out = self.relu(out)
        # print("out", out.shape)
        return out


Reduction-B模块:输入17*17*896,输出8*8*1792.    

class Reduction_B(nn.Module):
    def __init__(self, input):
        super(Reduction_B, self).__init__()
        self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
        self.conv1 = conv1x1(in_planes=input,  out_channels=256, padding=1)
        self.conv2 = conv3x3(in_planes=256,  out_channels=384, stride=2, padding=0)
        self.conv3 = conv3x3(in_planes=256,  out_channels=256,stride=2, padding=0)
        self.conv4 = conv3x3(in_planes=256,  out_channels=256,  padding=1)
        self.conv5 = conv3x3(in_planes=256,  out_channels=256, stride=2, padding=0)
    def forward(self, x):
        c1 = self.maxpool(x)
        # print("c1", c1.shape)
        c2 = self.conv1(x)
        # print("c2", c2.shape)
        c3 = self.conv1(x)
        # print("c3", c3.shape)
        c4 = self.conv1(x)
        # print("c4", c4.shape)
        c2_1 = self.conv2(c2)
        # print("cc2_1", c2_1.shape)
        c3_1 = self.conv3(c3)
        # print("c3_1", c3_1.shape)
        c4_1 = self.conv4(c4)
        # print("c4_1", c4_1.shape)
        c4_2 = self.conv5(c4_1)
        # print("c4_2", c4_2.shape)
        cat = torch.cat([c1, c2_1, c3_1,c4_2], dim=1)
        # print("cat", cat.shape)
        return cat

IR-C模块*5:输入8*8*1792,输出8*8*1792.    

class Inception_ResNet_C(nn.Module):
    def __init__(self, input):
        super(Inception_ResNet_C, self).__init__()
        self.conv1 = conv1x1(in_planes=input, out_channels=192, stride=1, padding=0)
        self.conv1x3 = nn.Conv2d(in_channels=192, out_channels=192, kernel_size=(1, 3), padding=(0,1))
        self.conv3x1 = nn.Conv2d(in_channels=192, out_channels=192, kernel_size=(3, 1), padding=(1,0))
        self.line = nn.Conv2d(384, 1792, 1, stride=1, padding=0, bias=True)

        self.relu = nn.ReLU()

    def forward(self, x):
        c1 = self.conv1(x)
        # print("x", x.shape)
        # print("c1",c1.shape)
        c2 = self.conv1(x)
        # print("c2", c2.shape)
        c2_1 = self.conv1x3(c2)
        # print("c2_1", c2_1.shape)

        c2_1 = self.relu(c2_1)
        c2_2 = self.conv3x1(c2_1)
        # print("c2_2", c2_2.shape)

        c2_2 = self.relu(c2_2)
        cat = torch.cat([c1, c2_2], dim=1)
        # print("cat", cat.shape)
        line = self.line(cat)
        out = x+ line
        # print("out", out.shape)
        out = self.relu(out)

        return out


class Inception_ResNet(nn.Module):
    def __init__(self,classes=2):
        super(Inception_ResNet, self).__init__()
        blocks = []
        blocks.append(StemV1(in_planes=3))
        for i in range(5):
            blocks.append(Inception_ResNet_A(input=256))
        blocks.append(Reduction_A(input=256))
        for i in range(10):
            blocks.append(Inception_ResNet_B(input=896))
        blocks.append(Reduction_B(input=896))
        for i in range(10):
            blocks.append(Inception_ResNet_C(input=1792))

        self.features = nn.Sequential(*blocks)

        self.avepool = nn.AvgPool2d(kernel_size=3)

        self.dropout = nn.Dropout(p=0.2)
        self.linear = nn.Linear(1792, classes)

    def forward(self,x):
        x = self.features(x)
        # print("x",x.shape)
        x = self.avepool(x)
        # print("avepool", x.shape)
        x = self.dropout(x)
        # print("dropout", x.shape)
        x = x.view(x.size(0), -1)
        x = self.linear(x)

        return  x

上述代码参考:基于PyTorch实现 Inception-ResNet-v1_NAND_LU的博客-CSDN博客 

 (2)Inception-Resnet-v2:

import torch
import torch.nn as nn
import torch.nn.functional as F

# 由于后面会经常用到,提前定义3×3卷积 和 1×1的卷积
class conv3x3(nn.Module):
    def __init__(self, in_planes, out_channels, stride=1, padding=0):
        super(conv3x3, self).__init__()
        self.conv3x3 = nn.Sequential(
            nn.Conv2d(in_planes, out_channels, kernel_size=3, stride=stride, padding=padding),  # 卷积核为3x3
            nn.BatchNorm2d(out_channels),  # BN层,防止过拟合以及梯度爆炸
            nn.ReLU()  # 激活函数
        )

    def forward(self, input):
        return self.conv3x3(input)

class conv1x1(nn.Module):
    def __init__(self, in_planes, out_channels, stride=1, padding=0):
        super(conv1x1, self).__init__()
        self.conv1x1 = nn.Sequential(
            nn.Conv2d(in_planes, out_channels, kernel_size=1, stride=stride, padding=padding),  # 卷积核为1x1
            nn.BatchNorm2d(out_channels),
            nn.ReLU()
        )

    def forward(self, input):
        return self.conv1x1(input)

stem模块:输入299*299*3,输出35*35*384. 

# 定义stem模块
class StemV2(nn.Module):
    def __init__(self, in_planes=3):
        super(StemV2, self).__init__()


        self.conv1 = conv3x3(in_planes =in_planes,out_channels=32,stride=2, padding=0)
        self.conv2 = conv3x3(in_planes=32, out_channels=32,  stride=1, padding=0)
        self.conv3 = conv3x3(in_planes=32, out_channels=64, stride=1, padding=1)
        self.maxpool1 = nn.MaxPool2d(kernel_size=3,  stride=2, padding=0)
        self.conv4 = conv3x3(in_planes=64, out_channels=96,  stride=2, padding=0)
        self.conv5 = conv1x1(in_planes=160, out_channels=64,  stride=1, padding=1)
        self.conv6 = conv3x3(in_planes=64, out_channels=96, stride=1, padding=0)
        self.conv7 = conv1x1(in_planes=160, out_channels=64,  stride=1, padding=1)
        self.conv8 = nn.Conv2d(in_channels=64, out_channels=64, stride=1, kernel_size=(1, 7), padding=(0, 3))
        self.conv9 = nn.Conv2d(in_channels=64, out_channels=64, stride=1, kernel_size=(7, 1), padding=(3, 0))
        self.conv10 = conv3x3(in_planes=64, out_channels=96, stride=1, padding=0)
        self.conv11 = conv3x3(in_planes=192, out_channels=192, stride=2, padding=0)
        self.maxpool2 = nn.MaxPool2d(kernel_size=3, stride=2, padding=0)
        self.relu = nn.ReLU()

    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        x = self.conv3(x)
        x1 = self.maxpool1(x)
        x2 = self.conv4(x)
        x = torch.cat([x1, x2], dim=1)
        x1 = self.conv5(x)
        x1 = self.conv6(x1)
        x2 = self.conv7(x)
        x2 = self.conv8(x2)
        x2 = self.relu(x2)
        x2 = self.conv9(x2)
        x2 = self.relu(x2)
        x2 = self.conv10(x2)
        x = torch.cat([x1, x2], dim=1)
        x1 = self.conv11(x)
        x2 = self.maxpool2(x)
        x = torch.cat([x1, x2], dim=1)


        return x

IR-A模块*5:输入35*35*384,输出35*35*256.  

# 定义IR-A模块
class Inception_ResNet_A(nn.Module):
    def __init__(self, input,  scale=0.3):
        super(Inception_ResNet_A, self).__init__()
        self.conv1 = conv1x1(in_planes =input,out_channels=32,stride=1, padding=0)

        self.conv2 = conv3x3(in_planes=32, out_channels=32, stride=1, padding=1)

        self.conv3 = conv3x3(in_planes=32, out_channels=48, stride=1, padding=1)
        self.conv4 = conv3x3(in_planes=48, out_channels=64, stride=1, padding=1)

        self.line =  nn.Conv2d(128, 384, 1, stride=1, padding=0, bias=True)
        self.scale = scale

        self.relu = nn.ReLU()

    def forward(self, x):

        c1 = self.conv1(x)
        # print("c1",c1.shape)
        c2 = self.conv1(x)
        # print("c2", c2.shape)
        c3 = self.conv1(x)
        # print("c3", c3.shape)
        c2_1 = self.conv2(c2)
        # print("c2_1", c2_1.shape)
        c3_1 = self.conv3(c3)
        # print("c3_1", c3_1.shape)
        c3_2 = self.conv4(c3_1)
        # print("c3_2", c3_2.shape)
        cat = torch.cat([c1, c2_1, c3_2],dim=1)#torch.Size([4, 96, 15, 15])
        # print("x",x.shape)

        line = self.line(cat)
        # print("line",line.shape)
        out = self.scale*x+line
        out = self.relu(out)

        return out

Reduction-A模块:输入35*35*256,输出17*17*896.   

# 定义Reduction-A模块
class Reduction_A(nn.Module):
    def __init__(self, input, n=384, k=256, l=256, m=384, scale=0.3):
        super(Reduction_A, self).__init__()
        self.maxpool = nn.MaxPool2d(kernel_size=3,  stride=2, padding=0)
        self.conv1 = conv3x3(in_planes=input, out_channels=n, stride=2,padding=0)
        self.conv2 = conv1x1(in_planes=input, out_channels=k, padding=1)
        self.conv3 = conv3x3(in_planes=k,  out_channels=l, padding=0)
        self.conv4 = conv3x3(in_planes=l,  out_channels=m, stride=2, padding=0)
        self.scale =scale
    def forward(self, x):

        c1 = self.maxpool(x)
        # print("c1",c1.shape)
        c2 = self.conv1(x)
        # print("c2", c2.shape)
        c3 = self.conv2(x)
        # print("c3", c3.shape)
        c3_1 = self.conv3(c3)
        # print("c3_1", c3_1.shape)
        c3_2 = self.conv4(c3_1)
        # print("c3_2", c3_2.shape)
        cat = torch.cat([c1, c2, c3_2], dim=1)

        return cat

IR-B模块*10:输入17*17*896,输出8*8*1792.   

# 定义IR-B模块
class Inception_ResNet_B(nn.Module):
    def __init__(self, input, scale=0.3):
        super(Inception_ResNet_B, self).__init__()
        self.conv1 = conv1x1(in_planes =input,out_channels=192,stride=0, padding=1)
        self.conv2 = conv1x1(in_planes =input,out_channels=128,stride=0, padding=1)

        self.conv1x7 = nn.Conv2d(in_channels=128,out_channels=160,kernel_size=(1,7), padding=(0,3))
        self.conv7x1 = nn.Conv2d(in_channels=160, out_channels=192,kernel_size=(7,1), padding=(3,0))
        self.line = nn.Conv2d(384, 1152, 1, stride=1, padding=0, bias=True)
        self.scale = scale

        self.relu = nn.ReLU()

    def forward(self, x):

        c1 = self.conv1(x)
        # print("c1",c1.shape)
        c2 = self.conv2(x)
        # print("c2", c2.shape)
        c2_1 = self.conv1x7(c2)
        # print("c2_1", c2_1.shape)

        c2_1 = self.relu(c2_1)

        c2_2 = self.conv7x1(c2_1)
        # print("c2_2", c2_2.shape)

        c2_2 = self.relu(c2_2)

        cat = torch.cat([c1, c2_2], dim=1)
        line = self.line(cat)
        out =self.scale*x+line

        out = self.relu(out)
        # print("out", out.shape)
        return out

Reduction-B模块:输入8*8*1792,输出8*8*1792.    

# 定义Reduction-B模块
class Reduction_B(nn.Module):
    def __init__(self, input):
        super(Reduction_B, self).__init__()
        self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=0)
        self.conv1 = conv1x1(in_planes=input,  out_channels=256, padding=1)
        self.conv2 = conv3x3(in_planes=256,  out_channels=288, stride=2, padding=0)
        self.conv3 = conv3x3(in_planes=256,  out_channels=288, stride=2, padding=0)
        self.conv4 = conv3x3(in_planes=256,  out_channels=288,  padding=1)
        self.conv5 = conv3x3(in_planes=288,  out_channels=320, stride=2, padding=0)
    def forward(self, x):
        c1 = self.maxpool(x)
        # print("c1", c1.shape)
        c2 = self.conv1(x)
        # print("c2", c2.shape)
        c3 = self.conv1(x)
        # print("c3", c3.shape)
        c4 = self.conv1(x)
        # print("c4", c4.shape)
        c2_1 = self.conv2(c2)
        # print("cc2_1", c2_1.shape)
        c3_1 = self.conv3(c3)
        # print("c3_1", c3_1.shape)
        c4_1 = self.conv4(c4)
        # print("c4_1", c4_1.shape)
        c4_2 = self.conv5(c4_1)
        # print("c4_2", c4_2.shape)
        cat = torch.cat([c1, c2_1, c3_1, c4_2], dim=1)
        # print("cat", cat.shape)
        return cat

IR-C模块*5:输入8*8*1792,输出8*8*1792.    

# 定义IR-C模块
class Inception_ResNet_C(nn.Module):
    def __init__(self, input, scale=0.3):
        super(Inception_ResNet_C, self).__init__()
        self.conv1 = conv1x1(in_planes=input, out_channels=192, stride=1, padding=0)
        self.conv1x3 = nn.Conv2d(in_channels=192, out_channels=224, kernel_size=(1, 3), padding=(0,1))
        self.conv3x1 = nn.Conv2d(in_channels=224, out_channels=256, kernel_size=(3, 1), padding=(1,0))
        self.line = nn.Conv2d(448, 2048, 1, stride=1, padding=0, bias=True)

        self.relu = nn.ReLU()
        self.scale = scale
    def forward(self, x):
        c1 = self.conv1(x)
        # print("x", x.shape)
        # print("c1",c1.shape)
        c2 = self.conv1(x)
        # print("c2", c2.shape)
        c2_1 = self.conv1x3(c2)
        # print("c2_1", c2_1.shape)

        c2_1 = self.relu(c2_1)
        c2_2 = self.conv3x1(c2_1)
        # print("c2_2", c2_2.shape)

        c2_2 = self.relu(c2_2)
        cat = torch.cat([c1, c2_2], dim=1)
        # print("cat", cat.shape)
        line = self.line(cat)
        out = self.scale*x+ line
        # print("out", out.shape)
        out = self.relu(out)

        return out
# IR v2
class Inception_ResNet_v2(nn.Module):
    def __init__(self, classes=2):
        super(Inception_ResNet_v2, self).__init__()
        blocks = []
        blocks.append(StemV2(in_planes=3))
        for _ in range(5):
            blocks.append(Inception_ResNet_A(input=384))
        blocks.append(Reduction_A(input=384))
        for _ in range(10):
            blocks.append(Inception_ResNet_B(input=1152))
        blocks.append(Reduction_B(input=1152))
        for _ in range(10):
            blocks.append(Inception_ResNet_C(input=2146))

        self.features = nn.Sequential(*blocks)

        self.avepool = nn.AvgPool2d(kernel_size=3)

        self.dropout = nn.Dropout(p=0.2)
        self.linear = nn.Linear(2048, classes)

    def forward(self, x):
        x = self.features(x)
        # print("x",x.shape)
        x = self.avepool(x)
        # print("avepool", x.shape)
        x = self.dropout(x)
        # print("dropout", x.shape)
        x = x.view(x.size(0), -1)
        x = self.linear(x)

        return  x

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/344168.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【思维模型】概率思维的价值:找到你的人生算法!打开你的人生格局!实现认知跃迁!

把同样公平的机会放在放在很多人面前,不同的人生算法,会得到迥然不同的结果。 概率思维是什么? 【ChatGPT】概率思维是一种通过使用数学模型来思考和评估不确定性事件的方法。它通过计算不同可能性的概率来预测事件的结果,并评估风险和机会。 概率思维的价值在于它可以帮…

CSS样式表继承和优先级

CSS样式表继承 要想了解css样式表的继承,我们先从文档树(HTML DOM)开始。文档树由HTML元素组成。 文档树和家族树类似,也有祖先、后代、父亲、孩子和兄弟_。 那么CSS样式表继承指的是,特定的CSS属性向下传递到子孙元…

智能三子棋(人机大战)—— 你会是最终赢家吗?万字讲解让你实现与自己对弈

魔王的介绍:😶‍🌫️一名双非本科大一小白。魔王的目标:🤯努力赶上周围卷王的脚步。魔王的主页:🔥🔥🔥大魔王.🔥🔥🔥 ❤️‍&#x1…

2023年湖北建设厅七大员八大员报名怎么收费呢?

建设厅七大员八大员全国统一报名网站,证书全国通用,无需调转,这点还是很方便的,所有在湖北考的证书全国都能用呢。 八大员报考机构很多,收费也是层次不齐,这里需要提醒大家注意的是,咨询八大员的…

如何持续架构治理?我们和 ChatGPT 聊了一会?

在上周的 QCon 北京 2022 大会上,我和我的同事黄雨青一起分享了《组织级架构治理的正确方式》,以帮助开发人员对组织级架构治理体系全貌一瞥,并厘清治理工具的设计思路和核心功能内容。结合我们在 ArchGuard 的探索经验,我们&…

自有APP上如何运行小游戏?

近年来小程序游戏迎来了爆发式增长。微信、支付宝、抖音等各大平台小程序游戏愈加丰富,你是否也让自己的App也拥有运行丰富的小游戏的能力?今天就来带大家看看如何实现。 我们先来看看各互联网巨头关于小游戏生态的特征: 「微信」 率先推出…

open3d点云配准函数registration_icp

文章目录基本原理open3d调用绘图基本原理 ICP, 即Iterative Closest Point, 迭代点算法。 ICP算法有多种形式,其中最简单的思路就是比较点与点之间的距离,对于点云P{pi},Q{qi}P\{p_i\}, Q\{q_i\}P{pi​},Q{qi​}而言,如果二者是同一目标&am…

如何将一张纹理图贴在模型上

前言 小伙伴们是否有过这样的场景:看到一个精美的3D模型,很想知道它是如何被创作出来的?于是开始了一番搜索引擎查找之后,得知需要建模工具来完成,例如3D Max、Maya、Blender、Photoshop。那么本篇就使用这些工具来完成一个精美的…

Redis【包括Redis 的安装+本地远程连接】

Redis 一、为什么要用缓存? 缓存定义 缓存是一个高速数据交换的存储器,使用它可以快速的访问和操作数据。 程序中的缓存 在我们程序中,如果没有使用缓存,程序的调用流程是直接访问数据库的; 如果多个程序调用一个数…

如何在原始的认知上找回自己

认知、欲望加恐惧,这三种要素在我们对一个事物的判断中都在起作用,只不过配比不一样,导致你的判断不一样。我们通常以为有了认知能力,就产生了认知,就如同面前有一个东西,你用照相机拍下来就成了一张照片—…

【算法基础】高精度除法

👦个人主页:Weraphael ✍🏻作者简介:目前是C语言 算法学习者 ✈️专栏:【C/C】算法 🐋 希望大家多多支持,咱一起进步!😁 如果文章对你有帮助的话 欢迎 评论&#x1f4ac…

PN外加电场后电场变化

没有外加电场时(下面都是以外加反向电场分析) 中间两条实线假设是PN节在没有外加电场的情况下形成的一个内部电场边界。 形成原因 实用的半导体一般是混合物 P型半导体,实际上是一种4价和3价元素的混合物。化学中都知道达到4或8的外层电子…

论文浅尝 | KGE by Adaptive Limit Scoring Loss Using DWS

笔记整理:陈磊,天津大学硕士链接:https://ieeexplore.ieee.org/ielx7/6287639/7859429/08057770.pdf动机设计一个强大而有效的损失框架对于知识图嵌入模型区分正确和不正确的三元组至关重要。经典的基于边距的排名损失将正负三元组的分数限制…

极智AI | 算能SDK架构

欢迎关注我的公众号 [极智视界],获取我的更多经验分享 大家好,我是极智视界,本文介绍一下 算能SDK架构。 邀您加入我的知识星球「极智视界」,星球内有超多好玩的项目实战源码下载,链接:https://t.zsxq.com…

华芯微特开发环境搭建-SWM34SVET6为例

SWM34S系列是cortex-M33,内核是arm-v8指令集,和其他cortex系列有差异,要新的工具版本支持(jlink要升级到V9以上,keil要升级到5.32以上)。 1.Keil要先安装5.36的版本,并取得版权(5.3…

【MYSQL中级篇】数据库数据查询学习

🍁博主简介 🏅云计算领域优质创作者   🏅华为云开发者社区专家博主   🏅阿里云开发者社区专家博主 💊交流社区:运维交流社区 欢迎大家的加入! 相关文章 文章名文章地址【MYSQL初级篇】入门…

网络安全-Kali更新源(APT)

网络安全-Kali更新源(APT) 这篇东东很少内容 Kali是基于乌班图开发出来的 这个APT不是攻击的那个APT 这个APT和centos里面的YUM是一样的 下面是介绍的一些国内的APT包,我自己用的阿里云 通俗点怎么理解呢,你手机里面的应用市场,苹…

【闲聊】我用ChatGPT参加了大数据面试

用Chat GPT试了试面试题,回答得比较简单。 问:你可以以应聘者的身份参加一场大数据程序员面试吗 答:可以 ,如果您符合面试要求,可以参加大数据程序员面试。 问:那么为什么你要投递大数据开发这个岗位 答&am…

数据结构总结

数据结构总结排序算法冒泡排序选择排序插入排序希尔排序堆排序快速排序算法归并排序计数排序基数排序树红黑树基本概念规则B树基础知识规则B树图回溯算法并查集拓扑排序其他算法KMP算法例题数组类求最大和子数组求子数组最大乘积删除重复链表元素十大排序算法参考 排序算法 冒…

16:00面试,16:09就出来了 ,问的实在是太...

从外包出来,没想到算法死在另一家厂子 自从加入这家公司,每天都在加班,钱倒是给的不少,所以也就忍了。没想到8月一纸通知,所有人不许加班,薪资直降30%,顿时有吃不起饭的赶脚。 好在有个兄弟内…