Skip to content

Instantly share code, notes, and snippets.

View darthbhyrava's full-sized avatar
💭
Do or do not, there is no try.

Sriharsh Bhyravajjula darthbhyrava

💭
Do or do not, there is no try.
View GitHub Profile
@darthbhyrava
darthbhyrava / Ignorance.md
Last active February 26, 2018 11:01
A list of coding doubts I have which need to be cleared from time to time.

February 2018

  • Using the lambda in python. lambda x: clean_text(x)
  • re.MULTILINE
  • hashtag segmentation/splitting?
  • sklearn.feature_extraction, sklearn.decomposition,
  • Pandas df series?
  • [ ]

Biggies

  • Learn Pandas
@kmhofmann
kmhofmann / building_tensorflow.md
Last active August 11, 2024 14:14
Building TensorFlow from source

Building TensorFlow from source (TF 2.3.0, Ubuntu 20.04)

Why build from source?

The official instructions on installing TensorFlow are here: https://www.tensorflow.org/install. If you want to install TensorFlow just using pip, you are running a supported Ubuntu LTS distribution, and you're happy to install the respective tested CUDA versions (which often are outdated), by all means go ahead. A good alternative may be to run a Docker image.

I am usually unhappy with installing what in effect are pre-built binaries. These binaries are often not compatible with the Ubuntu version I am running, the CUDA version that I have installed, and so on. Furthermore, they may be slower than binaries optimized for the target architecture, since certain instructions are not being used (e.g. AVX2, FMA).

So installing TensorFlow from source becomes a necessity. The official instructions on building TensorFlow from source are here: ht

@dennybritz
dennybritz / plot_decision_boundary.py
Created September 18, 2015 16:45
plot_decision_boundary.py
# Helper function to plot a decision boundary.
# If you don't fully understand this function don't worry, it just generates the contour plot below.
def plot_decision_boundary(pred_func):
# Set min and max values and give it some padding
x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5
y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5
h = 0.01
# Generate a grid of points with distance h between them
xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h))
# Predict the function value for the whole gid
@karpathy
karpathy / min-char-rnn.py
Last active September 24, 2024 08:59
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)