- 博客(8)
- 收藏
- 关注
原创 Knife4j文档请求异常
发现是没有扫描到Knife4j配置类,在启动类上添加@componentscan,或者修改包名。后台没有任何报错问题,自己在浏览器上直接输入get请求响应也成功。锁定Knife4j配置的原因。
2023-08-17 15:11:16
553
1
原创 Mapper.xml的sql语句爆红,找不到表
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)。
2023-04-26 16:55:43
648
原创 语言模型-pytorch
#语言模型和数据集import matplotlib.pyplot as pltimport randomimport torchfrom d2l import torch as d2ltokens = d2l.tokenize(d2l.read_time_machine())corpus = [token for line in tokens for token in line]vocab = d2l.Vocab(corpus)# print(vocab.token_freqs[:..
2022-03-20 13:50:02
1738
原创 多分类-pytorch
import torchfrom torch.utils.data import DataLoaderimport torch.nn.functional as Fimport numpy as npimport torch.optim as optimfrom torchvision import transformsfrom torchvision import datasetsbatch_size = 64transform = transforms.Compose([#像素值0~2.
2021-12-28 18:41:01
779
原创 加载数据集-pytorch
import torchimport numpy as npimport torch.nn.functional as Ffrom torch.utils.data import Dataset#抽象类,不能实例化,只能被继承from torch.utils.data import DataLoader#可以实例化,加载数据class DiabetesDataset(Dataset):#继承自Dataset def __init__(self,filepath): x.
2021-12-28 13:10:44
882
原创 pytorch 逻辑回归
import torchimport torch.nn.functional as Fx_data = torch.Tensor([[1.0],[2.0],[3.0]])y_data = torch.Tensor([[0],[0],[1]])class LogisticRegressionModel(torch.nn.Module): def __init__(self): super(LogisticRegressionModel,self).__init__() .
2021-12-26 21:39:18
505
原创 pytorch 线性回归
import torchx_data = torch.Tensor([[1.0],[2.0],[3.0]])y_data = torch.Tensor([[2.0],[4.0],[6.0]])#设计模型class LinearModel(torch.nn.Module):#没用backward,因为用module构造出来的对象,会自动地根据构造出来的构造图自动实现backward的过程 def __init__(self):#__init__就是构造函数,初始化对象默认调用的函数 .
2021-12-26 17:06:49
306
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人