You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://gitter.im/tensorflow/skflow?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
-
5
-
This is a simplified interface for TensorFlow, to get people started on predictive analytics and data mining.
6
-
7
-
Library covers variety of needs from linear models to *Deep Learning* applications like text and image understanding.
3
+
TF Learn is a simplified interface for TensorFlow, to get people started on predictive analytics and data mining. The library covers a variety of needs: from linear models to *Deep Learning* applications like text and image understanding.
8
4
9
5
### Why *TensorFlow*?
10
6
11
-
- TensorFlow provides a good backbone for building different shapes of machine learning applications.
12
-
- It will continue to evolve both in the distributed direction and as general pipelinining machinery.
7
+
* TensorFlow provides a good backbone for building different shapes of machine learning applications.
8
+
* It will continue to evolve both in the distributed direction and as general pipelinining machinery.
13
9
14
-
### Why *TensorFlow Learn* (Scikit Flow)?
10
+
### Why *TensorFlow Learn*?
15
11
16
-
- To smooth the transition from the Scikit Learn world of one-liner machine learning into the more open world of building different shapes of ML models. You can start by using fit/predict and slide into TensorFlow APIs as you are getting comfortable.
17
-
- To provide a set of reference models that would be easy to integrate with existing code.
12
+
- To smooth the transition from the [scikit-learn](http://scikit-learn.org/stable/)world of one-liner machine learning into the more open world of building different shapes of ML models. You can start by using [fit](../../../../g3doc/api_docs/python/contrib.learn.md#Estimator.fit)/[predict](../../../../g3doc/api_docs/python/contrib.learn.md#Estimator.predict) and slide into TensorFlow APIs as you are getting comfortable.
13
+
- To provide a set of reference models that will be easy to integrate with existing code.
18
14
19
15
## Installation
20
16
21
-
Optionally you can install Scikit Learn and Pandas for additional functionality.
22
-
23
-
Then you can simply import `learn` via `from tensorflow.contrib.learn` or use `tf.contrib.learn`.
17
+
[Install TensorFlow](../../../../g3doc/get_started/os_setup.md), and then simply import `learn` via `from tensorflow.contrib.learn` or use `tf.contrib.learn`.
24
18
19
+
Optionally you can install [scikit-learn](http://scikit-learn.org/stable/) and [pandas](http://pandas.pydata.org/) for additional functionality.
25
20
26
-
### Tutorial
21
+
### Tutorials
27
22
28
-
-[Introduction to Scikit Flow and Why You Want to Start Learning
- StackOverflow with [tensorflow tag](http://stackoverflow.com/questions/tagged/tensorflow) for questions and struggles.
33
+
- GitHub [issues](https://github.com/tensorflow/tensorflow/issues) for technical discussions and feature requests.
43
34
44
35
### Usage
45
36
46
-
Below are few simple examples of the API. For more examples, please see [examples](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/skflow).
37
+
Below are a few simple examples of the API. For more examples, please see [examples](https://www.tensorflow.org/code/tensorflow/examples/skflow).
47
38
48
-
## General tips
39
+
General tips:
49
40
50
-
- It's useful to re-scale dataset before passing to estimator to 0 mean and unit standard deviation. Stochastic Gradient Descent doesn't always do the right thing when variable are very different scale.
41
+
- It's useful to rescale a dataset to 0 mean and unit standard deviation before passing it to an [`Estimator`](../../../../g3doc/api_docs/python/contrib.learn.md#estimators). [Stochastic Gradient Descent](https://en.wikipedia.org/wiki/Stochastic_gradient_descent) doesn't always do the right thing when variable are at very different scales.
51
42
52
43
- Categorical variables should be managed before passing input to the estimator.
53
44
@@ -60,9 +51,11 @@ import tensorflow.contrib.learn.python.learn as learn
Each estimator has a ``save`` method which takes folder path where all model information will be saved. For restoring you can just call ``learn.Estimator.restore(path)`` and it will return object of your class.
To get nice visualizations and summaries you can use ``logdir`` parameter on ``fit``. It will start writing summaries for ``loss`` and histograms for variables in your model. You can also add custom summaries in your custom model function by calling ``tf.summary`` and passing Tensors to report.
143
+
Each estimator supports a `model_dir` argument, which takes a folder path where all model information will be saved:
139
144
140
145
```python
141
-
classifier = learn.LinearRegressor()
142
-
classifier.fit(x, y, logdir='/tmp/tf_examples/my_model_1/')
INFO:tensorflow:Saving checkpoints for 301 into /tmp/leftoff/model.ckpt.
187
+
INFO:tensorflow:loss = 0.101036, step = 401
188
+
INFO:tensorflow:loss = 0.137956, step = 501
189
+
INFO:tensorflow:Saving checkpoints for 600 into /tmp/leftoff/model.ckpt.
190
+
INFO:tensorflow:Loss for final step: 0.0162506.</pre>
191
+
192
+
## Summaries
193
+
194
+
If you supply a `model_dir` argument to your `Estimator`s, TensorFlow will write summaries for ``loss`` and histograms for variables in this directory. (You can also add custom summaries in your custom model function by calling [Summary](../../../../g3doc/api_docs/python/train.md#summary-operations) operations.)
195
+
196
+
To view the summaries in TensorBoard, run the following command, where `logdir` is the `model_dir` for your `Estimator`:
- An easy way to handle [categorical variables](https://www.tensorflow.org/code/tensorflow/examples/skflow/text_classification.py) (words are just an example of a categorical variable)
217
+
- Text Classification: see examples for [RNN](https://www.tensorflow.org/code/tensorflow/examples/skflow/text_classification_character_rnn.py) and [CNN](https://www.tensorflow.org/code/tensorflow/examples/skflow/text_classification_character_cnn.py) on characters
218
+
-[Language modeling and text sequence to sequence](https://www.tensorflow.org/code/tensorflow/examples/skflow/language_model.py)
219
+
-[Digit recognition using a CNN](https://www.tensorflow.org/code/tensorflow/examples/skflow/digits.py)
0 commit comments