自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(91)
  • 收藏
  • 关注

原创 Tensorflow实现kaggle猫狗识别(循序渐进进行网络设计)

这篇是tensorflow版本,pytorch版本会在下一篇博客给出友情提示:尽量上GPU,博主CPU上跑一个VGG16花了一下午。。。Tensorflow实现kaggle猫狗识别数据集获取数据准备网络设计1.简单的CNN1)网络结构3)完整代码:4)结果展示2.数据增强后的CNN1)数据增强(data augmentation)2)小tip3)完整代码4)结果展示3.使用预训练的卷积神经网1)基于VGG16搭建CNN2)一些注意点3)完整代码4)结构展示数据集获取网盘下载链接:https://

2021-12-04 20:48:41 4192 4

原创 python实现对遥感影像经纬度获取并实现海陆分离

经纬度1秒误差在30m左右,1度🟰3600秒,如果遥感影像的分辨率大 比如(1m,或者2m)想实现海陆分离不能根据经纬度坐标了,这时候建议裁剪所需区域手动标记制作掩膜。tif图像自带经纬度信息,因此可以使用gdal包获取经纬度信息然后对相应像素点负值操作。结果:(1m分辨率,可以看到,误差很大,没法用)500m分辨率 MODIS效果就好多了。

2022-10-19 08:32:12 1920 1

原创 半监督学习之数据增强

一般选择的未标记图片及其伪标签不直接送入网络进行retraining ,在此之前,我们需要对未标记图片及其伪标签做相应的增强操作,以便网络能学习额外的特征并且缓解对噪音的过拟合。常见的增强操作:直接裁剪或者填充为指定大小上下翻转、左右翻转、旋转指定角度transforms.Normalize()PIL的ImageFilter模块介绍最邻近(nearest)与双线性(bilinear)cutout是2017年提出的一种数据增强方法,想法比较简单,即在训练时随机裁剪掉图像的一部分,也可以看作是一种类似drop

2022-06-20 18:51:51 612

原创 带GUI界面的手写数字识别

带GUI界面的手写数字识别1.效果图2.数据集3.关于模型4.关于GUI设计1)排版2)直接运行这个文件(调用1)5.缺点6.遗留问题1.效果图有点low,轻喷点击选择图片会优先从当前目录查找2.数据集这部分我是对MNIST数据集进行处理保存对应代码:import tensorflow as tfimport matplotlib.pyplot as pltimport cv2from PIL import Imageimport numpy as npfrom scipy i

2022-01-03 22:46:59 3536 1

原创 风格迁移(初版)

风格迁移算法简介卷积神经网络提取特征完整代码效果展示DL/ML/NLP交流学习群论文链接算法简介本质:定义一个损失函数,然后将这个损失最小化。这里loss可以分为两部分:内容损失和风格损失。内容损失:可以被卷积神经网络更靠顶部的层的表示所捕捉到,因此将图像送入预训练的网络模型(本文使用VGG19在ImageNet上的训练参数),从顶部的一层的输出可以表示该图片内容,损失即可用生成的图片和原图片输出之间的差异来表示。风格损失:风格需要用图片在多个空间尺度上提取的外观来表示,即在预训练的网络模型的不

2021-12-11 20:35:43 2943

原创 手把手教你,MNIST手写数字识别

数据集介绍MNIST数据集是机器学习领域中非常经典的一个数据集,由60000个训练样本和10000个测试样本组成,每个样本都是一张28 * 28像素的灰度手写数字图片,且内置于keras。本文采用Tensorflow下Keras(Keras中文文档)神经网络API进行网络搭建。开始之前,先回忆下机器学习的通用工作流程( ✅表示本文用到,❌表示本文没有用到 )定义问题,收集数据集(✅)选择衡量成功的指标(✅)确定评估的方法(✅)准备数据(✅)开发比基准更好的模型(❌)扩大模型规模(❌)模型

2021-11-30 11:40:58 11911 2

原创 1034 Head of a Gang (30point(s))

One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call betweenAandB, we say thatAandBis related. The weight of a relation is defined to be t...

2020-04-04 19:18:36 209

原创 关于因子分解的一类题型

1: 质因子分解思路:由于质因子分解是唯一的(算术基本定理),因此只需要枚举质因子(提前打表质数),计数即可。AC code:#include<bits/stdc++.h>using namespace std;const int maxn=100000;struct fac{ int x,cnt;};int p[maxn],num=0;//boo...

