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
{-# LANGUAGE TypeSynonymInstances #-} | |
data Dual d = D Float d deriving Show | |
type Float' = Float | |
diff :: (Dual Float' -> Dual Float') -> Float -> Float' | |
diff f x = y' | |
where D y y' = f (D x 1) | |
class VectorSpace v where | |
zero :: v |
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
#include <stdio.h> | |
/* | |
2D convolution as used in machine learning, i.e. actually cross-correlation, not convolution. | |
But since the kernel would be learned either way, flipping it is not necessary. | |
So, let's just call it convolution. | |
*/ | |
int main() { | |
int STRIDE = 1; // Don't let this fool you; stride other than 1 will not work currently |
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
.section .text | |
.global _start | |
_start: | |
mov $4, %eax | |
mov $1, %ebx | |
mov $message, %ecx | |
mov msglength, %edx | |
int $0x80 | |
mov $1, %eax |