Francis'Blog

加油!奋斗!奥里给!


  • Home

  • Categories

  • About

  • Archives

  • Search

tensorflow模型保存与恢复

Posted on 2019-04-01 | In TensorFlow

1. 什么是TensorFlow模型?

训练了一个神经网络之后,我们希望保存它以便将来使用。那么什么是TensorFlow模型? Tensorflow模型主要包含我们所培训的网络参数的网络设计或图形和值。因此,Tensorflow模型有两个主要的文件:

a) Meta graph:
这是一个协议缓冲区,它保存了完整的Tensorflow图形;即所有变量、操作、集合等。该文件以.meta作为扩展名。

b) Checkpoint file:

​ 这是一个二进制文件,它包含了所有的权重、偏差、梯度和其他所有变量的值。这个文件有一个扩展名.ckpt。然而,Tensorflow从0.11版本中改变了这一点。现在,我们有两个文件,而不是单个.ckpt文件:

  • model.ckpt.data-00000-of-00001
  • model.ckpt.meta

.data文件是包含我们训练变量的文件,我们待会将会使用它。

与此同时,Tensorflow也有一个名为checkpoint的文件,它只保存的最新保存的checkpoint文件的记录。

因此,为了总结,对于大于0.10的版本,Tensorflow模型如下:

1

在0.11之前的Tensorflow模型仅包含三个文件:

  • inception_v1.meta
  • inception_v1.ckpt
  • checkpoint

之后的Tensorflow模型包含多了一个文件

  • model.ckpt.data-00000-of-00001

现在我们已经知道了Tensorflow模型的样子,接下来我们来看看TensorFlow是如何保存模型的。

Read more »

matlab数据处理

Posted on 2019-03-31

Matmab数据处理

Matlab生成正态分布的数据

需要两个指标, 一个是原有数据的平均数(μ)和标准差(σ)

  • 平均数计算函数mean(数据, 维度)
  • 标准差计算函数std(数据, w, 维度)

​ 第二个参数w决定了用哪一个标准差函数,如果取0,则代表除以N-1,如果是1代表的是除以N。

如数据为 data = [1 2 3], 那么 std(data, 0) 计算的结果就是根号sqrt((1+1)/(3-1))=1 , std(data, 1) 计算的结果就是sqrt((1+1)/3)=0.81645了

最后得到正态分布的公式是 标准差* randn(NUM, 1)+平均数

1
new_data(i, :) = std_data(i)*randn(NUM, 1) +mu_data(i);

其中NUM是生成多少个数据, 可以用hist()函数画出生成数据的直方图看看是不是正态分布的

标准化函数

标准化

zscore(data, 0, 1) 1代表列

css选择器

Posted on 2019-03-29 | In css

一个有趣的css选择器小游戏: http://flukeout.github.io/

Adjacent Sibling Selector(兄弟选择器)

Select an element that directly follows another element

A + B

This selects all B elements that directly follow A. Elements that follow one another are called siblings. They’re on the same level, or depth.

In the HTML markup for this level, elements that have the same indentation are siblings.

Examples

p + .intro selects every element with class=”intro” that directly follows a p

div + a selects every a element that directly follows a div

General Sibling Selector(可以选择多个兄弟)

Select elements that follows another element

A ~ B

You can select all siblings of an element that follow it. This is like the Adjacent Selector (A + B) except it gets all of the following elements instead of one.

Examples

A ~ B selects all B that follow a A

Read more »
1234…12
Francis Cheng

Francis Cheng

很惭愧,就做了一点微小的工作。

35 posts
14 categories
16 tags
© 2019 Francis Cheng
Powered by Hexo
Theme - NexT.Gemini