资源简介
google于2016年发表的论文"Wide & Deep Learning for Recommender Systems"里面的代码;
全套工程文件+数据集+调试过程;
经过tf版本升级之后,通过调试,没有问题;
其他小问题可以参考我写的“调试过程”

代码片段和文件信息
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License Version 2.0 (the “License“);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing software
# distributed under the License is distributed on an “AS IS“ BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
“““Download and clean the Census Income Dataset.“““
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import sys
from six.moves import urllib
import tensorflow as tf
DATA_URL = ‘https://archive.ics.uci.edu/ml/machine-learning-databases/adult‘
TRAINING_FILE = ‘adult.data‘
TRAINING_URL = ‘%s/%s‘ % (DATA_URL TRAINING_FILE)
EVAL_FILE = ‘adult.test‘
EVAL_URL = ‘%s/%s‘ % (DATA_URL EVAL_FILE)
parser = argparse.ArgumentParser()
parser.add_argument(
‘--data_dir‘ type=str default=‘./‘
help=‘Directory to download census data‘)
def _download_and_clean_file(filename url):
“““Downloads data from url and makes changes to match the CSV format.“““
temp_file _ = urllib.request.urlretrieve(url)
with tf.gfile.Open(temp_file ‘r‘) as temp_eval_file:
with tf.gfile.Open(filename ‘w‘) as eval_file:
for line in temp_eval_file:
line = line.strip()
line = line.replace(‘ ‘ ‘‘)
if not line or ‘‘ not in line:
continue
if line[-1] == ‘.‘:
line = line[:-1]
line += ‘\n‘
eval_file.write(line)
tf.gfile.Remove(temp_file)
def main(_):
if not tf.gfile.Exists(FLAGS.data_dir):
tf.gfile.MkDir(FLAGS.data_dir)
training_file_path = os.path.join(FLAGS.data_dir TRAINING_FILE)
_download_and_clean_file(training_file_path TRAINING_URL)
eval_file_path = os.path.join(FLAGS.data_dir EVAL_FILE)
_download_and_clean_file(eval_file_path EVAL_URL)
if __name__ == ‘__main__‘:
FLAGS unparsed = parser.parse_known_args()
tf.app.run(argv=[sys.argv[0]] + unparsed)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 228 2018-08-10 14:49 wide_deep\wide_deep\.idea\inspectionProfiles\profiles_settings.xm
文件 213 2018-08-10 14:49 wide_deep\wide_deep\.idea\misc.xm
文件 270 2018-08-10 14:49 wide_deep\wide_deep\.idea\modules.xm
文件 459 2018-08-10 14:49 wide_deep\wide_deep\.idea\wide_deep.iml
文件 24867 2018-08-10 17:45 wide_deep\wide_deep\.idea\workspace.xm
文件 3518450 2018-08-10 15:01 wide_deep\wide_deep\data\adult.data
文件 1758916 2018-08-10 15:02 wide_deep\wide_deep\data\adult.test
文件 2412 2018-08-10 14:57 wide_deep\wide_deep\data_download.py
文件 172 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\checkpoint
文件 1069939 2018-08-10 16:45 wide_deep\wide_deep\model\wide_component\eval\events.out.tfevents.1533890712.20160331-6353
文件 1069945 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\eval\events.out.tfevents.1533894224.20160331-6353
文件 1857809 2018-08-10 16:45 wide_deep\wide_deep\model\wide_component\events.out.tfevents.1533890706.20160331-6353
文件 1857812 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\events.out.tfevents.1533894219.20160331-6353
文件 1068593 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\graph.pbtxt
文件 8 2018-08-10 16:45 wide_deep\wide_deep\model\wide_component\model.ckpt-0.data-00000-of-00002
文件 36600 2018-08-10 16:45 wide_deep\wide_deep\model\wide_component\model.ckpt-0.data-00001-of-00002
文件 1265 2018-08-10 16:45 wide_deep\wide_deep\model\wide_component\model.ckpt-0.index
文件 513281 2018-08-10 16:45 wide_deep\wide_deep\model\wide_component\model.ckpt-0.me
文件 8 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\model.ckpt-128.data-00000-of-00002
文件 36600 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\model.ckpt-128.data-00001-of-00002
文件 1265 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\model.ckpt-128.index
文件 513281 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\model.ckpt-128.me
文件 8 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\model.ckpt-64.data-00000-of-00002
文件 36600 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\model.ckpt-64.data-00001-of-00002
文件 1265 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\model.ckpt-64.index
文件 513281 2018-08-10 17:43 wide_deep\wide_deep\model\wide_component\model.ckpt-64.me
文件 277 2018-08-11 10:20 wide_deep\wide_deep\model\wide_deep\checkpoint
文件 1229922 2018-08-10 16:36 wide_deep\wide_deep\model\wide_deep\eval\events.out.tfevents.1533890175.20160331-6353
文件 1229922 2018-08-10 17:06 wide_deep\wide_deep\model\wide_deep\eval\events.out.tfevents.1533891942.20160331-6353
文件 1229925 2018-08-10 17:11 wide_deep\wide_deep\model\wide_deep\eval\events.out.tfevents.1533892254.20160331-6353
............此处省略40个文件信息
- 上一篇:基于微信小程序外卖点餐系统 开题报告
- 下一篇:加密狗破解工具 et199专用
相关资源
- umeshmotion网格推移
- 用foobar2000听google音乐[更新一下]
- Google Earth KML文件生成工具
- google earth 高程点坐标提取软件
- 推箱子及人工智能寻路C 源代码
- 协同过滤算法源码
- 中网公司联合Intel推出中小企业网络解
- MQTT推送Demo
- scratch 推箱子.sb2
- 手性介质中漩涡的动力学:手性推进
- 基于四元数的Chern–Simons理论在任
- 稳健中推进 天津市第一中心医院的信
- 深海推进器用永磁无刷直流电机损耗
- HDS推出服务型存储解决方案
- HDS推出经济适用的USP VM 满足企业虚拟
- 3G展力促融合中兴通讯推IMS解决方案
- 中兴通讯推IMS解决方案
- QLogic与IBM携手推出中小企业SAN存储解
- QLogic与IBM携手推出中小企业SAN解决方
- LSI将推出企业级SAS解决方案
- 乘势借力再推民爆产品质量上台阶
- 代码之美高清中文版,强烈推荐!
- 推荐给大家一个非常好用的串口工具
- Google架构安全白皮书
- 江苏省燕尾港天文潮的推算
- IBM推出易捷TS2230存储计划解决方案
- 富士通推出 FUJITSU ETERNUS 8000
- Butterfly.net通过按需计算推动下一代游
- 桌面虚拟化的推动力、难题和最佳实
- Promise推出串行ATA RAID 5解决方案
评论
共有 条评论