/Tensorflow--

getting started with training models...

Primary LanguageJupyter Notebook

Tensorflow--

getting started with training models...

  1. First of all you need to install the latest version of Anaconda
  2. Run Anaconda as administrator
  3. Then install jupyter notebook on Anaconda
  4. click on Environments on the top let corner
  5. Type Tensorflow in the "Search Environments" tab
  6. Then download it
  7. Similarly type Keras and install it too
  8. Open your jupyter notebook and bang-on you are all ready to go
  9. import tensorflow as tf >>> on jupyter notebook and it will run smoothly
  10. import keras >>> on jupyter and it will run smoothly
  11. some useful commands
  12. from keras.datasets import mnist # for loading datasets that are already available
  13. mnist.load_data() # for loading data
  14. from keras import models # importing models from keras
  15. from keras import layers # importing layers from keras
  16. network = models.Sequential() # using Sequential() method to add layers, etc
  17. network.add(layers.Dense(Density, activation = 'any activation function', input_shape= (input layes shape)))
  18. activation functions can be sigmoid, ReLU, Leaky ReLU, Tanh, etc. most commonly used is ReLU where as for output layer sigmoid is used.
  19. network.compile(optimizer='any optimizer', loss='any loss calculating method', metrics=['accuracy'])
  20. network.fit(train_image, train_lable, epochs=of your choice, batch_size=of your choice)
  21. test_loss, test_acc = network.evaluate(test_image, test_lable)
  22. print('test_acc:', test_acc)
  23. Help taken from Sir Rauf Ur Rahim (PIAIC teacher)