2020-04-02 21:48:47 294

原创 大整数乘法

思想:直接模拟乘法运算,最后统一处理进位。#include<bits/stdc++.h>using namespace std;int main(){ string s1,s2; while(cin>>s1>>s2){ if(s1=="0" || s2=="0"){ cout<<"0\n";continue; } ...

2020-04-02 16:19:24 166

原创 分数的四则运算

1.分数的表示struct Frac{ int up,down;}; 几个约定:1) 假分数形式2)分子需为非负数,否则分子、分母同时取反。2)若分子为0,则令分母为13)分子与分母没有1之外的公因子2.分数的化简---用于实现上述几个约定。Frac reduction(Frac result){//化简分数 if(result.down <0...

2020-04-02 16:05:57 560

原创 三元组最小距离

题目: 已知三个升序整数数组a[l], b[m]和c[n]。请在三个数组中各找一个元素,是的组成的三元组距离最小。三元组的距离定义是:假设a[i]、b[j]和c[k]是一个三元组,那么距离为:Distance = max(|a[ I ] – b[ j ]|, |a[ I ] – c[ k ]|, |b[ j ] – c[ k ]|)请设计一个求最小三元组距离的最优算法,并分析时间...

2020-01-07 16:27:27 2850 1

原创 静态链表常见题型总结

静态链表首先,静态链表的原理是Hash,即通过建立一个结构体数组,使用下标去访问数组元素;一般化步骤:1)定义静态链表struct Node{ int add;//节点地址 typedef data;//数据域 int next;//指针域 XXX ; // 节点某性质,具体问题,具体分析}node[maxn];2) 静态链表初始化fo...

2019-12-26 21:10:55 417

原创 中缀转后缀

背景参考我的另一篇:表达式求值C++ code:#include<bits/stdc++.h>using namespace std;int pri(char op){ if(op =='*'|| op=='/') return 2; if(op=='+'|| op=='-') return 1; if(op=='(') return 0;} bool dea...

2019-09-07 21:19:48 141

原创 1145 Hashing - Average Search Time (25 分)

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer keys from the table and output the average sea...

2019-09-02 21:05:48 205

原创 1146 Topological Order (25 分)

This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are supposed to write a program to test...

2019-09-02 20:34:29 217

原创 1111 Online Map (30 分)

Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the other is the fastest. It is g...

2019-09-02 00:25:14 132

原创 1119 Pre- and Post-order Traversals (30 分)

2月4号:update版本~Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences, or preor...

2019-09-01 17:33:28 162 1

原创 1022 Digital Library (30 分)

A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number a...

2019-08-29 20:27:26 132

原创 1141 PAT Ranking of Institutions (25 分)

After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ranklist.Input Specification:Each input file conta...

2019-08-27 21:18:23 140

转载 1014 Waiting in Line (30 分)

Suppose a bank hasNwindows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are:The space...

2019-08-26 23:10:21 198

原创 1072 Gas Station (30 分)

A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must guarantee that all the hou...

2019-08-26 21:20:25 164

原创 1033 To Fill or Not to Fill (25 分)

With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time to time. Different ga...

2019-08-24 22:06:33 168

原创 1049 Counting Ones (30 分)

The task is simple: given any positive integerN, you are supposed to count the total number of 1's in the decimal form of the integers from 1 toN. For example, givenNbeing 12, there are five 1's i...

2019-08-24 17:01:21 168

原创 1108 Finding Average (20 分)

The basic task is simple: givenNreal numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input numbers might not be legal. Alegalinput is a real ...

2019-08-23 19:24:30 407

原创 1103 Integer Factorization (30 分)

TheK−Pfactorization of a positive integerNis to writeNas the sum of theP-th power ofKpositive integers. You are supposed to write a program to find theK−Pfactorization ofNfor any positive...

2019-08-23 17:09:12 276

原创 1101 Quick Sort (25 分)

There is a classical process namedpartitionin the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the pivot are moved to its le...

2019-08-22 23:44:10 139

原创 7-4 Structure of a Binary Tree (30 分)

Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, a binary tree can be uniquely determined.Now given a sequence of state...

2019-08-21 23:15:16 489

原创 L2-001 紧急救援 (25 分)

作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救援队数量和每一条连接两个城市的快速道路长度都标在地图上。当其他城市有紧急求助电话给你的时候,你的任务是带领你的救援队尽快赶往事发地,同时,一路上召集尽可能多的救援队。输入格式:输入第一行给出4个正整数N、M、S、D,其中N(2≤N≤500)是城市的个数,顺便假设城市...

2019-08-20 23:25:59 399

原创 1080 Graduate Admission (30 point(s))

It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission...

2019-08-20 21:09:56 194

原创 1070 Mooncake (25 point(s))

Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now ...

2019-08-18 10:42:09 136

原创 1109 Group Photo (25 point(s))

Formation is very important when taking a group photo. Given the rules of formingKrows withNpeople as the following: The number of people in each row must beN/K(round down to the nearest inte...

2019-08-17 23:06:55 130

原创 1112 Stucked Keyboard (20 point(s))

On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear repeatedly on screen forktimes.Now given a resulti...

2019-08-17 20:27:15 184

原创 1114 Family Property (25 point(s))

This time, you are supposed to help us collect the data for family-owned property. Given each person's family members, and the estate(房产)info under his/her own name, we need to know the size of each f...

2019-08-17 18:24:30 154

原创 1129 Recommendation Systems (25 point(s))

Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that rates the user's preference by the number of time...

2019-08-15 21:15:19 165

原创 1105 Spiral Matrix (25 分)

This time your job is to fill a sequence ofNpositive integers into aspiral matrixin non-increasing order. A spiral matrix is filled in from the first element at the upper-left corner, then move in...

2019-08-14 20:19:41 266

原创 L2-014 列车调度 (25 point(s))

火车站的列车调度铁轨的结构如下图所示。两端分别是一条入口(Entrance)轨道和一条出口(Exit)轨道,它们之间有N条平行的轨道。每趟列车从入口可以选择任意一条轨道进入,最后从出口离开。在图中有9趟列车,在入口处按照{8,4,2,5,3,9,1,6,7}的顺序排队等待进入。如果要求它们必须按序号递减的顺序从出口离开,则至少需要多少条平行铁轨用于调度?输入格式:输入第一行给出一个...

2019-08-14 19:05:15 230

原创 L2-011 玩转二叉树 (25 point(s))

给定一棵二叉树的中序遍历和前序遍历,请你先将树做个镜面反转,再输出反转后的层序遍历的序列。所谓镜面反转,是指将所有非叶结点的左右孩子对换。这里假设键值都是互不相等的正整数。输入格式:输入第一行给出一个正整数N(≤30),是二叉树中结点的个数。第二行给出其中序遍历序列。第三行给出其前序遍历序列。数字间以空格分隔。输出格式:在一行中输出该树反转后的层序遍历的序列。数字间以1个空格分隔,...

2019-08-14 16:52:38 429

原创 L2-012 关于堆的判断 (25 point(s))

将一系列给定数字顺序插入一个初始为空的小顶堆H[]。随后判断一系列相关命题是否为真。命题分下列几种:x is the root:x是根结点; x and y are siblings:x和y是兄弟结点; x is the parent of y:x是y的父结点; x is a child of y:x是y的一个子结点。输入格式:每组测试第1行包含2个正整数N(≤1000)和M(≤...

2019-08-14 16:08:12 155

原创 L2-023 图着色问题 (25 point(s))

图着色问题是一个著名的NP完全问题。给定无向图G=(V,E),问可否用K种颜色为V中的每一个顶点分配一种颜色,使得不会有两个相邻顶点具有同一种颜色?但本题并不是要你解决这个着色问题,而是对给定的一种颜色分配,请你判断这是否是图着色问题的一个解。输入格式:输入在第一行给出3个整数V(0<V≤500)、E(≥0)和K(0<K≤V),分别是无向图的顶点数、边数、以及颜色数。顶点和...

2019-08-13 21:26:34 136

原创 L2-004 这是二叉搜索树吗? (25 point(s))

L2-004这是二叉搜索树吗?(25point(s))一棵二叉搜索树可被递归地定义为具有下列性质的二叉树:对于任一结点,其左子树中所有结点的键值小于该结点的键值; 其右子树中所有结点的键值大于等于该结点的键值; 其左右子树都是二叉搜索树。所谓二叉搜索树的“镜像”,即将所有结点的左右子树对换位置后所得到的树。给定一个整数键值序列,现请你编写程序,判断这是否是对一棵二叉搜索树或...

2019-08-13 20:17:15 186

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除