skflow

Tensorflow predictions change as more predictions are made

孤街浪徒 提交于 2020-01-14 22:48:52
问题 I'm using tensorflow 0.8.0 and skflow (or now known as learn). My model is very similar to this example but with a dnn as the last layer (similar tot he minst example). Nothing very fancy going on, the model works pretty well on its own. The text inputs are a max of 200 characters and 3 classes. The problem I'm seeing is when I try to load the model and make many predictions (Usually around 200 predictions or more), I start to see results vary. For example, my model is already trained and I

tf.contrib.learn.BaseEstimator.evaluate(): What is the meaning of the “steps” parameter?

社会主义新天地 提交于 2019-12-24 08:56:20
问题 According to https://www.tensorflow.org/versions/r0.9/api_docs/python/contrib.learn.html, the tf.contrib.learn.BaseEstimator.evaluate function can take in a steps parameter. The parameter is explained as follows: steps: Number of steps for which to evaluate model. If None, evaluate forever. How can evaluation have steps? In my understanding, a trained model should be "evaluated" only once (i.e. steps=1), and then calculate the loss against the target labels, right? Thanks! 回答1: You can also

tf.contrib.learn.BaseEstimator.evaluate(): What is the meaning of the “steps” parameter?

∥☆過路亽.° 提交于 2019-12-24 08:52:32
问题 According to https://www.tensorflow.org/versions/r0.9/api_docs/python/contrib.learn.html, the tf.contrib.learn.BaseEstimator.evaluate function can take in a steps parameter. The parameter is explained as follows: steps: Number of steps for which to evaluate model. If None, evaluate forever. How can evaluation have steps? In my understanding, a trained model should be "evaluated" only once (i.e. steps=1), and then calculate the loss against the target labels, right? Thanks! 回答1: You can also

Multiple regression output nodes in tensorflow learn

本小妞迷上赌 提交于 2019-12-23 08:32:02
问题 I am relatively new to tensorflow and want to use the DNNRegressor from tf.contrib.learn for a regression task. But instead of one output node, I would like to have several (let's say ten for example). How can I configure my regressor to adjust many output nodes to fit my needs? My question is related to the following ones already asked on SO, but there seems to be no working answer (I am using TensorFlow version 0.11) skflow regression predict multiple values Multiple target columns with

Multiple regression output nodes in tensorflow learn

风格不统一 提交于 2019-12-23 08:31:04
问题 I am relatively new to tensorflow and want to use the DNNRegressor from tf.contrib.learn for a regression task. But instead of one output node, I would like to have several (let's say ten for example). How can I configure my regressor to adjust many output nodes to fit my needs? My question is related to the following ones already asked on SO, but there seems to be no working answer (I am using TensorFlow version 0.11) skflow regression predict multiple values Multiple target columns with

CSV File Into SkFlow

一个人想着一个人 提交于 2019-12-12 03:54:14
问题 I'm just starting out with Tensorflow. As I understand it, SkFlow is a... Simplified interface for TensorFlow And for me simple is good. TensorFlow's Github has some useful starter examples using the Iris dataset included in SkFlow. This is from the first example, the Linear Classifier. iris = datasets.load_iris() feature_columns = learn.infer_real_valued_columns_from_input(iris.data) This iris object has the type <class 'sklearn.datasets.base.Bunch'> and is a dict like structure containing

How to use StreamingDataFeeder as contrib.learn.Estimator.fit()'s input_fn?

醉酒当歌 提交于 2019-12-11 07:12:18
问题 I have recently started using tensorflow.contrib.learn (skflow) library and really like it. However, I am facing an issue with using Estimator , the fit function uses either ( X , Y , and batch_size ) - the problem with this approach is that it does not support provision for specifying number of epochs and allowing arbitrary source of data. input_fn - besides, setting epochs, it gives me much more flexibility on source of training ( which in my case is coming directly from a database). Now I

tensorflow model has different results than the same model in skflow (optimizer)

你离开我真会死。 提交于 2019-12-11 00:15:44
问题 I'm using tensorflow to replicate a neural network for the MNIST dataset, previously programmed in skflow. Here is the model in skflow: import tensorflow.contrib.learn as skflow from sklearn import metrics from sklearn.datasets import fetch_mldata from sklearn.cross_validation import train_test_split mnist = fetch_mldata('MNIST original') train_dataset, test_dataset, train_labels, test_labels = train_test_split( mnist.data, mnist.target, test_size=10000, random_state=42) classifier = skflow

Adding regularizer to skflow

余生长醉 提交于 2019-12-10 19:53:00
问题 I recently switched form tensorflow to skflow. In tensorflow we would add our lambda*tf.nn.l2_loss(weights) to our loss. Now I have the following code in skflow: def deep_psi(X, y): layers = skflow.ops.dnn(X, [5, 10, 20, 10, 5], keep_prob=0.5) preds, loss = skflow.models.logistic_regression(layers, y) return preds, loss def exp_decay(global_step): return tf.train.exponential_decay(learning_rate=0.01, global_step=global_step, decay_steps=1000, decay_rate=0.005) deep_cd = skflow

How to create `input_fn` using `read_batch_examples` with `num_epochs` set?

╄→гoц情女王★ 提交于 2019-12-05 06:15:14
问题 I have a basic input_fn that can be used with Tensorflow Estimators below. It works flawlessly without setting the num_epochs parameter; the obtained tensor has a discrete shape. Pass in num_epochs as anything other than None results in an unknown shape. My issue lies with constructing sparse tensors whilst using num_epochs ; I cannot figure out how to generically create said tensors without knowing the shape of the input tensor. Can anyone think of a solution to this problem? I'd like to be