模板
yikshing
这个作者很懒,什么都没留下…
展开
-
【Pytorch】基础训练框架
每次训练都要写完整的流程,比较麻烦,实际上,除了网络要修改,其他部分大同小异。我们可以梳理成一定格式。这里针对图像分类任务,给出训练框架。默认图像数据集的格式是ImageNet。四大模块:准备数据、设计模型、设置Loss和Optimizer、训练和测试、(推理)原创 2022-04-08 12:08:56 · 1892 阅读 · 0 评论 -
模板 开头
#include<iostream>#include<queue>#include<cstdio>#include<cstring>#include<cmath>#include<map>#include<string>#define mp make_pair#define sq(x) ((x)*(转载 2019-01-20 20:02:19 · 131 阅读 · 0 评论 -
(1)euler & phi & prime(2)GCD(矩阵)
/** 同时得到欧拉函数和素数表*/#include <bits/stdc++.h>using namespace std;const int MAXN = 10000000;bool check[MAXN + 10];int phi[MAXN + 10];int prime[MAXN + 10];int tot; // 素数个数void phi_and_prim...转载 2019-01-15 20:31:02 · 272 阅读 · 0 评论 -
优化输入输出
#define num ch-'0'void get(int &amp;amp;amp;res){ char ch;bool flag=0; while(!isdigit(ch=getchar())) (ch=='-')&amp;amp;amp;&amp;amp;amp;(flag=true); for(res=num;isdigit(ch=getchar());res=res*10+num); ...转载 2019-02-01 21:37:39 · 146 阅读 · 0 评论 -
ONLINE_JUDGE与freopen("in.txt","r",stdin)
杭电的OJ系统,在FAQ里就有这个问题:Q:Is there any way to determine if my program is runned at Online Judge or not ?A:There is a conditional define of compiler called ONLINE_JUDGE. Example of using:C/C++#ifdef ON...转载 2019-02-11 14:51:45 · 1250 阅读 · 0 评论 -
数组模拟链表(限于从小到大排列的插入操作)
#include<bits/stdc++.h>using namespace std;typedef long long LL;typedef pair<LL,LL>PLL;int main(){ int data[102],right[102]; int i,n,t,len; printf("How many numbers? ...原创 2019-04-01 22:47:00 · 302 阅读 · 0 评论