Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Allgöwer Allgoerithm

  • b.telligent
  • Munich, Germany
View GitHub Profile
View german-credit-risk.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View main_game_code.py
class ButtonReaction():
def __init__(self, moves_widget, game_statistics_widget, plot_widget, show_plot):
self.moves = moves_widget
self.game_statistics = game_statistics_widget
self.plot = plot_widget
self.history = {'rock': 0, 'paper': 0, 'scissors': 0} # initialize history of moves of our human opponent
self.wins = [0, 0, 0]
self.show_plot = show_plot
def on_button_clicked(self, button_info):
View hamilton_monte_carlo.py
# observed data
total_rock = tf.constant(5., tf.float32)
total_paper = tf.constant(0., tf.float32)
total_scissors = tf.constant(0., tf.float32)
# define some constants
number_of_steps = 10000
burnin = 5000
# Set the chain's start state
View joint_log_probability.py
# We calculate the joint log probability.
# It answers the big and central question in each Markov chain simulation: What's the probability
# that this data occurs together with these distribution parameters?
@tf.function(input_signature=5 * (tf.TensorSpec(shape=[], dtype=tf.float32),))
def joint_log_prob(total_rock, total_paper, total_scissors, p_rock, p_paper):
'''
Joint log probability of data occuring together with given parameters.
:param total_rock: number of rock occurences
:param total_paper: number of paper occurences
@Allgoerithm
Allgoerithm / rock-paper-scissors-in-tfp.ipynb
Last active Jan 28, 2020
Rock, Paper, Scissors in TFP
View rock-paper-scissors-in-tfp.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Allgoerithm
Allgoerithm / is_it_the_noise.ipynb
Last active Jul 25, 2019
Is_it_the_noise.ipynb
View is_it_the_noise.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.