Skip to content

Instantly share code, notes, and snippets.

View felipetavares's full-sized avatar

Felipe Tavares felipetavares

View GitHub Profile
@felipetavares
felipetavares / crypto.rkt
Created January 7, 2021 14:20
Notes on Crypto
#lang racket
;; Week 1
;; There are two protocols in secure communication:
;; - handshake protocol: finding a shared key
;; - record layer: sending and receiving data
;;
;; Encrypting files is the same as sending encrypted
;; messages between A -> B, except B is actually A in
@felipetavares
felipetavares / net.rkt
Last active March 6, 2021 23:35
Simple backprop neural net
#lang racket
(require math/matrix)
(define (sigmoid x) (/ (exp x) (+ (exp x) 1)))
(define (sigmoid~ x) (* (sigmoid x) (- 1 (sigmoid x))))
(define (tanh~ x) (/ 1 (expt (cosh x) 2)))
(define activation sigmoid)
(define activation~ sigmoid~)
@felipetavares
felipetavares / gauss-jackson.jl
Created May 17, 2021 21:36
Incomplete implementation of the Gauss-Jackson Integrator
"""
Backwards difference
∇fᵢ = (fᵢ - fᵢ₋₁)
"""
function ∇(power, f, i)
if power > 1
∇(power-1, f, i) - ∇(power-1, f, i-1)
else
f[i] - f[i-1]