This file contains hidden or 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
#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 |
This file contains hidden or 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
#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~) |
This file contains hidden or 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
""" | |
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] |
OlderNewer