Skip to content

Instantly share code, notes, and snippets.

View Gclabbe's full-sized avatar

Chris Labbe Gclabbe

View GitHub Profile
@Gclabbe
Gclabbe / gist:1d85be38b12cfa4f72a40ca2a2199551
Last active September 18, 2021 18:39
4BAI week 6 ... getting it to run locally (Windows)
## to get Nvidia's Docker container with Jupyter Notebooks and GPU support
> docker run --gpus all -it --rm -v $(realpath path to your work):/tf/notebooks -p 8888:8888 tensorflow/tensorflow:latest-gpu-jupyter
## New requirements-gpu.txt
opencv-python
lxml
tqdm
-e .
@Gclabbe
Gclabbe / gist:ea7ffa34e19a3f03b53f0b79fd14efbe
Created August 20, 2021 04:30
Cluster breakdown in Week 3 live HW
clusters = {}
n = len(column_values)
for i in range(n):
if column_values[i] not in clusters:
clusters[column_values[i]] = {'count': 0, 'purch': 0}
clusters[column_values[i]]['count'] += 1
@Gclabbe
Gclabbe / gist:e93381da0466230cf9579ee89b7db2ad
Created August 20, 2021 04:07
Small code to fix directory issues in Week 3 assignment
windoze = True
tb_base = '\\project-tensorboard\\' if windoze else '/project-tensorboard/'
tb_log = 'log-1'
# Path to save the embedding and checkpoints generated
try:
os.mkdir(PATH + tb_base)
except:
pass
@Gclabbe
Gclabbe / readme_conda_py3.8_tf.md
Last active August 31, 2021 20:22
Setup for 4thBrain Anaconda Tensorflow CPU / GPU
@Gclabbe
Gclabbe / gist:666f73e98651f0f46acc1150cadc8f9e
Created August 10, 2021 02:54
Fourth Brain MLE week 1 -- using Pivot instead of GroupBy
def get_features_and_targets(df, scale_y=None):
df = df.drop(columns=['MSRP'])
counts = df.pivot_table(columns=list(df.columns), aggfunc='size')
X = counts.index
Y = counts.values[:][:, None]
if scale_y != None:
if scale_y == 'by_volume':