资源简介
官方例子,深度学习专用,机器学习专用,代码简单,一看就会(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
相关资源
- keras_inception_v4_finetune.py
- densenet121.py
- mnist_acgan.py
- 集成k-最近邻(k-NN)、朴素贝叶斯、
- Python-机器学习完全课程
- Python-Glyce用于汉字表示的字形向量
- 燕大《Python机器学习》实验报告 .do
- 卷积神经网络轴承数故障分类
- python实现谱聚类代码并进行可视化
- 机器学习-python处理UCI鲍鱼数据集.ra
- 利用贝叶斯算法实现垃圾邮件分类
- 利用鸢尾花数据集画出P-R曲线 pytho
- 实战python利用线性回归来预测鲍鱼年
- 实战python线性回归
- python图像裁剪
- 使用训练好的模型进行预测
- Python→Transorflow猫狗识别完整代码,附
- FaceClustering.zip
- Python-RNNoiseRNN音频噪声抑制学习
- Python-Keras实现实时语义分割的深层神
- Python-手势识别使用在TensorFlow中卷积神
- python 机器学习之支持向量机非线性回
- datingTestSet2.txt
- 多层BP神经网络参数高自由度Python
- 目标检测自动标注代码
- 梯度下降python程序实现+可视化
- 基于深度学习的表情识别系统
- 语义分割标注转为目标检测框标注
- keras上LSTM长短期记忆网络金融时序预
- 二项分布的代码可视化实现
评论
共有 条评论