自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 资源 (2)
  • 收藏
  • 关注

原创 leetcode打卡

class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: res=[] l,r=0,len(nums)-1 nums.sort() nums_copy=nums.copy() sameFalg=True while l<r: if nums[l]+nums[r]==ta...

2020-08-28 21:35:49 189

原创 leetcode打卡

class Solution: def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]: return set(nums1)&set(nums2) class Solution: def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]: from collec...

2020-08-25 22:18:58 263

原创 leetcode动态规划 72,198,213,516,674

以下全部用python3编写 5: class Solution: def longestPalindrome(self, s: str) -> str: size = len(s) if size < 2: return s dp = [[False for _ in range(size)] for _ in range(size)] max_len = 1 start = 0

2020-08-21 20:11:53 240

原创 leetcode刷题(169,53,50)

leetcode刷题(python 3 ) 169.多数元素   【题目描述】 给定一个大小为 n 的数组,找到其中的众数。众数是指在数组中出现次数大于 [n/2] 的元素。 你可以假设数组是非空的,并且给定的数组总是存在众数。 示例 1: 输入: [3,2,3] 输出: 3 示例 2: 输入: [2,2,1,1,1,2,2] 输出: 2 【解题思路】 确定切分的终止条件   直到所有的子问题都是长度为 1 的数组,停止切分。 准备数据,将大问题切分为小问题   递归地将原数组二分为左区间与右区间,直到最终

2020-08-18 21:25:08 216

原创 pip安装pytorch和torchvision

登录pytorch官网,点击get start,按照自己的电脑配置得到命令进行下载,我的电脑是win10,Python版本为3.5,没有cuda的CPU,所以产生的命令如下: pytorch框架现在运用广泛,下面在python3.5中安装一下。复制上图中蓝色部分的代码,为了快速下载安装,使用了清华镜像: pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.h

2020-05-29 11:36:44 3086

原创 用VGG16实现fashion_mnist

直接上代码 from keras.datasets import fashion_mnist from keras.utils import to_categorical from keras import models from keras.layers.convolutional import Conv2D,MaxPooling2D from keras.layers.core import ...

2020-04-23 19:29:53 1272

转载 padding = “SAME”与padding = “VALID”

最近在用tensorflow搭建卷积神经网络,遇到了一个比较棘手的问题,我一直理解的padding有两个值,一个是SAME,一个是VALID,如果padding设置为SAME,则说明输入图片大小和输出图片大小是一致的,如果是VALID则图片经过滤波器后可能会变小。 如下图: 从程序中可以看出我的输入是553,过滤器是333,padding设置的值是SAME,所以我一开始预想的是输出557(有7个过...

2020-04-19 22:13:02 3548

原创 TensorBoard 1.15.0 at http://DESKTOP-DV74NQ2:6006/ (Press CTRL+C to quit)打开html地址无法访问

TensorBoard 1.15.0 at http://DESKTOP-DV74NQ2:6006/ (Press CTRL+C to quit)打开html地址无法访问 这是版本原因,不能直接在127.0.0.1:6006可视化tensorboard 解决方法: tensorboard --logdir=文件夹路径 --host=127.0.0.1 ...

2020-04-15 21:10:35 1854 1

原创 VGG16进行微调,训练mnist数据集

直接用mnist训练VGG16,得到的准确率只有0.11左右,所以我用keras内置的用imagenet训练的VGG16进行微调,训练mnist,准确率达到0.94,得到了很大的提升。 from keras.applications import VGG16 from keras.datasets import mnist from keras.utils import to_categorica...

2020-04-14 12:53:11 2909 2

原创 python报错TypeError: 'int' object is not callable

TypeError: ‘int’ object is not callable 今天用python写程序遇到这个错误,找了好久,原来是逗号忘记写了,一步一步排查出来的,因为定义的函数,如果没有被调用的话,它是不会报错的。 ...

2020-04-13 17:57:16 1370

原创 用keras实现lenet-5

用keras实现lenet-5,代码如下: #建立模型 from keras import models from keras import layers model=models.Sequential() model.add(layers.Conv2D(6,(5,5),activation='relu',padding='same',input_shape=(28,28,1))) model....

2020-04-04 19:54:17 765

原创 用keras复现AlexNet

首先,我们用keras复现一下AlexNet的模型结构: from keras.models import Sequential from keras.layers import Input,Dense,Conv2D,MaxPooling2D,UpSampling2D,Dropout,Flatten from keras.layers import Dropout model = Sequent...

2020-03-31 16:21:56 506

原创 git命令教程

git命令教程 安装git后,在开始菜单里找到“Git”->“Git Bash”,输入下面命令。因为Git是分布式版本控制系统,所以,每个机器都必须自报家门:你的名字和Email地址。 $ git config --global user.name “Your Name” $ git config --global user.email “email@example.com” 命令行: 1....

2020-03-28 23:00:19 151

ResNet50_fashion_mnist.py

用keras实现resnet50,用的数据集是fashion_mnist 实现后准确率是91.3%,损失率是53.7%

2020-04-27

GoogleNet_fashion_mnist.py

用GoogleNet实现fashion_mist数据集,准确率91.3%,损失精度为47.3%

2020-04-23

空空如也

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

TA关注的人

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