Skip to content

Instantly share code, notes, and snippets.

@andyweizhao
andyweizhao / gist:8bc8209285f31ed5633f8e2ece58086f
Created January 23, 2019 15:51 — forked from fabianp/gist:934363
locally linear embedding - swiss roll example
# -*- coding: utf-8 -*-
"""
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
@andyweizhao
andyweizhao / pca.py
Created January 23, 2019 15:23 — forked from bistaumanga/pca.py
Principal component analysis in python.
import numpy as np
import pylab as plt
'''
Performs the Principal Coponent analysis of the Matrix X
Matrix must be n * m dimensions
where n is # features
m is # examples
'''
def PCA(X, varRetained = 0.95, show = False):
import matplotlib.pyplot as plt
plt.style.use("classic")
case = 91
betas = distance_list[case]
alphas = connection_strengh_list[case]
for i in [0,2,3,4,6]:
_, ax = plt.subplots()
ax.spines['top'].set_visible(False)
@andyweizhao
andyweizhao / cuda_installation_on_ubuntu_18.04
Last active October 11, 2021 17:56 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
cuda 9.0 complete installation procedure for ubuntu 18.04 LTS
#!/bin/bash
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.3 in ubuntu 18.04
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###