This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Savitzky-Golay filter of window half-width M and degree N | |
M is the number of points before and after to interpolate, i.e. the full width | |
of the window is 2M+1 | |
""" | |
immutable SavitzkyGolayFilter{M,N} end | |
@generated function Base.call{M,N,T}(::Type{SavitzkyGolayFilter{M,N}}, | |
data::AbstractVector{T}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A port of https://github.com/karpathy/llama2.c/blob/master/run.c | |
# to Julia. | |
# Jiahao Chen <jiahao@csail.mit.edu> 2023-07-29 | |
# | |
# MIT License: see full text at https://opensource.org/license/mit/ | |
# | |
using LinearAlgebra | |
using LogExpFunctions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Plots | |
using StatsPlots | |
using LinearAlgebra | |
using ClassicalOrthogonalPolynomials | |
using ProgressMeter | |
using Statistics | |
k = 15 # Size of training data | |
l = 15 # Size of test data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Statistics | |
using BFloat16s | |
using StaticArrays | |
import Base: getindex, setindex!, length, iterate | |
########################################### | |
# Implementation of the NormedFloat4 type | |
# and its container type, QLoRAArray | |
# |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Set up data partition | |
sudo mkdir /data | |
sudo chmod 777 /data | |
sudo "echo /dev/xvdb /data ext4 rw,user,exec,comment=cloudconfig 0 2 >> /etc/fstab" | |
sudo mount /data | |
#Install build environment | |
sudo sed -i "s/enabled=0/enabled=1" /etc/yum.repos.d/epel.epo | |
sudo yum -y update | |
sudo yum -y upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
Pure Python implementation of some numerical optimizers | |
Created on Jan 21, 2011 | |
@author Jiahao Chen | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import urllib.request | |
url = "https://arxiv.org/a/chen_j_2.html" | |
with urllib.request.urlopen(url) as response: | |
html = response.read() | |
soup = BeautifulSoup(html, 'html.parser') | |
for link in soup.find_all('a'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################# | |
# A simple implementation of TSQR (Tall and Skinny QR) in Julia # | |
# Jiahao Chen <jiahao@mit.edu>, 2015-08-03 # | |
################################################################# | |
# | |
# TSQR is a communication-avoiding QR algorithm designed for | |
# distributed computation on tall, skinny matrices, which are | |
# typical of data matrices in Big Data applications. | |
# | |
# The primary reference is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Distributions | |
export Measure, DiscreteMeasure, Estimator, EstimatorQuality, | |
blb, randsubset | |
abstract Measure | |
type DiscreteMeasure{S<:Number,T<:Number} <: Measure | |
points :: Vector{S} | |
weights :: Vector{T} |
NewerOlder