摘要: ####判断奇偶性 if num & 1 == 1: num % 2 == 1 # nums is odd number if num & 1 == 0: num % 2 == 0 # num is even number ####异或 当 num 是偶数时,num + 1 = num ⊕ 1 当 阅读全文
posted @ 2022-02-14 09:28 小艾衰 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 占位层 阅读全文
posted @ 2022-01-10 14:16 小艾衰 阅读(212) 评论(0) 推荐(0) 编辑
摘要: '@' : 矩阵乘 '*' : 矩阵点乘 >>a = torch.tensor([[1, 2], [3, 4]]) >>b = torch.tensor([[4, 5], [6, 7]]) >>print(f'a x b = {a @ b}\na * b = {a * b}') >>a x b = 阅读全文
posted @ 2022-01-10 11:17 小艾衰 阅读(1249) 评论(0) 推荐(0) 编辑
摘要: https://oi-wiki.org/ #竞赛算法 https://imyshare.com/ #网站汇总 阅读全文
posted @ 2021-12-23 10:11 小艾衰 阅读(11) 评论(0) 推荐(0) 编辑
摘要: ###用于标签平滑 torch.clamp(input, min, max, out=None) 将输入input张量每个元素的范围限制到区间 [min,max],返回结果到一个新张量。 input (Tensor) – 输入张量 min (Number) – 限制范围下限 max (Number) 阅读全文
posted @ 2021-11-08 14:27 小艾衰 阅读(156) 评论(0) 推荐(0) 编辑
摘要: ###使用 tensorboard --logdir 出现报错 Fatal error in launcher: Unable to create process using #####改为 python -m tensorboard.main --logdir #####实测可运行 ##ps. # 阅读全文
posted @ 2021-11-01 13:29 小艾衰 阅读(278) 评论(0) 推荐(0) 编辑
摘要: ####import cv2改为 ####import cv2.cv2 as cv2 阅读全文
posted @ 2021-11-01 10:12 小艾衰 阅读(210) 评论(0) 推荐(0) 编辑
摘要: ####If you are running on a CPU-only machine, ####please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU. #####gp 阅读全文
posted @ 2021-10-27 09:52 小艾衰 阅读(493) 评论(0) 推荐(0) 编辑
摘要: ####配合cv.getStructuringElement()使用 dst = cv.morphologyEx(src, MODE, cv.getStructuringElement(cv.MORPH_ELLIPSE, (ksize, ksize))) ####MODE={ MORPH_OPEN 阅读全文
posted @ 2021-10-25 15:47 小艾衰 阅读(1286) 评论(0) 推荐(0) 编辑
摘要: ###cv.resize() 二维返回的维度是交换的 只能接受二维数组 例: >>import cv2 as cv >>import numpy as np >>img = np.random.rand(128,256) >>img = cv.resize(img, (128, 256)) >>im 阅读全文
posted @ 2021-10-18 11:02 小艾衰 阅读(327) 评论(0) 推荐(0) 编辑