日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

TF学习——TF之API:TensorFlow的高级机器学习API—tf.contrib.learn的简介、使用方法、案例应用之详细攻略

發布時間:2025/3/21 编程问答 12 豆豆
生活随笔 收集整理的這篇文章主要介紹了 TF学习——TF之API:TensorFlow的高级机器学习API—tf.contrib.learn的简介、使用方法、案例应用之详细攻略 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

TF學習——TF之API:TensorFlow的高級機器學習API—tf.contrib.learn的簡介、使用方法、案例應用之詳細攻略

?

?

?

?

?

目錄

tf.contrib.learn的簡介

tf.contrib.learn的使用方法

Modules

Classes

Functions

tf.contrib.learn的案例應用


?

?

?

?

?

?

?

tf.contrib.learn的簡介

?tf.contrib.learn?是 TensorFlow 提供的一個機器學習高級 API 模塊,讓用戶可以更方便的配置、訓練和評估各種各樣的機器學習模型,里面內置了很多模型可以直接調用,其實,就是類似最經典的機器學習庫?scikit-learn?的 API 。很多調用方法都很相同。

1、常用的模型

  • 線性分類?tf.contrib.learn.LinearClassifier
  • 線性回歸 tf.contrib.learn.LinearRegressor
  • 邏輯斯諦回歸 tf.contrib.learn.LogisticRegressor
  • K-means 聚類 tf.contrib.learn.KMeansClustering
  • 神經網絡分類器 tf.contrib.learn.DNNClassifier
  • 神經網絡回歸器 tf.contrib.learn.DNNRegressor
  • 廣度深度回歸 tf.contrib.learn.DNNLinearCombinedRegressor
  • 廣度深度分類 tf.contrib.learn.DNNLinearCombinedClassifier

注意:該模塊已被棄用,請仔細查看API說明,https://github.com/tensorflow/tensorflow/blob/r1.13/tensorflow/contrib/learn/README.md
Many canned estimators (subclasses of?Estimator) have equivalents in core exposed under?tf.estimator:?DNNClassifier,?DNNRegressor,?DNNEstimator,?LinearClassifier,?LinearRegressor,?LinearEstimator,?DNNLinearCombinedClassifier,DNNLinearCombinedRegressor?and?DNNLinearCombinedEstimator.

To migrate to the new api, users need to take the following steps:
Replace?tf.contrib.learn?with?tf.estimator.

?

tf.contrib.learn的使用方法

Modules

datasets?module: Dataset utilities and synthetic/reference datasets (deprecated).
graph_actions?module: High level operations on graphs (deprecated).
head?module: Abstractions for the head(s) of a model (deprecated).
io?module: Tools to allow different io formats (deprecated).
learn_runner?module: Utilities to run and tune an Experiment (deprecated).
models?module: Various high level TF models (deprecated).
monitors?module: Monitors instrument the training process (deprecated).
ops?module: Various TensorFlow Ops (deprecated).
preprocessing?module: Preprocessing tools useful for building models (deprecated).
utils?module: TensorFlow Learn Utils (deprecated).

Classes

