Skip to content

04. First Steps With TensorFlow

Antonio Erdeljac edited this page Feb 26, 2019 · 1 revision

First Steps with TensorFlow


Topic: First Steps with TensorFlow

Course: GMLC

Date: 12 February 2019

Professor: Not specified


Resources


Key Points


  • TensorFlow

    • computational framework for building machine learning models

    • High-level APIs:

      • TensorFlow estimators
    • Reusable libraries:

      • tf.layers

      • tf.losses

      • tf.metrics

    • Ops:

      • Python TensorFlow

      • C++ TensorFlow

    • Kernels:

      • GPU

      • CPU

      • TPU

  • Estimator - a high level API used to specify predefined architectures, such as linear regressors

  • Tensor - data structure used in TensorFlow, can be N-Dimensional

  • Graph - a computation specification

  • Rules of thumb for RMSE & MSE reduction (Hyperparematers tuning):

    • Training error should steadily decrease

    • If training is not converging, try running for a longer amount

    • Increasing learning rate my help a slow training error decrease (not too high, we’ve discussed that in the last lesson)

    • Lower learning rate + larger number of steps or larger batch size is often a good combination

    • When choosing batch sizes, try 100 or 1000 for initial, and decrease till degradation is visible

    • Do not go strictly by these rules, effects are data dependent and experimenting should be done

  • Pandas - library in python used for data analysis

  • Step - hyperparameter that represents the total number of training iterations, each step calculates loss from one batch and uses the calculated value to modify the model’s weight

  • Batch size - hyperparameter that represents the number of examples for a single step

  • Total number of trained examples - batch size * steps

  • Period - a convenience variable used to control the granularity of reporting, altering it won’t chathe nge model’s learning process               

  • Number of trained examples in one period  - (batch size * steps) / period

Check your understanding


  • Explain what is TensorFlow in general

  • Know what is an Estimator’s purpose

  • Know rules of thumb for RMSE & MSE reduction (based on hyperparameters)

Summary of Notes


  • TensorFlow is a computational framework used to train & build models

  • TensorFlow uses Tensors, an N dimensional data structure

  • Lower learning rate & higher amount of steps or batch size Is often a good combination and will lead to better MSE score