Skip to content

Instantly share code, notes, and snippets.

View thien's full-sized avatar
🏗️
making things

@thien thien

🏗️
making things
View GitHub Profile
@thien
thien / init.sh
Last active May 2, 2019 19:58
Linux Auto Installer
# add budgie
sudo add-apt-repository ppa:budgie-remix/ppa
sudo apt update
sudo apt upgrade
# gnome stuff
sudo apt install gnome-shell-extensions
sudo apt install chrome-gnome-shell
# install vscodium
wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add -
@thien
thien / run.sh
Created February 3, 2019 00:32
Tensorflow GPU installation for Ubuntu 18.04
# nicked from https://medium.com/@cjanze/how-to-install-tensorflow-with-gpu-support-on-ubuntu-18-04-lts-with-cuda-10-nvidia-gpu-312a693744b5
# Part 1
sudo apt update
sudo apt install gcc build-essential freeglut3 freeglut3-dev libxi-dev libxmu-dev python3-dev python3-pip python3 curl wget
cd ~/Downloads
# download nvidia driver
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/410.93/NVIDIA-Linux-x86_64-410.93.run
# download cuda
@thien
thien / variablespeeds.py
Created May 6, 2018 10:53
Variable Speeds Distributed Leader Selection (Async Rings) Algorithm
class VariableSpeeds:
def __init__(self,id):
self.id = id
self.elected = False
# initially, min_i = id_i
self.min = self.id
self.received = 0
def receive(self,r, m):
# upon receiving <m> from the right
@thien
thien / seq_alignment.py
Created April 18, 2018 17:15
needleman-wunch and smith-waterman algorithms
from termcolor import *
# simplicity values
def sub(a,b):
# substitute
if a == b:
return 0
else:
return 1

Artificial Intelligence, Machine Learning, Neural Networks, Neuroevolution, Genetic Algorithms, Draughts, Checkers, Crossover, Monte Carlo Tree Search

Introduction

The intention of this project is to explore the effectiveness of genetic algorithms to improve the neurons of a neural network. Neural networks can be used to evaluate the performance of two players in a zero-sum

@thien
thien / simplex.py
Last active April 6, 2018 20:05
Simplex Algorithm implementation in Python (3.x)
import numpy as np
def simplex(c, A, b, basis):
z = 0
tableau = None
foundOptimal = False
numRound = 1
# we'll be using tableau because it's easier and makes more sense.
@thien
thien / tensor.py
Created October 18, 2017 17:44
My first Tensor
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
"""
Input > weight > hidden layer 1 (activation function) > weights > hidden l 2.
repeat until output layer.
compare output to intended output > cost function (cross entropy)
@thien
thien / multicast.md
Created May 13, 2017 16:16
multicast notes

Multicasting

Before send/receiving IP multicast data, the network needs to support it: - hosts must be configured to send/receive multicast data - routers must support IGMP, multicast forwarding, and routing protocols.

You would send it to a Class D IP address

  • to join, you would contact a local router to join the group.
  • You'd use the IGMP to join a multicast group.
  • routers uses a multicast routing protocol to determine which subnets to forward to.
@thien
thien / keybase.md
Last active May 14, 2017 14:43
keybase

Keybase proof

I hereby claim:

  • I am thien on github.
  • I am thien (https://keybase.io/thien) on keybase.
  • I have a public key ASCA1rbMKEBEIVc2vwp32Wsc9S433KjiE9Q7m6F1nYntqgo

To claim this, I am signing this object:

@thien
thien / fib.py
Created December 4, 2016 21:09
Fibonacci
def fib(n):
if n is 0:
return 0
if n is 1:
return 1
else:
return fib(n-1) + fib(n-2)
for i in range(0,10):
print(fib(i))