日常实习-小米计算机视觉算法岗面经

流程

  • 自我介绍
  • 介绍项目
  • 介绍论文
  • 写代码

问题

请你写出项目中用到的模型代码,Resnet50

面试官:写出一个单元就好了。
实际面试过程中写出伪代码就好,
源代码:vision/torchvision/models/resnet.py

class BasicBlock(nn.Module):
    expansion: int = 1

    def __init__(
        self,
        inplanes: int,
        planes: int,
        stride: int = 1,
        downsample: Optional[nn.Module] = None,
        groups: int = 1,
        base_width: int = 64,
        dilation: int = 1,
        norm_layer: Optional[Callable[..., nn.Module]] = None,
    ) -> None:
        super().__init__()
        if norm_layer is None:
            norm_layer = nn.BatchNorm2d
        if groups != 1 or base_width != 64:
            raise ValueError("BasicBlock only supports groups=1 and base_width=64")
        if dilation > 1:
            raise NotImplementedError("Dilation > 1 not supported in BasicBlock")
        # Both self.conv1 and self.downsample layers downsample the input when stride != 1
        self.conv1 = conv3x3(inplanes, planes, stride)
        self.bn1 = norm_layer(planes)
        self.relu = nn.ReLU(inplace=True)
        self.conv2 = conv3x3(planes, planes)
        self.bn2 = norm_layer(planes)
        self.downsample = downsample
        self.stride = stride

    def forward(self, x: Tensor) -> Tensor:
        identity = 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:
            identity = self.downsample(x)

        out += identity
        out = self.relu(out)

        return out

里面的精华部分如下,我跳着写:

def __init__():
	self.conv1 = conv3x3(inplanes, planes, stride)
	self.bn1 = norm_layer(planes)
	self.relu = nn.ReLU(inplace = True)
	self.conv2 = conv3x3(planes, planes)
	self.bn2 = norm_layer(planes)
	self.downsample = downsample
	self.stride = stride

def forward(self, x: Tensor) -> Tensor:
	identity = 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:
		identity = self.downsample(x)
	
	out += identity
	out = self.relu(out)

	return out

在面试官的提示下我写了大概这样的伪代码:

def forward(x):
	identity = x
	out = conv2d(x)
	out = batchnorm(out)
	out = relu(out)
	
	out = conv2d(x)
	out = batchnorm(out)
	
	out += identity
	out = relu(out)
	
	return out

面试结果还没出,不保证我这样写是正确的!

进一步了解Resnet50,来自B站的同济子豪兄【精读AI论文】ResNet深度残差网络

  • 有几种不好的现象:

(1)网络退化现象:把网络加深之后,效果反而变差了

用人话说明:一个孩子报名了课外辅导班,结果不仅作业写得更差了,考试也更差了;(学多了反而导致结果更糟糕)

(2)过拟合现象:训练集表现很棒,测试集很差

用人话说明:一个孩子作业做的很棒,一上考场就发挥失常;

把你做的工作里面的模型替换成ViT能行吗?

有了解过Stable difussion,transformer吗?

总结

一面会重点针对简历上写的论文和项目,以及考察一些和岗位相关的前沿知识,坐在实验室是绝对绝对感受不到这些的!要勇敢踏出第一步;

相关推荐

  1. 日常实习-小米计算机视觉算法

    2024-06-06 03:40:03       35 阅读
  2. 小米-小爱】多模态算法社招

    2024-06-06 03:40:03       32 阅读
  3. RealAI-图像算法-

    2024-06-06 03:40:03       24 阅读
  4. 小米测开

    2024-06-06 03:40:03       32 阅读
  5. 计算机网络】

    2024-06-06 03:40:03       38 阅读
  6. 了搜狐大模型算法(实习),有惊无险。。。

    2024-06-06 03:40:03       47 阅读
  7. 竹云3.6(日常实习(20min)

    2024-06-06 03:40:03       47 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-06 03:40:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-06 03:40:03       101 阅读
  3. 在Django里面运行非项目文件

    2024-06-06 03:40:03       82 阅读
  4. Python语言-面向对象

    2024-06-06 03:40:03       91 阅读

热门阅读

  1. 【Golang】go语言写入数据并保存Excel表格

    2024-06-06 03:40:03       27 阅读
  2. 054、Python 函数的概念以及定义

    2024-06-06 03:40:03       33 阅读
  3. 【安卓配置WebView以允许非HTTPS页面访问摄像头】

    2024-06-06 03:40:03       31 阅读
  4. MySQL并发事务是怎么处理的?

    2024-06-06 03:40:03       30 阅读
  5. 欲除烦恼须无我,各有前因莫羡人

    2024-06-06 03:40:03       21 阅读
  6. Python连接数据库进行数据查询

    2024-06-06 03:40:03       28 阅读
  7. flink Transformation算子(更新中)

    2024-06-06 03:40:03       23 阅读
  8. 探索 Linux 命令 `yum`:软件包管理器的奥秘

    2024-06-06 03:40:03       32 阅读
  9. MAC帧

    MAC帧

    2024-06-06 03:40:03      27 阅读
  10. 力扣70. 爬楼梯

    2024-06-06 03:40:03       27 阅读
  11. docker参数大P与小p的区别

    2024-06-06 03:40:03       26 阅读
  12. Docker常用命令

    2024-06-06 03:40:03       23 阅读
  13. 基于SVD的点云配准

    2024-06-06 03:40:03       25 阅读