![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 81
robator
这个作者很懒,什么都没留下…
展开
-
国家省、市、县、镇/街道地址
全国3级、4级、5级地址原创 2022-06-30 17:29:00 · 2933 阅读 · 2 评论 -
pymysql 执行条件插入
mysql 利用虚表进行条件插入原创 2022-06-06 17:14:38 · 505 阅读 · 0 评论 -
torch的DataLoader 浅析
torch的DataLoader主要是用来装载数据,就是给定已知的数据集,把数据集装载进DataLoaer,然后送入深度学习网络进行训练。先看一下它的声明吧。(官方声明,pytorch 1.10.0文档,参考资料1)DataLoader(dataset, batch_size=1, shuffle=False, sampler=None, batch_sampler=None, num_workers=0, collate_fn=None, pin_memor...原创 2021-12-29 14:22:59 · 17774 阅读 · 0 评论 -
pytorch 实现MLP(多层感知机)
pytorch 实现多层感知机,主要使用torch.nn.Linear(in_features,out_features),因为torch.nn.Linear是全连接的层,就代表MLP的全连接层本文实例MNIST数据,输入层28×28=784个节点,2个隐含层,隐含层各100个,输出层10个节点开发平台,windows 平台,python 3.8.5,torch版本1.8.1+cpu#minist 用MLP实现,MLP也是使用pytorch实现的import torchvisionimpo原创 2021-12-09 08:42:39 · 27048 阅读 · 1 评论 -
RBF(Radial-Basis Function)网路之一:多元插值法
1 插值:在离散数学的基础上补插连续函数,使得这条连续曲线通过全部给定的离散数据点。(来自百度百科)插值除了给定的离散数据点外,连续曲线的其他点都属于“插入”进来的,所以称插值。对以一给定数据点的集合,可能会有多条插值曲线。插值和拟合的区别:插值要求曲线(或曲面)过全部的离散数据点,而拟合是寻求全局最接近的结果,...原创 2021-10-12 14:44:07 · 5683 阅读 · 1 评论 -
linux 下 pytorch 安装
参考资料:1https://github.com/pytorch/pytorch1彻底解决git clone和recursive慢的问题https://sirjamie.github.io/2020/10/18/git-clone/2解决 fatal error: third_party/lss/linux_syscall_support.h: 没有那个文件或目录2https://github.com/linux-on-ibm-z/linux-syscall-supp...原创 2021-10-12 14:05:27 · 2715 阅读 · 0 评论 -
jupyter notebook 某个cell 一直在运行
近期调试程序,发现一简单的代码一直在运行,很长时间不终止,代码如下:whole_df=pd.read_csv(r'./train.csv')community=whole_df['COMMUNITY_ID'].unique()for community_id in community: temp=check_result[check_result['COMMUNITY_ID']==community_id] start=temp.index.tolist()[0]原创 2021-08-25 21:47:26 · 1734 阅读 · 0 评论 -
linux 下安装fbprophet
prophet 是facebook 开发的一个时间序列预测算法,基本思路是将时间序列分解并做函数拟合求解出的,论文见参考资料1。其拟合用的工具是pystan。prophet 提供2种语言的支持:R语言和python 语言。本篇博客主要介绍后者 本文使用的linux发行版为centos8,内核版本4.18.0-240.15.1.el8_3.x86_64。这里的python 开发环境为anaconda3,具体安装方法可见作者之前博客。1 找准开发环境 首...原创 2021-06-26 08:49:04 · 1240 阅读 · 0 评论 -
linux(centos8 ) 下安装anaconda3
linux 下安装anaconda主要用来开发python,本次使用的版本是centos8, 内核版本4.18.0,而anaconda 的版本是anaconda 31 下载anaconda3从官网上下载anaconda3 的速度较慢,可以从国内的镜像站下载,本次选用的清华大学镜像站下载,下载地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/镜像站上有每个时间点的anaconda,可以自行选择下载,本次选用的是Anaconda3-20原创 2021-04-10 17:08:49 · 1848 阅读 · 0 评论 -
centos8 安装geany
geany 是一个软件开发工具,我主要用它来开发python 程序。本博客介绍的安装方式是源码安装方式,首先从官网下载geany,官网下载地址:https://www.geany.org/download/releases/,选择geany-1.36.tar.gz下载,下载后首先安装以下三个依赖包(已安装的跳过)。centos 版本8(内核版本4.18),geany版本1.36(1)[root@192 geany-1.36]# dnf install gcc-c++上次元数据过期检查:0:53:.原创 2020-10-13 21:40:44 · 578 阅读 · 1 评论 -
django 设置登录成功后的页面
python 版本3.7.4,django 2.2.6,设置登录后的页面,登录页面是在一个form 进行的,如下所示:<form method ="post",action="{% url 'users:login' %}"> {% csrf_token %} {{form.as_p}} <button name="sumit">log</...原创 2019-11-11 08:55:21 · 1151 阅读 · 0 评论 -
TypeError at / 'AnonymousUser' object is not iterable
在使用filter的时候,出现了如下错误(python版本3.7.4,django 版本2.2.6):错误显示在‘/’目录下,也就是默认的index视图下,其中index 视图的源码如下:def index(request): posts=Post.objects.filter(owner=request.user).order_by('date_added') ...原创 2019-11-08 21:15:21 · 608 阅读 · 0 评论 -
IntegrityError at ** NOT NULL constraint failed: learning_logs_topic.owner_id
最近在学习《python 从入门到实战》第19章,在learning_logs中models 添加了topic的用户属性,即哪个用户登录后创建的topic,则此topic的owner属性为此登录用户,代码:owner=models.ForeignKey(User,on_delete=models.CASCADE),owner 是User的外键(pthon 版本3.7.4,django版本2.2.6...原创 2019-11-08 14:25:00 · 2808 阅读 · 6 评论 -
sqlite3.OperationalError: no such column: **
最近在《phthon 从入门到实战》在第19章第三部分,按照要求在models.py(learning_logs app 里面的),添加了一行:owner=models.ForeignKey(User,on_delete=models.CASCADE),即添加了用户的一个外键,在执行了makemigrations 后,sunsever 时出现了一个错误,如下: 无对应列owner_id...原创 2019-11-07 18:04:43 · 3915 阅读 · 2 评论 -
TypeError at /**/ ** missing 1 required positional argument: '**'
最近在学习《python 从入门到实战》,习题19-1中出现了一个错误,TypeError at /edit_post/edit_post() missing 1 required positional argument: 'post_id'如下图所示:如上图所示,类型错误,edit_post缺少一个要求的位置参数:post_id,其中blogs的url.py 的代码如下:...原创 2019-10-26 10:35:56 · 1231 阅读 · 0 评论 -
Reverse for '**' with arguments '('',)' not found. 1 pattern(s) tried(topic_id与topic.id)
最近在学习《python 从入门到精通》第19章,进行环境搭建时出现了一个错误,python 版本:3.7.4,django 版本:2.2.5NoReverseMatch at /new_entry/2Reverse for 'topic' with arguments '('',)' not found. 1 pattern(s) tried: ['topic/(?P<topic...原创 2019-10-21 14:34:33 · 11403 阅读 · 7 评论 -
The current path, **, didn't match any of these(django 2.2.6,page not found)
近段在学习python(《python 从入门到实战》),由于现有django版本较高,为2.2.6,有很多与书中不一样的地方,在运行中出现了一个错误,如下图:而learning_logs/urls.py代码如下from django.urls import pathfrom . import viewsapp_name='learning_logs'urlpatte...原创 2019-10-07 17:40:33 · 16716 阅读 · 1 评论