知乎链接 https://zhuanlan.zhihu.com/p/670356216
1. Transformer
(1) 结构
(2) 为什么它能处理多种模态,是怎么处理的
(3) 它怎么用于图像分类,怎么处理图像的
(4) 他的解码器和编码器有什么不同
Mask编码
2. BN的作用和好处
减少损失函数后梯度消失
3. Dropout的好处
4. 梯度消失的原因
5. Resnet为什么能减缓梯度消失的原因
6. coding
(1) 在nums寻找最小的连续子数组使得它们的和大于所给的targets
法1: 前缀和+二分
def search(s, k, n, t): t > s[n]: return -1 l, r = k, n res = n while l < r: mid = (l + r) >> 1 if s[mid] >= t: res = mid r = mid - 1 else: l = mid + 1 return res def func(targets, nums): if targets < sum(nums): return 0 n = len(nums) s = [0] * (n + 1) for i in range(1, n+1): s[i] = s[i - 1] + nums[i] res = n for i in range(1, n+1): t = targets + s[i - 1] d = search(s, i, n, t) if d > i and d - i + 1 < res: res = d - i + 1 return res target = 7 nums = [2,3,1,2,4,3] print(func(target, nums))
法2: 双指针
2. 说说对最近比较火的多模态 图像生成的了解
3. coding
(1) 求一个数的N次幂
def pow(k, n): if k == 0 and n == 0: return None flag = 1 if n < 0: flag = 0 res = 1 while n > 0: if (n & 1) == 1: res = res * k k *= k n >>= 2 if flag == 1: return res return 1.0 / res
(2)全排列
输入: 5,3
输出: [(1,2,3),(1,2,4),(1,2,5),(2,3,4),(2,3,5),(3,4,5),...]
import copy def dfs(l, res, n, m, index, level, tmp): if level > m: return if index > n: return if level == m: t = copy.deepcopy(tmp) res.append(tuple(t)) return # print("index ", index, " n - m + level + 1 ", n - m + level + 1) for i in range(index, n - m + level + 1): # print("i ", i, " l[i] ", l[i]) tmp.append(l[i]) dfs(l, res, n, m, i+1, level+1, tmp) tmp.pop() def pailie(n, m): l = range(1, n+1) res = [] tmp = [] dfs(l, res, n, m, 0, 0, tmp) return res print(pailie(5, 3))
希望能过吧,有点大厂情结,有机会三面的话再来补充。
#淘天##机器学习##算法工程师##阿里妈妈##校招#