Skip to content

Instantly share code, notes, and snippets.

@jiewpeng
jiewpeng / requirements.txt
Last active October 19, 2019 04:24
Data Science Environment
tensorflow
tfx
tensorflow-serving-api
tensor2tensor
flake8
bandit
flake8-bandit
seaborn
spacy
gensim
@jiewpeng
jiewpeng / keras_estimator.py
Last active December 5, 2018 14:43
Keras Model within Estimator Function
import tensorflow as tf
import tensorflow_hub as hub
import numpy as np
import shutil
def create_model(max_seq_len, embedding_size):
model = tf.keras.Sequential()
model.add(tf.keras.layers.Dropout(0.5, input_shape=(max_seq_len, embedding_size)))
model.add(tf.keras.layers.SeparableConv1D(8, 3, padding='same', activation=tf.nn.leaky_relu))
model.add(tf.keras.layers.GlobalAveragePooling1D())
@jiewpeng
jiewpeng / useful-gitattrbutes.md
Created July 20, 2018 13:51
Useful things to have in .gitattributes

Useful .gitattributes

Strip output from Jupyter Notebooks

  1. First, install nbstripout:
conda install -c conda-forge nbstripout
nbstripout --install
@jiewpeng
jiewpeng / text-network-preprocc.ipynb
Created October 29, 2017 09:51
Text Network Vis Pre-processing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiewpeng
jiewpeng / add_anaconda_right_click_menu.md
Last active May 9, 2024 12:50
Add Anaconda Prompt to Windows right click context menu

This gist describes how to add Anaconda Prompt to the Windows right click context menu. This is because at some point, Anaconda no longer adds itself to the PATH after installation.

  1. Run regedit.exe
  2. Navigate to HKEY_CLASSES_ROOT > Directory > Background > shell
  3. Add a key named AnacondaPrompt and set its value to "Anaconda Prompt Here" (or anything you'd like it to appear as in the right click context menu)
  4. Add a key under this key, called command, and set its value to cmd.exe /K C:\Anaconda3\Scripts\activate.bat (may have to change the activate.bat file to whereever Anaconda is installed)