Skip to content

Instantly share code, notes, and snippets.

@18182324
Created May 19, 2021 09:39
Show Gist options
  • Save 18182324/ff863ed4bb4c24c8dc0024e31b82c273 to your computer and use it in GitHub Desktop.
Save 18182324/ff863ed4bb4c24c8dc0024e31b82c273 to your computer and use it in GitHub Desktop.
try: #If running in colab
import google.colab
IN_COLAB = True
%tensorflow_version 2.x
except:
IN_COLAB = False
import tensorflow as tf
if (not tf.__version__.startswith('2')): #Checking if tf 2.0 is installed
print('Please install tensorflow 2.0 to run this notebook')
print('Tensorflow version: ',tf.__version__, ' running in colab?: ', IN_COLAB)
if IN_COLAB:
!pip install tensorflow_probability==0.8.0
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
plt.style.use('default')
%matplotlib inline
tfd = tfp.distributions
print("TFP Version", tfp.__version__)
print("TF Version",tf.__version__)
#Create train data. We set the outcome of three coin tosses to one, #meaning we get three times head
obs_data=np.repeat(1,3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment