- 博客(32)
- 收藏
- 关注
原创 【Tensorflow 2.0 正式版教程】词嵌入(word embedding)与GLoVe
这篇教程来讲解自然语言处理中的word embedding的实现。简单来说,word embedding是将单词转换为向量,从而进一步参与神经网络的计算。这其中的过程包括由...
2019-12-06 17:27:48
941
原创 【Tensorflow 2.0 正式版教程】tf.data.Dataset的基本使用方法
Tensorflow 2.0中提供了专门用于数据输入的接口tf.data.Dataset,可以简洁高效的实现数据的读入、打乱(shuffle)、增强(augment)等功能。下面以一个简单的实例讲解该功能的基本使用方法。首先手工创建一个非常简单的数据集,该数据包含10个样本,每个样本由1个浮点数组成。data = np.array([0.1, 0.4, 0.6, 0.2, 0.8, 0.8, ...
2019-11-29 16:59:11
2284
原创 【Tensorflow 2.0 正式版教程】模型的保存、加载与迁移
模型的保存和加载可以直接通过Model类的save_weights和load_weights实现。默认的保存格式为tensorflow的checkpoint格式,也可以手动设置保存为h5文件。model.save_weights('weights', save_format='h5')加载时默认为根据网络的拓扑结构进行加载,这适用于不对网络进行更改,直接进行测试的情况。但如果只希望加载部分权...
2019-10-18 20:58:56
801
原创 【Tensorflow 2.0 正式版教程】Batch normalization实现
上一篇教程中讲解了如何实现自定义层,现在我们来实现一个非常特殊且重要的网络层:Batch normalization(批标准化层)。该层的特殊之处是其在训练和测试阶段有着不同的行为,具体来说,该层需要计算出输入batch的均值和方差,然后对该batch的数据进行归一化,即减去均值再除以方差。训练阶段显然可以直接计算,但在测试阶段,每个样本间是没有关系的,即不应该存在batch的概念,那么只能依靠...
2019-10-17 23:12:59
1665
原创 【Tensorflow 2.0 正式版教程】自定义层
本文介绍如何将自定义的运算或操作封装为一个层。首先,任何自定义层都需要继承Layer类,并且需要实现4个类方法class MyLayer(tf.keras.layers.Layer): def __init__(self, **kwargs): super(MyLayer, self).__init__(**kwargs) def build(self...
2019-10-16 21:53:42
561
原创 【Tensorflow 2.0 正式版教程】ResNet分类CIFAR-10
这篇教程我们来实现Kaiming He大神提出的ResNet网络,并在CIFAR-10数据及上进行测试,我的测试结果完全复现了论文中的精度。本文中的参数设置、数据增强等内容均遵循原文。网络搭建ResNet原文: Deep Residual Learning for Image Recognition这篇文章中提出了像下面这样的经典残差结构,关于这种结构的解读可搜索其他文章,在此不多赘述。...
2019-10-14 22:18:39
1326
原创 【Tensorflow 2.0 正式版教程】VGG16
这篇文章我们来搭建一个早期的经典网络VGG16,数据集采用稍复杂的Cifar-10。该数据集Tensorflow同样提供了官方的加载方式(train_images, train_labels, test_images, test_labels) = load_CIFAR('/home/user/Documents/dataset/Cifar-10')train_labels = tf.kera...
2019-10-12 00:00:30
849
原创 【Tensorflow 2.0 正式版教程】CNN(卷积神经网络)
作为教程的第一篇文章,讲解的内容从简、从易,采用官方推荐的代码风格(即采用keras)搭建一个简单的卷积神经网络,数据集也采用最简单的手写字符MNIST。首先,MNIST数据集tensorflow自身提供了加载函数(train_images, train_labels), (test_images, test_labels) = tf.keras.datasets.mnist.load_dat...
2019-10-10 20:38:31
998
原创 【Tensorflow 2.0 正式版教程】前言
2019年10月1日北京时间凌晨2点,谷歌公司献礼70周年发布了Tensorflow2.0正式版。新版的最大特点是将keras加入到了官方代码中,keras的高度封装使得在搭建简单的网络时非常便捷,但同时也造成模型的细节不透明、难以进行创新性更改等问题。此外,目前网络上的教程少之又少,即便有也只能称之为keras教程而不是tensorflow教程(官方的教程亦是如此),而且tensorfl...
2019-10-10 19:42:48
196
原创 Codeforces Round #360 (Div. 2) E. The Values You Can Make
E. The Values You Can Make
2016-07-01 22:27:08
929
原创 Codeforces Beta Round #1 C. Ancient Berland Circus
C. Ancient Berland Circustime limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard outputNowadays all circuses in Berland have a round arena with diam
2016-07-01 16:06:33
284
原创 Codeforces Round #359 (Div. 2) D. Kay and Snowflake
D. Kay and Snowflaketime
2016-07-01 14:18:14
407
原创 Codeforces Round #359 (Div. 2) C. Robbers' watch
C. Robbers’ watchtime limit per test
2016-07-01 14:05:19
475
原创 Codeforces Round #358 (Div. 2) D. Alyona and Strings
D. Alyona and Stringstime limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputAfter returned from forest, Alyona started reading a book. She n
2016-06-21 01:15:00
355
原创 Codeforces Round #358 (Div. 2) C. Alyona and the Tree
C. Alyona and the Treetime limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputAlyona decided to go on a diet and went to the forest to get som
2016-06-21 01:02:45
285
原创 Codeforces Round #357 (Div. 2) E. Runaway to a Shadow
E. Runaway to a Shadowtime limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputDima is living in a dormitory, as well as some cockroaches.At th
2016-06-21 00:53:42
648
原创 Codeforces Round #357 (Div. 2) D. Gifts by the List
D. Gifts by the Listtime limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputSasha lives in a big happy family. At the Man’s Day all the men of
2016-06-15 14:09:35
551
原创 Codeforces Round #357 (Div. 2) C. Heap Operations
C. Heap Operationstime limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputPetya has recently learned data structure named “Binary heap”.The he
2016-06-15 13:53:14
283
原创 Educational Codeforces Round 13 E. Another Sith Tournament
E. Another Sith Tournamenttime limit per test 2.5 seconds memory limit per test 256 megabytes input standard input output standard outputThe rules of Sith Tournament are well known to everyone.
2016-06-14 22:45:22
699
原创 AIM Tech Round [div2] C. Graph and String
AIM Tech Round [div2] C. Graph and String
2016-02-09 23:51:53
389
原创 第一篇文章,做个纪念吧
今天是2月9日大年初二,开通了这个博客督促自己认真打题目前真的是很菜,高中没有接触过信息竞赛,大学又是大二才想搞ACM,从起点就比别人低到不知道哪里去。现在这个阶段的目标是先看完买的3本书的内容吧,并且CF上的比赛坚持参加
2016-02-09 13:21:23
351
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人