class BaseEstimator: Abstract BaseEstimator class to train and evaluate TensorFlow models.
class DNNClassifier: A classifier for TensorFlow DNN models.
class DNNEstimator: A Estimator for TensorFlow DNN models with user specified _Head.
class DNNLinearCombinedClassifier: A classifier for TensorFlow Linear and DNN joined training models.
class DNNLinearCombinedEstimator: An estimator for TensorFlow Linear and DNN joined training models.
class DNNLinearCombinedRegressor: A regressor for TensorFlow Linear and DNN joined training models.
class DNNRegressor: A regressor for TensorFlow DNN models.
class DynamicRnnEstimator: Dynamically unrolled RNN (deprecated).
class Estimator: Estimator class is the basic TensorFlow model trainer/evaluator.
class Evaluable: Interface for objects that are evaluatable by, e.g.,?Experiment.
class Experiment: Experiment is a class containing all information needed to train a model.
class ExportStrategy: A class representing a type of model export.
class Head: Interface for the head/top of a model.
class InputFnOps: A return type for an input_fn (deprecated).
class KMeansClustering: An Estimator for K-Means clustering.
class LinearClassifier: Linear classifier model.
class LinearEstimator: Linear model with user specified head.
class LinearRegressor: Linear regressor model.
class MetricSpec: MetricSpec connects a model to metric functions.
class ModeKeys: Standard names for model modes (deprecated).
class ModelFnOps: Ops returned from a model_fn.
class NanLossDuringTrainingError: Unspecified run-time error.
class NotFittedError: Exception class to raise if estimator is used before fitting.
class PredictionKey: THIS CLASS IS DEPRECATED.
class ProblemType: Enum-like values for the type of problem that the model solves.
class RunConfig: This class specifies the configurations for an?Estimator?run.
class SKCompat: Scikit learn wrapper for TensorFlow Learn Estimator.
class SVM: Support Vector Machine (SVM) model for binary classification.
class TaskType: DEPRECATED CLASS.
class Trainable: Interface for objects that are trainable by, e.g.,?Experiment.

Functions

LogisticRegressor(...): Builds a logistic regression Estimator for binary classification.
binary_svm_head(...): Creates a?Head?for binary classification with SVMs. (deprecated)
build_parsing_serving_input_fn(...): Build an input_fn appropriate for serving, expecting fed tf.Examples. (deprecated)
evaluate(...): Evaluate a model loaded from a checkpoint. (deprecated)
extract_dask_data(...): Extract data from dask.Series or dask.DataFrame for predictors. (deprecated)
extract_dask_labels(...): Extract data from dask.Series or dask.DataFrame for labels. (deprecated)
extract_pandas_data(...): Extract data from pandas.DataFrame for predictors. (deprecated)
extract_pandas_labels(...): Extract data from pandas.DataFrame for labels. (deprecated)
extract_pandas_matrix(...): Extracts numpy matrix from pandas DataFrame. (deprecated)
infer(...): Restore graph from?restore_checkpoint_path?and run?output_dict?tensors. (deprecated)
infer_real_valued_columns_from_input(...): Creates?FeatureColumn?objects for inputs defined by input?x. (deprecated)
infer_real_valued_columns_from_input_fn(...): Creates?FeatureColumn?objects for inputs defined by?input_fn. (deprecated)
make_export_strategy(...): Create an ExportStrategy for use with Experiment. (deprecated)
multi_class_head(...): Creates a?Head?for multi class single label classification. (deprecated)
multi_head(...): Creates a MultiHead stemming from same logits/hidden layer. (deprecated)
multi_label_head(...): Creates a Head for multi label classification. (deprecated)
no_op_train_fn(...): DEPRECATED FUNCTION
poisson_regression_head(...): Creates a?Head?for poisson regression. (deprecated)
read_batch_examples(...): Adds operations to read, queue, batch?Example?protos. (deprecated)
read_batch_features(...): Adds operations to read, queue, batch and parse?Example?protos. (deprecated)
read_batch_record_features(...): Reads TFRecord, queues, batches and parses?Example?proto. (deprecated)
read_keyed_batch_examples(...): Adds operations to read, queue, batch?Example?protos. (deprecated)
read_keyed_batch_examples_shared_queue(...): Adds operations to read, queue, batch?Example?protos. (deprecated)
read_keyed_batch_features(...): Adds operations to read, queue, batch and parse?Example?protos. (deprecated)
read_keyed_batch_features_shared_queue(...): Adds operations to read, queue, batch and parse?Exampleprotos.(deprecated)
regression_head(...): Creates a?Head?for linear regression. (deprecated)
run_feeds(...): See run_feeds_iter(). Returns a?list?instead of an iterator. (deprecated)
run_n(...): Run?output_dict?tensors?n?times, with the same?feed_dict?each run. (deprecated)
train(...): Train a model. (deprecated)

?

tf.contrib.learn的案例應用

更新……

?

總結

以上是生活随笔為你收集整理的TF学习——TF之API:TensorFlow的高级机器学习API—tf.contrib.learn的简介、使用方法、案例应用之详细攻略的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。