<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Ml,dl on My Blog</title><link>/tags/mldl/</link><description>Recent content in Ml,dl on My Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 15 Jul 2016 00:00:00 +0000</lastBuildDate><atom:link href="/tags/mldl/index.xml" rel="self" type="application/rss+xml"/><item><title>keras图像预处理</title><link>/2016/07/15/keras%E5%9B%BE%E5%83%8F%E9%A2%84%E5%A4%84%E7%90%86/</link><pubDate>Fri, 15 Jul 2016 00:00:00 +0000</pubDate><guid>/2016/07/15/keras%E5%9B%BE%E5%83%8F%E9%A2%84%E5%A4%84%E7%90%86/</guid><description>&lt;!-- toc --&gt;
&lt;p&gt;[TOC]&lt;/p&gt;
&lt;h2 id="class-imagedatagenerator"&gt;class: ImageDataGenerator&lt;/h2&gt;
&lt;p&gt;生成批次的带实时数据增益的张量图像数据。数据将按批次无限循环。&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;keras.preprocessing.image.ImageDataGenerator(featurewise_center=False,
samplewise_center=False,
featurewise_std_normalization=False,
samplewise_std_normalization=False,
zca_whitening=False,
zca_epsilon=1e-6,
rotation_range=0.,
width_shift_range=0.,
height_shift_range=0.,
shear_range=0.,
zoom_range=0.,
channel_shift_range=0.,
fill_mode=&amp;#39;nearest&amp;#39;,
cval=0.,
horizontal_flip=False,
vertical_flip=False,
rescale=None,
preprocessing_function=None,
data_format=K.image_data_format())
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;常用参数：&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;rotation_range: 整数。随机旋转的度数范围。
width_shift_range: 浮点数（总宽度的比例）。随机水平移动的范围。
height_shift_range: 浮点数（总高度的比例）。随机垂直移动的范围。
shear_range: 浮点数。剪切强度（以弧度逆时针方向剪切角度）。
zoom_range: 浮点数 或 [lower, upper]。随机缩放范围。如果是浮点数，[lower, upper] = [1-zoom_range, 1+zoom_range]。
channel_shift_range: 浮点数。随机通道转换的范围。
fill_mode: {&amp;#34;constant&amp;#34;, &amp;#34;nearest&amp;#34;, &amp;#34;reflect&amp;#34; or &amp;#34;wrap&amp;#34;} 之一。输入边界以外的点根据给定的模式填充：
&amp;#34;constant&amp;#34;: kkkkkkkk|abcd|kkkkkkkk (cval=k)
&amp;#34;nearest&amp;#34;: aaaaaaaa|abcd|dddddddd
&amp;#34;reflect&amp;#34;: abcddcba|abcd|dcbaabcd
&amp;#34;wrap&amp;#34;: abcdabcd|abcd|abcdabcd
cval: 浮点数或整数。当 fill_mode = &amp;#34;constant&amp;#34; 时，用于边界之外的点的值。
horizontal_flip: 布尔值。随机水平翻转。
vertical_flip: 布尔值。随机垂直翻转。
rescale: 重缩放因子。默认为 None。如果是 None 或 0，不进行缩放，否则将数据乘以所提供的值（在应用任何其他转换之前）。
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="类的方法"&gt;类的方法&lt;/h2&gt;
&lt;p&gt;类的方法我就用了两个：&lt;code&gt;flow&lt;/code&gt; 和&lt;code&gt;flow_from_directory&lt;/code&gt;&lt;/p&gt;</description></item></channel></rss>