Skip to content

Instantly share code, notes, and snippets.

View axegon's full-sized avatar
🐺
Now true humor begins when a man ceases to take himself seriously.

Alex axegon

🐺
Now true humor begins when a man ceases to take himself seriously.
View GitHub Profile
import numpy as np
import matplotlib.pyplot as plt
with open('samples.bin', 'rb') as f:
raw_data = np.fromfile(f, dtype=np.uint8)
iq_data = raw_data.astype(np.float32) - 127.5
iq_data /= 127.5
i_data = iq_data[0::2]
@axegon
axegon / README.md
Last active March 12, 2020 23:51
Fetching data from https://github.com/CSSEGISandData/COVID-19 into JSON files.

SETUP

Use a virtualenv if possible.

  1. Install the requirements: pip install -r requirements.txt
  2. Set the two environmental variables GHTOKEN and BLEEPBLOOP:
GHTOKEN = https://github.com/settings/tokens
BLEEPBLOOP = WHATEVER_YOU_WANT,_USED_FOR_SALT
>>> import string
>>> string.letters
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
>>> help(string)
>>> string.letters
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
>>> reload(string)
<module 'string' from '/usr/lib64/python2.7/string.pyc'>
>>> string.letters
Module Status New Location Compatibility Module Documentation
tf.AUTO_REUSE Removed tf.compat.v1.AUTO_REUSE N/A
tf.AttrValue Removed tf.compat.v1.AttrValue https://www.tensorflow.org/versions/r1.12/api_docs/python/tf/AttrValue
tf.COMPILER_VERSION Removed tf.compat.v1.COMPILER_VERSION N/A
tf.CXX11_ABI_FLAG Removed tf.compat.v1.CXX11_ABI_FLAG N/A
tf.ConditionalAccumulator Removed tf.compat.v1.ConditionalAccumulator https://www.tensorflow.org/versions/r1.12/api_docs/python/tf/ConditionalAccumulator
tf.ConditionalAccumulatorBase Removed tf.compat.v1.ConditionalAccumulatorBase https://www.tensorflow.org/versions/r1.12/api_docs/python/tf/ConditionalAccumulatorBase
tf.ConfigProto Removed tf.compat.v1.ConfigProto https://www.tensorflow.org/versions/r1.12/api_docs/python/tf/ConfigProto
tf.DeviceSpec Removed tf.compat.v1.DeviceSpec https://www.tensorflow.org/versions/r1.12/api_docs/python/tf/DeviceSpec
tf.Dimension Removed tf.compat.v1.Dimension https://www.tensorflow.org/versions/r1.12/api_docs/python/tf/Dime
import tensorflow as tf
import numpy as np
splits = [1, 4, 4, 7, 8, 8]
x = tf.RaggedTensor.from_row_splits(values=np.random.choice(20,10).tolist(), row_splits=splits)
y = tf.RaggedTensor.from_row_splits(values=np.random.choice(20,10).tolist(), row_splits=splits)
print((x+y).to_list())
import numpy as np
import tensorflow as tf
 
np.random.seed(42)
 
x = tf.constant(np.random.rand(3,3))
y = tf.constant(np.random.rand(3,3))
@tf.function
def matmul(x, y):
import numpy as np
import tensorflow as tf
 
np.random.seed(42)
 
x = tf.constant(np.random.rand(3,3))
y = tf.constant(np.random.rand(3,3))
result = tf.matmul(x, y)
tf.global_variables_initializer()