ruijiege

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 35 下一页

2022年11月14日

摘要: import json import numpy as np import torch from scipy.cluster.vq import kmeans2,kmeans from sklearn.cluster import k_means import random with open("i 阅读全文
posted @ 2022-11-14 11:40 哦哟这个怎么搞 阅读(72) 评论(0) 推荐(0) 编辑

2022年11月9日

摘要: k=2 data = np.random.randn(100,2) data[:50]+=2.0 center_index = np.random.choice(np.arange(len(data)), k) center = data[center_index] iters = 20 def d 阅读全文
posted @ 2022-11-09 10:09 哦哟这个怎么搞 阅读(37) 评论(0) 推荐(0) 编辑

2022年11月7日

摘要: 按照面积排序 from scipy.cluster.vq import kmeans import numpy as np new_anchor = np.arange(0,9).reshape(3,3) print(new_anchor) print(new_anchor.prod(axis =1 阅读全文
posted @ 2022-11-07 08:57 哦哟这个怎么搞 阅读(0) 评论(0) 推荐(0) 编辑

2022年11月3日

摘要: from albumentations.core.transforms_interface import DualTransform from albumentations.pytorch import ToTensorV2, ToTensor import random View Code # 随 阅读全文
posted @ 2022-11-03 08:07 哦哟这个怎么搞 阅读(18) 评论(0) 推荐(0) 编辑

2022年11月2日

摘要: import numpy as np def draw_gauss(heatmap, x, y, gsize): height, width = heatmap.shape[:2] gsize += 1 - (gsize % 2) sigma = gsize / 6 s = 2 * sigma * 阅读全文
posted @ 2022-11-02 18:04 哦哟这个怎么搞 阅读(28) 评论(0) 推荐(0) 编辑

摘要: class GIoULoss(nn.Module): def __init__(self): super().__init__() def forward(self, A, B): num_bbox = A.size(0) * A.size(2) ax, ay, ar, ab = A[:, 0], 阅读全文
posted @ 2022-11-02 17:52 哦哟这个怎么搞 阅读(65) 评论(0) 推荐(0) 编辑

摘要: def smooth_l1_loss_modify(predict, target, mask, sigma=3): # predict: bx2x96x128 # target : bx2x96x128 # mask : bx2x96x128 num_object = mask.sum().ite 阅读全文
posted @ 2022-11-02 17:52 哦哟这个怎么搞 阅读(36) 评论(0) 推荐(0) 编辑

2022年10月30日

摘要: import torch import torch.nn as nn import torch.nn.functional as F import torchvision.datasets.mnist as mnist import torchvision.transforms as T impor 阅读全文
posted @ 2022-10-30 12:57 哦哟这个怎么搞 阅读(20) 评论(0) 推荐(0) 编辑

2022年10月29日

摘要: import torch import torch.nn as nn import numpy as np import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() s 阅读全文
posted @ 2022-10-29 08:24 哦哟这个怎么搞 阅读(42) 评论(0) 推荐(0) 编辑

2022年10月28日

摘要: class BatchNormalization(Module): def __init__(self, in_feature, momentum=0.9, eps=1e-8): self.mu = 0 self.var = 1 self.momentum = momentum self.eps = 阅读全文
posted @ 2022-10-28 09:52 哦哟这个怎么搞 阅读(12) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 35 下一页