Skip to content

Instantly share code, notes, and snippets.

@hpoit
hpoit / ang_assignment2-v02.jl
Last active May 18, 2018 13:40
Coursera ML week 3 - assignment 2 v0.2 - implementing Logit model on two datasets
# Logit model, v0.2
using CSV, Plots; pyplot();
data = CSV.read("/Users/kevinliu/Documents/machine-learning-ex2/ex2/ex2data1.txt", datarow=1)
X = hcat(ones(100,1), Matrix(data[:, [1,2]]))
y = Vector(data[:, 3])
# Sigmoid function
function sigmoid(z)
@hpoit
hpoit / ang_assignment2-v03.jl
Last active May 26, 2018 01:11
Coursera ML week 3 - assignment 2 v0.3 - implementing Logit model on two datasets
# Logit mode, v0.3
using CSV, Plots; pyplot();
data = CSV.read("/Users/kevinliu/Documents/machine-learning-ex2/ex2/ex2data1.txt", datarow=1)
X = hcat(ones(100,1), Matrix(data[:, [1,2]]))
y = Vector(data[:, 3])
# Sigmoid function
function sigmoid(z)
@hpoit
hpoit / building MAT
Last active June 1, 2018 21:06
building MAT
julia> Pkg.add("MAT")
INFO: Cloning cache of Blosc from https://github.com/stevengj/Blosc.jl.git
INFO: Cloning cache of BufferedStreams from https://github.com/BioJulia/BufferedStreams.jl.git
INFO: Cloning cache of CMakeWrapper from https://github.com/rdeits/CMakeWrapper.jl.git
INFO: Cloning cache of HDF5 from https://github.com/JuliaIO/HDF5.jl.git
INFO: Cloning cache of Libz from https://github.com/BioJulia/Libz.jl.git
INFO: Cloning cache of MAT from https://github.com/JuliaIO/MAT.jl.git
INFO: Installing Blosc v0.5.0
INFO: Installing BufferedStreams v0.4.0
INFO: Installing CMakeWrapper v0.1.0
@hpoit
hpoit / regu_loss.jl
Created June 4, 2018 00:14
regularizing loss
julia> using Flux, Flux.Data.MNIST
julia> using Flux: onehotbatch, argmax, crossentropy, throttle
julia> using Base.Iterators: repeated
julia> # using CuArrays
# Classify MNIST digits with a simple multi-layer-perceptron
@hpoit
hpoit / NRLMSISE-00.for
Created June 12, 2018 02:19
MSIS atmosphere model
C-----------------------------------------------------------------------
SUBROUTINE GTD7(IYD,SEC,ALT,GLAT,GLONG,STL,F107A,F107,AP,MASS,D,T)
C
C NRLMSISE-00
C -----------
C Neutral Atmosphere Empirical Model from the surface to lower
C exosphere
C
C NEW FEATURES:
C *Extensive satellite drag database used in model generation
@hpoit
hpoit / gist:7c6ce575fc5a4a274ed8c9cb6eab4a19
Last active April 8, 2019 17:56
Cascadia.jl working webscraping example
# https://github.com/Algocircle/Cascadia.jl#webscraping-example
using Cascadia
using Gumbo
using HTTP
# using Requests (deprecated)
r = HTTP.get("http://stackoverflow.com/questions/tagged/julia-lang")
h = parsehtml(String(r.body))
@hpoit
hpoit / GraphQL_schemas_types.jl
Last active April 8, 2019 22:24
GraphQL_schemas_and_types.jl
# Object types and fields
struct Character
name::String
appearsIn::EpisodeArray
end
# Arguments
mutable struct Starship