Skip to content

Instantly share code, notes, and snippets.

View StKyr's full-sized avatar

Kyriakos Stylianopoulos StKyr

View GitHub Profile
@icshih
icshih / votable_to_pandas.py
Created August 3, 2018 14:43
Read VOTable file and return a Pandas DataFrame object
from astropy.io.votable import parse
import pandas as pd
def votable_to_pandas(votable_file):
votable = parse(votable_file)
table = votable.get_first_table().to_table(use_names_over_ids=True)
return table.to_pandas()
@VikingPenguinYT
VikingPenguinYT / dropout_bayesian_approximation_tensorflow.py
Last active August 6, 2024 16:09
Implementing Dropout as a Bayesian Approximation in TensorFlow
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.contrib.distributions import Bernoulli
class VariationalDense:
"""Variational Dense Layer Class"""
def __init__(self, n_in, n_out, model_prob, model_lam):
self.model_prob = model_prob
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 24, 2025 05:26
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1