Skip to content

Instantly share code, notes, and snippets.

View christianramsey's full-sized avatar

Fanli (Christian) Ramsey christianramsey

View GitHub Profile
./autogen.sh && ./configure && make
brew install libtool
brew link libtool
./autogen.sh && ./configure && make
make check
sudo make install
which protoc
@christianramsey
christianramsey / TensorFlow GPU CUDA 10 Ubuntu 18.04
Last active May 15, 2020 14:55
Install TensorFlow GPU for Ubuntu 18.04 - the easy way
# Add NVIDIA package repository
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt install ./cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt install ./nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt update
# Install CUDA and tools. Include optional NCCL 2.x
sudo apt install cuda10.0 cuda-cublas-10-0 cuda-cufft-10-0 cuda-curand-10-0 \
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as tflayers
x = tflayers.real_valued_column(np.linspace(0, 100, 101))
buckets = np.linspace(0, 100, 5).tolist()
x2 = tflayers.bucketized_column(x, buckets)
print(x2)
id 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
AL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
CA 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
@christianramsey
christianramsey / gist:5248396
Created March 26, 2013 19:26
Used this link to fix rails from not syncing with rvm's default ruby version
http://stjhimy.com/posts/10-five-quick-steps-to-set-up-rvm-with-rails-2-and-rails3
@christianramsey
christianramsey / gist:5247267
Created March 26, 2013 17:18
if brew install apple-gcc42 doesn't work try....
Try brew tap --repair homebrew/dupes and then try installing.
@christianramsey
christianramsey / gist:5245860
Created March 26, 2013 14:42
delete brew fully
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@christianramsey
christianramsey / gist:5126995
Created March 10, 2013 03:34
ruby debugger set
def create
debugger
@movie = Movie.create!(params[:movie])
flash[:notice] = "#{@movie.title} was successfully created."
redirect_to movies_path
end
// line 2 debugger to debug on save
@christianramsey
christianramsey / rubydebug
Created March 10, 2013 03:01
Getting ruby-debug19 to work
1) From the root of the project run:
gem install ruby-debug19 -- --with-ruby-include="$rvm_path/src/$(rvm tools identifier)/"
2) Include in Gemfile
group :test, :development do
gem ‘ruby-debug19′, :require => ‘ruby-debug’
end
3) Create a .rdebugrc in your home directory
@christianramsey
christianramsey / gist:5092677
Created March 5, 2013 18:15
4 column layout..
<div class="info_column" id="info_column1">
<ul>
<li>Design</li>
<li>Dev</li>
<li>Crazy</li>
</ul>
</div>
<div class="info_column" id="info_column2">
<ul>
<li>Designer</li>