资源简介
官方例子,深度学习专用,机器学习专用,代码简单,一看就会(tensorflow random forest demo)
代码片段和文件信息
“““ Random Forest.
Implement Random Forest algorithm with TensorFlow and apply it to classify
handwritten digit images. This example is using the MNIST database of
handwritten digits as training samples (http://yann.lecun.com/exdb/mnist/).
Author: Aymeric Damien
Project: https://github.com/aymericdamien/TensorFlow-Examples/
“““
from __future__ import print_function
import tensorflow as tf
from tensorflow.contrib.tensor_forest.python import tensor_forest
from tensorflow.python.ops import resources
# Ignore all GPUs tf random forest does not benefit from it.
import os
os.environ[“CUDA_VISIBLE_DEVICES“] = ““
# Import MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets(“/tmp/data/“ one_hot=False)
# Parameters
num_steps = 500 # Total steps to train
batch_size = 1024 # The number of samples per batch
num_classes = 10 # The 10 digits
num_features = 784 # Each image is 28x28 pixels
num_trees = 10
max_nodes = 1000
# Input and Target data
X = tf.placeholder(tf.float32 shape=[None num_features])
# For random forest labels must be integers (the class id)
Y = tf.placeholder(tf.int32 shape=[None])
# Random Forest Parameters
hparams = tensor_forest.ForestHParams(num_classes=num_classes
num_features=num_features
num_trees=num
相关资源
- 7.图像风格迁移 基于深度学习 pyt
- 机器学习(周志华)配套代码
- 机器学习-岭回归实现
- dronet源码+论文(深度学习)
- 012345手势识别神经网络代码
- 猫-非猫图二分类识别
- 深度学习(SPOT-RNA)
- 机器学习k means算法实现图像分割
- kmeans聚类算法的python实现程序
- Python100经典练习题
- 南瓜书(PumpkinBook)
- 深度学习YOLOv3分类算法
- 机器学习numpy和pandas基础
- python机器学习Sebastian Raschka中文最新完
- Python-DeepMoji模型的pyTorch实现
- Deep Learning Cookbook_ practical recipes to g
- 《机器学习实战》源代码Python3
- 深度学习视频中的行为识别
- Python-使用DeepFakes实现YouTube视频自动换
- deep learning with python 中文版
- Introduction to machine learning with python (
- python新浪微博爬虫,爬取微博和用户
- Python-一系列高品质的动漫人脸数据集
- Python-Insightface人脸检测识别的最小化
- 非线性回归Python代码
- 093 2018北风网人工智能视频(完结)转
- python的色情图片识别
- 贝叶斯网络程序
- 吴恩达深度学习超参数调制完整程序
- 《机器学习实战》Python3代码
评论
共有 条评论