欢迎Follow我的GitHub
本文地址:http://blog.csdn.net/caroline_wendy/article/details/77639573
自编码器,使用稀疏的高阶特征重新组合,来重构自己,输入与输出一致。
TensorFlow的框架,参考
源码,同时,复制autoencoder_models
的模型文件。
本文源码的GitHub地址
工程配置
下载Python的依赖库:scikit-learn==0.19.0
、scipy==0.19.1
、sklearn==0.0
scipy
如果安装scipy出错,则把scipy==0.19.1
写入requestments.txt,再安装,错误如下:
THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
scipy from http://mirrors.aliyun.com/pypi/packages/63/68/c5098f3b6034e69d187e3f2e989f462143d9f8b524f5a4f9e13c4a6f5f47/scipy-0.19.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl#md5=72415e8da753eea97eb9820602931cb5:
Expected md5 72415e8da753eea97eb9820602931cb5
Got 073584eb2c597bbfb82a5865b7055787
或者,直接编写requestments.txt,全部安装
pip install -r requirements.txt
matplotlib
安装matplotlib
pip install matplotlib -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
如果安装matplotlib报错,如下:
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.
则执行Shell命令
cd ~/.matplotlib
touch matplotlibrc
导入matplotlib
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt