精华内容
下载资源
问答
  • Aircap_Pose_Estimator 获取此仓库: git clone https://github.com/robot-perception-group/Aircap_Pose_Estimator.git 数据 转到 ,注册并登录。 从下载AirCap-Pose_Estimator-minimaldata 将内容(名为“ data...
  • tf.estimator.Estimator讲解

    千次阅读 2018-12-15 22:39:00
    tf.estimator.Estimator 简单介绍 是一个class 所以需要初始化,作用是用来 训练和评价 tensorflow 模型的 Estimator对象包装由一个名为model_fn函数指定的模型,model_fn在给定输入和许多其他参数的情况下,返回...

    tf.estimator.Estimator

    简单介绍

    是一个class 所以需要初始化,作用是用来 训练和评价 tensorflow 模型的
    Estimator对象包装由一个名为model_fn函数指定的模型,model_fn在给定输入和许多其他参数的情况下,返回执行训练、评估或预测所需的操作。所有输出(checkpoints, event files, etc.等)都写入model_dir或其子目录。如果没有设置model_dir,则使用临时目录。

    初始化

    __init__(
        model_fn,
        model_dir=None,
        config=None,
        params=None,
        warm_start_from=None
    )
    
    '''
    
    
    
    Args:
    	model_fn: Model function. Follows the signature:
    	Args:
    		features:  是从 input_fn中返回的词典tensor 或者 单个tensor ;其实质就是模型的输入(以前我们都是用tf.placeholder输入的,这里使用input_fn 函数返回)  This is the first item returned from the input_fn
    		labels:  是从 input_fn中返回的词典tensor 或者 单个tensor,注意,如果mode=tf.estimator.ModeKeys.PREDICT(就是在预测的时候), labels将会被设置为None  This is the second item returned from the input_fn
    		mode: Optional. Specifies if this training, evaluation or prediction. See tf.estimator.ModeKeys.
    		params: Optional dict of hyperparameters.接受初始化Estimator实例时的参数params 
    		config: Optional estimator.RunConfig object.接受初始化Estimator实例时的参数config  或者一个默认的值. Allows setting up things in your model_fn based on configuration such as num_ps_replicas, or model_dir.
    		Returns: tf.estimator.EstimatorSpec  这里一定要注意 返回的是EstimatorSpec实例
    
    
    	model_dir: 输出路径,有关模型的输出的一切东西,全部输出在这里
    	
    	config: 这个是一个类,是官方固定的配置参数,如果用户觉得,不能满足使用,需要添加自己的参数,可以使用下面的这个参数params
    	
    	params: dict of hyper parameters that will be passed into model_fn. Keys are names of parameters, values are basic python types.
    	
    	warm_start_from: Optional string filepath to a checkpoint or SavedModel to warm-start from, or a tf.estimator.WarmStartSettings object to fully configure warm-starting. If the string filepath is provided instead of a tf.estimator.WarmStartSettings, then all variables are warm-started, and it is assumed that vocabularies and tf.Tensor names are unchanged.
    '''
    
    

    重点圈出

    The config argument can be passed tf.estimator.RunConfig object containing information about the execution environment. It is passed on to the model_fn, if the model_fn has a parameter named “config” (and input functions in the same manner). If the config parameter is not passed, it is instantiated by the Estimator. Not passing config means that defaults useful for local execution are used. Estimator makes config available to the model (for instance, to allow specialization based on the number of workers available), and also uses some of its fields to control internals, especially regarding checkpointing.

    The params argument contains hyperparameters. It is passed to the model_fn, if the model_fn has a parameter named “params”, and to the input functions in the same manner. Estimator only passes params along, it does not inspect it. The structure of params is therefore entirely up to the developer.

    方法

    train 方法

    从input_fn 获取数据,用来训练模型

    train(
        input_fn,
        hooks=None,
        steps=None,
        max_steps=None,
        saving_listeners=None
    )
    
    '''
    Args:
    	input_fn: A function that provides input data for training as minibatches. See Premade Estimators for more information. The function should construct and return one of the following: * A tf.data.Dataset object: Outputs of Dataset object must be a tuple (features, labels) with same constraints as below. * A tuple (features, labels): Where features is a tf.Tensor or a dictionary of string feature name to Tensor and labels is a Tensor or a dictionary of string label name to Tensor. Both features and labels are consumed by model_fn. They should satisfy the expectation of model_fn from inputs.
    	hooks: List of tf.train.SessionRunHook subclass instances. Used for callbacks inside the training loop.
    	steps: Number of steps for which to train the model. If None, train forever or train until input_fn generates the tf.errors.OutOfRange error or StopIteration exception. steps works incrementally. If you call two times train(steps=10) then training occurs in total 20 steps. If OutOfRange or StopIteration occurs in the middle, training stops before 20 steps. If you don't want to have incremental behavior please set max_steps instead. If set, max_steps must be None.
    	max_steps: Number of total steps for which to train model. If None, train forever or train until input_fn generates the tf.errors.OutOfRange error or StopIteration exception. If set, steps must be None. If OutOfRange or StopIteration occurs in the middle, training stops before max_steps steps. Two calls to train(steps=100) means 200 training iterations. On the other hand, two calls to train(max_steps=100) means that the second call will not do any iteration since first call did all 100 steps.
    	saving_listeners: list of CheckpointSaverListener objects. Used for callbacks that run immediately before or after checkpoint savings.
    Returns:
    	self, for chaining.
    
    '''
    

    主要参数说明

    input_fn:是一个为训练提供输入数据的函数(每次提供一个batch_size的数据),其返回的是的格式是(features,labels),正好作为mode_fn的输入,其返回的格式应该是下列之一:

    1. tf.data.Dataset object: Outputs of Dataset object must be a tuple (features, labels)
    2. A tuple (features, labels): Where features is a tf.Tensor or a dictionary of string feature name to Tensor and labels is a Tensor or a dictionary of string label name to Tensor

    max_steps:最大训练多少step(也就是训练多少个batch_size),当我们暂停后,继续训练程序会检测目前已经训练的步数是否大于max_steps若大于等于,那么就不会继续训练(On the other hand, two calls to train(max_steps=100) means that the second call will not do any iteration since first call did all 100 steps.

    step:会在原来的基础上,继续“增长式”训练,例如你调用了两次train(input_fn,step=10),那么模型就相当于训练了20个迭代

    evaluate 方法

    Evaluates the model given evaluation data input_fn.
    For each step, calls input_fn, which returns one batch of data. Evaluates until: - steps batches are processed, or - input_fn raises an end-of-input exception获取input_fn返回的数据并输入到模型中,用来评价模型每一步都调用一次input_fn,其返回one batch of data,知道等于steps 或者input_fn raises an end-of-input exception

    evaluate(
        input_fn,
        steps=None,
        hooks=None,
        checkpoint_path=None,
        name=None
    )
    
    '''
    Args:
    		input_fn: A function that constructs the input data for evaluation. See Premade Estimators for more information. The function should construct and return one of the following: * A tf.data.Dataset object: Outputs of Dataset object must be a tuple (features, labels) with same constraints as below. * A tuple (features, labels): Where features is a tf.Tensor or a dictionary of string feature name to Tensor and labels is a Tensor or a dictionary of string label name to Tensor. Both features and labels are consumed by model_fn. They should satisfy the expectation of model_fn from inputs.
    		steps: Number of steps for which to evaluate model. If None, evaluates until input_fn raises an end-of-input exception.
    		hooks: List of tf.train.SessionRunHook subclass instances. Used for callbacks inside the evaluation call.
    		checkpoint_path: Path of a specific checkpoint to evaluate. If None, the latest checkpoint in model_dir is used. If there are no checkpoints in model_dir, evaluation is run with newly initialized Variables instead of ones restored from checkpoint.
    		name: Name of the evaluation if user needs to run multiple evaluations on different data sets, such as on training data vs test data. Metrics for different evaluations are saved in separate folders, and appear separately in tensorboard.
    
    Returns:
    		A dict containing the evaluation metrics specified in model_fn keyed by name, as well as an entry global_step which contains the value of the global step for which this evaluation was performed. For canned estimators, the dict contains the loss (mean loss per mini-batch) and the average_loss (mean loss per sample). Canned classifiers also return the accuracy. Canned regressors also return the label/mean and the prediction/mean.
    '''
    

    参数说明

    具体的参数和train方法类似,就不说了,这里主要说一下 这个方法的返回(return)
    返回的是一个词典,是在mode_fn中提前指定好的,同时还会返回执行了多少step
    例如在model_fn函数中一般有如下类似定义:

        estim_specs=tf.estimator.EstimatorSpec(
            mode=mode,
            predictions=pred_classes,
            loss=loss_op,
            train_op=train_op,
            eval_metric_ops={"accuracy":acc_op})
    

    中的 eval_metric_ops={“accuracy”:acc_op}),最后会输出类似这种

    {'accuracy': 0.9192, 'loss': 0.28470048, 'global_step': 1000}
    

    predict方法

    predict(
        input_fn,
        predict_keys=None,
        hooks=None,
        checkpoint_path=None,
        yield_single_examples=True
    )
    
    '''
    Args:
    	input_fn: A function that constructs the features. Prediction continues until input_fn raises an end-of-input exception (tf.errors.OutOfRangeError or StopIteration). See Premade Estimators for more information. The function should construct and return one of the following:
    	
    	A tf.data.Dataset object: Outputs of Dataset object must have same constraints as below.
    	features: A tf.Tensor or a dictionary of string feature name to Tensor. features are consumed by model_fn. They should satisfy the expectation of model_fn from inputs.
    	A tuple, in which case the first item is extracted as features.
    	predict_keys: list of str, name of the keys to predict. It is used if the tf.estimator.EstimatorSpec.predictions is a dict. If predict_keys is used then rest of the predictions will be filtered from the dictionary. If None, returns all.
    	
    	hooks: List of tf.train.SessionRunHook subclass instances. Used for callbacks inside the prediction call.
    	
    	checkpoint_path: Path of a specific checkpoint to predict. If None, the latest checkpoint in model_dir is used. If there are no checkpoints in model_dir, prediction is run with newly initialized Variables instead of ones restored from checkpoint.
    	
    	yield_single_examples: If False, yields the whole batch as returned by the model_fn instead of decomposing the batch into individual elements. This is useful if model_fn returns some tensors whose first dimension is not equal to the batch size.
    '''
    

    说明

    给定输入,返回在model_fn中指定要输出的内容tf.estimator.EstimatorSpec(mode,predictions=pred_classes)

        ....
        ....
        
        pred_classes=tf.argmax(logits,axis=1)
        pred_probas=tf.nn.softmax(logits)
        
        #PREDICTS
        if mode==tf.estimator.ModeKeys.PREDICT:
            return tf.estimator.EstimatorSpec(mode,predictions=pred_classes)
        .....
        ......
            
    

    具体参数和trian 方法的参数基本相同,就不多说,这里重点讲一下下面几个:
    predict_keys: 是一个str类型的list,如果使用这个predict_keys,那么模型只会返回predictions 中和predict_keys相同的key的值
    **checkpoint_path:**要预测的特定检查点的路径。如果没有,则使用model_dir中的最新检查点。如果在model_dir中没有检查点,则使用新初始化的变量而不是从检查点恢复的变量运行预测
    yield_single_examples: 如果为False,则生成model_fn返回的整个批,而不是将批分解为单个元素。如果model_fn返回其第一维不等于批处理大小的一些张量,则这很有用。

    展开全文
  • tensorflow的estimator 以及用来estimator. predict()得到result后,如何像estimator.estimate一样出测试准确率之类的结果? 可以看到tensorflow有这么多个接口 Layers:用来构建网络结构 Datasets: ...
    tensorflow的estimator
    以及用来estimator. predict()得到result后,如何像estimator.estimate一样出测试准确率之类的结果?
     
    可以看到tensorflow有这么多个接口
    • Layers:用来构建网络结构
    • Datasets: 用来构建数据读取pipeline
    • Metrics:用来评估网络性能

    Estimator使用步骤

    • 创建一个或多个输入函数,即 input_fn
    • 定义模型的特征列,即 feature_columns
    • 实例化 Estimator,指定特征列和各种超参数。
    • 在 Estimator 对象上调用一个或多个方法,传递适当的输入函数作为数据的来源。 (train, evaluate, predict)
     
     
     
    展开全文
  • 基础Estimator #--coding:utf-8-- import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data tf.logging.set_verbosity(tf.logging.INFO) mnist = input_data....

    基础Estimator

    #--coding:utf-8--
    import numpy as np
    import tensorflow as tf
    from tensorflow.examples.tutorials.mnist import input_data
    
    tf.logging.set_verbosity(tf.logging.INFO)
    mnist = input_data.read_data_sets()
    
    #指定网络输入,所有这里指定的输入都会拼接起来作为整个网络的输入
    feature_cloumns = [tf.feature_column.numeric_column("image", shape=[784])]
    
    
    """
    #通过Tensorflow提供的封装好的Estimator定义网络模型。
    
      Arguments:
        features_cloumns:神经网络输入层需要的数据
        hidden_units:神经网络的结构 注意 DNNClassifier只能定义多层全连接神经网络 而hidden则给出了每一层隐藏层的节点个数
        n_classes:总共类目的数目
        optimizer:所使用的优化函数
        model_dir:将训练过程中loss的变化以及一些其他指标保存到此目录,通过TensorBoard可以可视化
    """
    estimator = tf.estimator.DNNClassifier(
        feature_columns=feature_cloumns,
        hidden_units=[500],
        n_classes=10,
        optimizer=tf.train.AdamOptimizer(),
        model_dir="~~"
    )
    
    train_input_fn = tf.estimator.inputs.numpy_input_fn(
        x={"image":mnist.train.images},
        y=mnist.train.labels.astype(np.int32),
        num_epochs=None,
        batch_size=128,
        shuffle=True
    )
    
    #训练模型 注意 此处没有定义损失函数 ,通过DNN定义的模型会使用交叉上作为损失函数
    estimator.train(input_fn=train_input_fn, steps=10000)
    
    #定义测试时的数据输入
    test_input_fn = tf.estimator.inputs.numpy_input_fn(
        x={"image":mnist.train.images},
        y=mnist.train.labels.astype(np.int32),
        num_epochs=1,
        batch_size=128,
        shuffle=False
    )
    
    accuracy_score = estimator.evaluate(input_fn=test_input_fn)["accuracy"]
    print("\nTest accuracy: %g %%" %(accuracy_score * 100))
    

     

    自定义Estimator

    # --coding:utf-8--
    import numpy as np
    import tensorflow as tf
    from tensorflow.examples.tutorials.mnist import input_data
    
    tf.logging.set_verbosity(tf.logging.INFO)
    
    
    # 通过tf.layers来定义模型结构。可以使用原生态tf api或者其他高层封装。
    def lenet(x, is_training):
        x = tf.reshape(x, shape=[-1, 28, 28, 1])
    
        net = tf.layers.conv2d(x, 32, 5, activation=tf.nn.relu)
        net = tf.layers.max_pooling2d(net, 2, 2)
        net = tf.layers.conv2d(net, 64, 3, activation=tf.nn.relu)
        net = tf.layers.max_pooling2d(net, 2, 2)
        net = tf.contrib.layers.flatten(net)
        net = tf.layers.dense(net, 1024)
        net = tf.layers.dropout(net, rate=0.4, training=is_training)
        return tf.layers.dense(net, 10)
    
    
    """
    #自定义estimator中使用的模型。
    
      Arguments:
        features:输入函数中会提供的输入层张亮。这是一个字典,字典里的内容是通过tf.estimator.inputs.numpy_input_fn中x参数的内容指定的。
        label:正确分类标签,这个字段的内容是通过numpy_input_fn中y参数给出,
        mode:train/evaluate/predict
        params:字典  超参数
    """
    def model_fn(featuers, labels, mode, params):
        predict = lenet(featuers["image"], mode == tf.estimator.ModeKeys.TRAIN)
        #如果在预测模式 只需要将结果返回
        if mode == tf.estimator.ModeKeys.PREDICT:
            #使用EstimatorSpec传递返回值,并通过predictions参数指定返回的结果
                return tf.estimator.EstimatorSpec(mode = mode, predictions={"result":tf.argmax(predict, 1)})
        #定义损失
        loss = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits=predict, labels=labels))
        optimizer = tf.train.GradientDescentOptimizer(learning_rate=params["learning_rate"])
    
        #定义训练过程
        train_op = optimizer.minimize(loss=loss, global_step=tf.train.get_global_step())
        #定义评测标准
        eval_metric_ops = {"my_metric": tf.metrics.accuracy(tf.argmax(predict, 1), labels)}
    
        #返回模型训练过程需要使用的损失函数、训练过程和评测方法
        return tf.estimator.EstimatorSpec(mode=mode, loss=loss, train_op=train_op, eval_metric_ops=eval_metric_ops)
    
    mnist = input_data.read_data_sets("/path/to/MNIST_data", one_hot=False)
    
    #通过自定义的方式生成Esttimator类,这里需要提供模型定义的函数并通过params参数指定模型定义时使用的超参数
    model_params = {"learning_rate": 0.01}
    estimator = tf.estimator.Estimator(model_fn=model_fn, params=model_params)
    
    #训练
    train_input_fn = tf.estimator.inputs.numpy_input_fn(
        x={"image": mnist.train.images},
        y=mnist.train.labels.astype(np.int32),
        num_epochs=None,
        batch_size=128,
        shuffle=True
    )
    estimator.train(input_fn=train_input_fn, steps=30000)
    test_input_fn = tf.estimator.inputs.numpy_input_fn(
        x={"image": mnist.test.images},
        y=mnist.test.labels.astype(np.int32),
        num_epochs=1,
        batch_size=128,
        shuffle=False
    )
    test_results = estimator.evaluate(input_fn=test_input_fn)
    
    #这里的my_metric中的内容就是model_fn中eval_metric_ops定义的评测指标
    accuracy_score = test_results["my_metric"]
    print("\nTest accuracy: %g %%" % (accuracy_score * 100))
    
    predict_input_fn = tf.estimator.inputs.numpy_input_fn(
        x={"image": mnist.test.images[:10]},
        num_epochs=1,
        shuffle=False
    )
    predictions = estimator.predict(input_fn=predict_input_fn)
    
    for i, p in enumerate(predictions):
        print("Prediction %s: %s" % (i + 1, p["result"]))
    

     

    展开全文
  • Estimator详解

    2020-07-24 10:29:55
    Estimator Estimator是tensorflow推出的一个High level的API,用于简化机器学习 Estimator的优点 开发方便 方便整合其它tensorflow高阶api 单机和分布式代码一致 不必关系一些机器学习中的细节,比如(loading ...

    Estimator

    Estimator是tensorflow推出的一个High level的API,用于简化机器学习

    Estimator的优点

    1. 开发方便
    2. 方便整合其它tensorflow高阶api
    3. 单机和分布式代码一致
    4. 不必关系一些机器学习中的细节,比如(loading model、saving model、loging)等

    Estimator概述

    Estimator是谷歌为了简化和规范化机器学习编程过程而提出来的,它封装了以下几个部分:

    • 训练( training )
    • 评估 ( evaluation )
    • 预测 ( prediction )
    • 模型输出 ( export for serving )
      其中,前三部分都是再model_fn函数中定义的。

    model_fn

    model_fn函数用于构建自定义的模型及训练、预测方法

    import tensorflow as tf
    def model_fn(features, labels, mode, params):
    """features,labels,mode为固定参数,其中features,labels是通过input_fn传输过来的,mode则是estimator传过来用于判断训练、预测、测试过程的,不同的过程需要返回不同的结构。
    """
    lr = params['lr']
    try:
      init_checkpoint = params['init_checkpoint']
    except KeyError:
      init_checkpoint = None
    
    x = features['inputs']
    y = features['labels]
    
    # ##########这里定义自己的网络模型##########
    pre = tf.layers.dense(x, 1)
    loss = tf.reduce_mean(tf.pow(pre - y, 2), name='loss')
    # #######################################
    
    # 加载预训练模型
    assignment_map = dict()
    if init_checkpoint:
      for var in tf.train.list_variables(init_checkpoint): # 存放checkpoint的变量名称和shape
        assignment_map[var[0]] = var[0]
      tf.train.init_from_checkpoint(init_checkpoint, assignment_map)
    
    # 定义你训练过程要做的事情
    if mode == tf.estimator.ModeKeys.Train:
      optimizer = tf.train.AdamOptimizer(lr)
      train_op = optimizer.minimize(loss, global_step=tf.train.get_global_step())
      output_spec = tf.estimator.EstimatorSpec(mode, loss=loss, train_op=train_op)
    
    # 定义测试过程
    elif mode == tf.estimator.ModeKeys.EVAL:
      metrics = {'eval_loss': loss}
      output_spec = tf.estimator.EstimatorSpec(mode, loss=loss, eval_metric_ops=metrics)
    
    # 定义预测过程
    elif mode == tf.estimator.ModeKeys.PREDICT:
      predictions = {'predictions': pre}
      output_spec = tf.estimator.EstimatorSpec(mode, predictions=predictions)
    
    else:
      raise TypeError
    
    return output_spec
    

    input_fn

    input_fn用于将数据喂给模型。
    输入函数是返回一个tf.data.Dataset对象,该对象输出包含features、label的元组。
    其中, features是一个python字典,包含:1. 每个特征名称作为键 2. 每个特征下的值的数组作为数组的值。 label则是每个样本的标签的数组。

    input_fn可以采用Dataset Api 来处理返回数据。

    Dataset Api

    tf.Data API用来读取、预处理数据。tf.data.Dataset是一种对数据处理的抽象,用来再tensorflow中表示要处理的数据。
    一个dataset只能通过一下两种方法来得到:

    1. 从内存或者文件等数据源中创建dataset
    2. 从两外一个或者多个dataset中转换而来。

    dataset常用的方法有:

    • tf.data.Dataset.from_tensors()
    • tf.data.Dataset.from_tensor_slices()
    • tf.data.TFRecordDataset()
    • tf.data.TextLineDataset()
    • Dataset.map()
    • Dataset.batch()
    • Dataset.filter()
    def input_fn_bulider(input_file, batch_size, is_training):
      name_to_features = {
        'inputs': tf.FixedLenFeature([3], tf.float32),
        'labels': tf.FixedLenFeature([], tf.float32)
      }
    
      def input_fn(params):
        d = tf.data.TFRecordDataset(inputs_file)
        if is_training:
          d = d.repeat()
          d = d.shuffle()
        
        # 构建和返回dataset
        # map_and_batch是将map 和 batch 结合起来
        d = d.apply(tf.contrib.data.map_and_batch(lambda x: tf.parse_single_example(x, name_to_features), batch_size=batch_size))
    
        return d
    
      return input_fn
    
    

    执行Estimator

    if __name__ == '_main_':
      tf.logging.set_verbosity(tf.logging.INFO)
      runConfig = tf.estimator.RunConfig(save_checkpoints_setps=1,
                                        log_step_count_steps=1)
      
      estimator = tf.estimator.Estimator(model_fn, model_dir='you_save_path',
                                        config=runConfig, params={'lr': 0.01})
      # log_step_count_steps控制的只是loss的global_step的输出
      # 还可以通过tf.train.LoggingTensorHook自定义更多的输出
      # tensors是要输出的内容, 输入一个字典,key为变量名称,value为要计算的tensor的name
      logging_hook = tf.train.LoggingTensorHook(every_n_iter=1,
                                                tensors={'loss': 'loss'})
      # logging_hook需要再model_fn中设置
      # tf.estimator.EstimatorSpec(
      #    ...params...
      #    training_hooks = [logging_hook]
      #  )
      input_fn = input_fn_builder('test.tfrecord', batch_size=1, is_traing=True)
      estimator.train(input_fn, max_steps=1000)
      
    

    参考

    TensorFlow estimator详细介绍,实现模型的高效训练
    TensorFlow Estimator 教程之----快速入门
    tensorflow官方教程

    展开全文
  • estimator使用

    2021-03-30 11:17:07
    一、model_fn 函数有5个输入参数... mode:操作类型(是训练、预测还是评估),对应tf.estimator.ModeKeys.EVAL/TRAIN/PREDICT。 params:定义Estimator实例时传入的params属性。 config:定义Estimator实例时
  • tf.estimator.Estimator

    2018-12-28 17:32:40
    class Estimator(builtins.object) #介绍 Estimator 类,用来训练和验证 TensorFlow 模型。 Estimator 对象包含了一个模型 model_fn,这个模型给定输入和参数,会返回训练、验证或者预测等所需要的操作节点。 所有的...
  • Estimator guide

    2019-03-12 22:36:00
    1,introduction Estimator 会封装下列操作...所有 Estimator(无论是预创建的还是自定义)都是基于 tf.estimator.Estimator 类的类 2,Estimator 的优势 您可以在本地主机上或分布式多服务器环境中运行基于 Est...
  • tf.estimator API技术手册(16)——自定义Estimator(一)前 言(二)自定义estimator的一般步骤(三)准备训练数据(四)自定义estimator实践(1)创建特征列(2)编写模型函数(3)创建estimator实例(4)开始...
  • nlp_estimator_tutorial 关于使用TensorFlow Estimator框架进行文本分类的教学材料 在尝试在Colab中进行直播
  • tf.estimator.Estimator解析

    千次阅读 2019-06-18 18:03:14
    Estimator类代表了一个模型,以及如何对这个模型进行训练和评估, class Estimator(builtins.object) 可以按照下面方式创建一个E def resnet_v1_10_1(features, labels, mode, params): l...
  • tf.estimator.Estimator

    2019-07-25 10:43:30
    Estimator是一个可极大地简化机器学习编程的高阶API,它封装了下列操作: 训练, 评估,预测, 导出以供使用 Estimator本身在tf.layers之上构建而成,可以简化自定义过程 使用Estimator编写应用时,必须将数据输入管道从...
  • Tensorflow API 讲解——tf.estimator.Estimator

    万次阅读 多人点赞 2018-05-29 18:22:04
    class Estimator(builtins.object) 介绍 Estimator 类,用来训练和验证 TensorFlow 模型。 Estimator 对象包含了一个模型 model_fn,这个模型给定输入和参数,会返回训练、验证或者预测等所需要的操作...
  • Huber Estimator

    2020-07-30 16:24:14
    Huber Estimator 减少异常值outliers影响, robust! 先通过MSE求出W用做初始化 IRLS方法更新W
  • tf.estimator.Estimator用法

    2019-01-10 19:25:44
    tf.estimator.Estimator用法 注:本文基本上是看着文档写的。总感觉写的还是差点意思。之后多用几次,有更多经验和体会再来改进吧。 Estimator是tensorflow提供的高阶API,封装了train,eval,predict,export的功能...
  • estimator train, evaluate and deploy model using tf-estimator estimator_template.ipynb中,将estimator的使用过程进行了总结,在eatimator.ipynb中完全按照template中的步骤,进行demo,大家要仔细领会每一句话...
  • tf.estimator API技术手册(1)——tf.estimator概览(一)前 言(二)Estimator 的优势(三)预创建的 Estimator 程序的结构(1)预创建的 Estimator 程序的结构(2)预创建的 Estimator 的优势(四)推荐的工作...
  • OLS estimator is unbiased. Variances-covariance matrix of OLS estimator. GaussMarkov Theorem: OLS estimator is BLUE
  • result-estimator-源码

    2021-06-29 01:34:02
    结果估计器 安装 Postgres 数据库 sudo apt-get install postgresql postgresql-contrib ... sudo -u postgres psql postgres ...GRANT ALL PRIVILEGES ON DATABASE "estimator" to estimator_user; \q
  • TensorFlow Estimator

    2020-02-11 09:46:16
    This document introducestf.estimator—a high-level TensorFlow API. Estimators encapsulate the following actions: training evaluation prediction export for serving You may either use th...
  • Creating Custom Estimator
  • 关于Estimator

    2018-10-11 22:47:55
    关于自定义模型(estimator)的使用介绍,下面文章里写的很详细,不再重复。 https://blog.csdn.net/amao1998/article/details/80202777 关于自定义模型函数的参数问题,之前一直不是很懂,原因是固定参数。 看了...
  • tensorflow estimator 实践

    2019-01-28 16:05:40
    estimator通常是和tf的dataset一起使用,故先制作tfrecord文件,在使用estimator进行测试。 文章结构: 1.文件目录 2. 制作tfrecord文件 3.使用estimator训练模型 4.tf.estimator.Estimator()参数介绍: 文件...
  • 官网链接:https://www.tensorflow.org/api_docs/python/tf/estimator/Estimator Estimator- 一种可极大地简化机器学习编程的高阶 TensorFlow API。Estimator 会封装下列操作: 训练 评估 预测 导出以供...
  • tf.estimator

    2018-12-22 16:59:12
    Estimator类,用来训练和验证 TensorFlow 模型。 Estimator 对象包含了一个模型 model_fn,这个模型给定输入和参数,会返回训练、验证或者预测等所需要的操作节点。 所有的输出(检查点、事件文件等)会写入到model_...
  • Local Position Estimator

    2021-01-10 10:38:15
    <p>It adds a replacement for position_estimator_inav, local_position_estimator, with a standard kalman filter implementation and fault detection. The kalman filter gains have been automatically tuned ...
  • 一、Estimator简介 二、数据集 三、定义特征列 四、estimator创建模型 五、模型训练、评估和预测 六、模型保存和恢复 一、Estimator简介 Estimator是TensorFlow对完整模型的高级表示。Tensorflow提供一个包含...
  • tf.estimator.Estimator Estimator class训练和测试TF模型。Estimator对象封装好通过model_fn指定的模型,给定输入和其它超参数,返回ops执行training, evaluation or prediction. 所有的输出(包含checkpoints, ...
  • tf.estimator API技术手册(2)——tf.estimator结构介绍(一)Modules(模块)(二)Classes(方法类)(三)Functions(函数) (一)Modules(模块) 模块名 作 用 export 导出estimator input 导入...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 30,382
精华内容 12,152
关键字:

estimator