Skip to content

Instantly share code, notes, and snippets.

@steveAllen0112
Last active April 27, 2023 15:53
Show Gist options
  • Save steveAllen0112/8a80be126ff25a6818d205db6959b362 to your computer and use it in GitHub Desktop.
Save steveAllen0112/8a80be126ff25a6818d205db6959b362 to your computer and use it in GitHub Desktop.
⍝ Helper functions for the problem
⍝ here: https://open.kattis.com/problems/mnist10class
⍝ NB: This set of functions does NOT solve the problem.
⍝ For that, you need a training function, and real inputs
⍝ that you can check the results against.
⍝ Generate a random weightset
weightset ← {×0.5-2|?10 15 51⍴2}
⍝ Generate some random inputs
inputs ← {×0.5-2|?⍵ 51⍴2}
⍝ The network itself
guess ← { ⊣/ ⍒⍤1⍉ +⌿ ÷∘|⍨ +⌿ ⍺ ∘.×⍤2 1⍥⍉ ⍵⍴⍨1⌈¯2↑⍴⍵ }
⍝ Usage
(weightset⍬) guess inputs ?10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment