Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan Ofer ddofer

View GitHub Profile
@ddofer
ddofer / README.md
Created Dec 1, 2020 — forked from jackd/README.md
tensorflow graphics keras port for PR #155
View README.md

Get my forked tensorflow graphics repo and switch to appropriate branch

git clone https://github.com/jackd/graphics.git
cd graphics
git checkout sparse-feastnet
pip install -e .
cd ..

Get this gist:

@ddofer
ddofer / get_chemical_elements_wikipedia.py
Last active Apr 22, 2020
Get list of chemical elements from Wikipedia + Pandas
View get_chemical_elements_wikipedia.py
import pandas as pd
# read wikipedia html table with info on all elemetns, including symbols, names, properties:
df_base = pd.read_html("https://en.wikipedia.org/wiki/List_of_chemical_elements")[0]
element_full_names = df_base["List of chemical elements"]["Element"][:-1] # last row is comments
element_full_names =list(element_full_names.apply(lambda x: x[0],axis=1).values) # get individual names out of wrapped list format
# element_full_names.to_csv("names_of_elements.csv",index=False)
@ddofer
ddofer / freqLabs.R
Created Aug 9, 2017
Filter lab tests for tests that occured for at least K users distinctly, and then filter by the most frequent (non distinct) labs. R
View freqLabs.R
#LABS
#get most frequent lab tests, for distinct patients.
#Filter for distinct by user:
# data.labs = as.data.frame(data.labs)
# data.labs.userDistinct = subset(as.data.table(data.labs),select=c("guid_tz","kod_bdika")) #ORIG
# data.labs.userDistinct= unique(data.labs.userDistinct) #ORIG
data.labs.userDistinct= unique(data.labs,by="guid_tz") #changed
@ddofer
ddofer / dnn.py
Last active Aug 29, 2015 — forked from syhw/dnn.py
View dnn.py
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams