- 博客(12)
- 收藏
- 关注
原创 torch.nn.Conv1d一维卷积是如何卷的
看的这篇终于弄懂了!https://blog.csdn.net/fy_2018/article/details/119489764一维卷积不代表卷积核只有一维,也不代表被卷积的feature也是一维。一维的意思是说卷积的方向是一维的!下边是一个简单的一维卷积的例子(batchsize是1,也只有一个kernel):输入:一个长度为35的序列,序列中的每个元素有256维特征,故输入可以看作(35,256)卷积核: size = (k,) , (k = 2)这幅图只说明了只有一个数据的情况,如果将
2022-05-03 12:55:56 325
原创 PAT 1053 Path of Equal Weight 两个测试点不知道错哪-知道了!
#include<stdio.h>#include<iostream>#include<math.h>#include<algorithm>#include<string>#include<vector> #include<queue>using namespace std;struct node{ int value; vector<int> child;}tree[11.
2021-09-16 16:36:38 225
原创 1093 Count PAT‘s 坑点
测试点3和4考察取模,不能在最后统计完成后再取模,需要每计算一次就取模```cpp#include <iostream>#include <vector>#include<algorithm>#include<string>#include<cmath>using namespace std;int main(){ freopen("in.txt","r",stdin); string a; getli
2021-09-14 15:58:15 90
原创 Leetcode 两数相加
Leetcode 两数相加int n1 = l1 ? l1->val: 0; //可以这样表示 int n2 = l2 ? l2->val: 0;int等于一个指针,如这个指针为空,则int值为0;若改为:int n1 = l1->val ? l1->val: 0;会报错。完整代码如下:class Solution {public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
2021-08-24 23:05:26 202
原创 使用colab
开始学习使用colab,按照网上教程。![在这里插入图片描述](https://img-blog.csdnimg.cn/20210516233518592.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2hoaF9zc2Q=,size_16,color_FFFFFF,t_70)...
2021-05-16 23:41:00 135
原创 跑AttnGAN代码
跑AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks论文代码,github网址:https://github.com/taoxugit/AttnGAN首先把一些data、model下载下来,有点大,下载时长较长,有些还要fq才能下下载完后目录如下,我这里跑的是bird因为是要python2.7,但pytorch对应cuda的话会自动升级python为3.版本
2021-04-28 15:44:59 1493 14
原创 anconda重装 pytorch GPU安装
呜呜呜事情的起因是这样的,最近在研究模型量化,运行这个函数时torch.quantization.get_default_qconfig发现因为pytorch版本过低,想着create一个新环境,结果报错,还是解决不了的那种,隐隐感觉完蛋,要重装了,我的tfgpu当初配了好几天啊!!哭。创建新环境也报错,重复试了几次莫名其妙成功了,就是速度很慢。然后安装pytorch试了很多镜像,.condarc文件这样可以下载。清华源的试了很多都很慢,用上交的。可以用remove啥的命令先还原到默认状态。show_
2021-04-09 20:47:24 400
原创 PAT甲级1048 Find Coins 关于sort函数
本来是这样的:然后将cmp函数里a<=b改成a<b,就全部pass了。#include<iostream>#include <string>#include <algorithm>using namespace std;bool cmp(int a,int b){ return a<b;}int main(){ int n,m; cin>>n>>m; int a[1010]={
2021-03-31 00:31:34 77
原创 PAT甲级1075 PAT Judge 测试点2&4 答案错误
这题是排序题,简单,但坑在细节。 题目说“For those who has never submitted any solution that can pass the compiler, or has never submitted any solution, they must NOT be shown on the ranklist.”存在一种情况:用户pass the compiler 但是得分为0,还是得输出。所以**不能根据总得分是否为0判断该不该被输出**。 有些细节的判断条件需..
2021-03-25 12:54:15 344
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人