Skip to content

Commit 97465c6

Browse files
committed
updates, gnuplot for splot, futhark
1 parent 6ab678c commit 97465c6

File tree

7 files changed

+72
-33
lines changed

7 files changed

+72
-33
lines changed

ai/books.org

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,9 @@ L =
507507

508508
- We flatten the input character images into a single row of features
509509
- we loss the geometry data
510-
- such technique would not work for other type of recognition (eg: discent races of elephants)
510+
- such technique would not work for other type of recognition (eg: discern between races of elephants)
511511

512-
**** Load Training Data
512+
**** Load Images
513513

514514
#+begin_src python
515515
import numpy as np
@@ -529,7 +529,7 @@ L =
529529
X_test = prepend_bias(load_images("../data/mnist/t10k-images-idx3-ubyte.gz"))
530530
#+end_src
531531

532-
**** Load Testing Data
532+
**** Load Labels
533533

534534
- We transform the labels to 0 for "not-5" and 1 for "5"
535535

ai/self.org

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@
135135
B1=
136136
#+end_src
137137
- https://en.wikipedia.org/wiki/MNIST_database
138+
- http://web.archive.org/web/20020622183530/http://yann.lecun.com:80/exdb/mnist/
138139
- Modified NIST (National Institute of Standards and Technology)
140+
- MSB
139141
- 28x28 grayscale
140142
- 1 byte pixels
141143
- 0x00 white

languages/compiled/ml/futhark/self.org

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,16 @@ Giving related functionality a common abstraction.
325325
val uncurry '^a '^b '^c : (a -> b -> c) -> (a,b) -> c
326326
#+end_src
327327

328+
** literate mode
329+
330+
- img = [ROW][COL]T
331+
332+
- :img
333+
- :video
334+
- [NIMG]img
335+
- (stepfn, initial_value, num_frames)
336+
- stepfn s = (img, newval)
337+
328338
** TODO in-place updates
329339

330340
- use must be rare
@@ -343,6 +353,15 @@ Giving related functionality a common abstraction.
343353

344354
- a .fut(hark) program might contain a =test block=
345355
- entrypoint can be elided if it is "main"
356+
- futharkscript functions https://futhark.readthedocs.io/en/latest/man/futhark-literate.html
357+
|------------+--------+--------------+-------------------|
358+
| | | <c> | |
359+
| $loadimg | "file" | [][]u32 | row major ARGB |
360+
| $loaddata | "file" | t ¦ (t,t...) | |
361+
| $loadbytes | "file" | []u8 | |
362+
| $loadaudio | "file" | [][]f64 | a row per channel |
363+
| $restore | | | |
364+
|------------+--------+--------------+-------------------|
346365
- =input/output sets=
347366
- can be put on 1 line
348367
- no record or tuples are permitted
@@ -361,6 +380,7 @@ Giving related functionality a common abstraction.
361380

362381
#+CAPTION: file input/output test block
363382
#+begin_src futhark
383+
entry foobar x = x
364384
-- compiled input @ foo.in
365385
-- output @ foo.out
366386
#+end_src

languages/compiled/ml/haskell/haskell.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- https://en.wikipedia.org/wiki/Dependent_type
2828
- https://en.wikipedia.org/wiki/Generalized_algebraic_data_type
2929
- tutorial http://caiorss.github.io/Functional-Programming/haskell/README.html
30+
- tutorial https://github.com/keithfancher/haskell-notes/blob/master/haskell-notes.md
3031

3132
** deriving - types that can be derived
3233
|---------+---------------------------------------|

languages/compiled/ml/sml.org

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
- https://smlfamily.github.io/
2-
- Playlist: Functional Programming with Standard ML (University of Trento)
3-
https://www.youtube.com/playlist?list=PLbdi8aNvDqlKKXdG7qn0rQsfH0z1hf7FC
42
- https://en.wikipedia.org/wiki/Standard_ML
53
- Introduction to SML
64
https://cs.lmu.edu/~ray/notes/introml/
5+
- Playlist: Functional Programming with Standard ML (University of Trento)
6+
https://www.youtube.com/playlist?list=PLbdi8aNvDqlKKXdG7qn0rQsfH0z1hf7FC
7+
- 23 CME: Principles of Functional Programming M23 https://www.youtube.com/playlist?list=PLsydD1kw8jng2t2G8USQNLz0faYZetPnH
8+
- https://brandonspark.github.io/150/
9+
- 1 slides https://brandonspark.github.io/prologue/lecture01.pdf

terminal/tools/parsers/self.org

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
- binary https://lwn.net/Articles/924133/
2+
- jq for binary https://github.com/wader/fq
3+
- gnu poke https://www.jemarch.net/poke
4+
- objdump
5+
- od
6+
- xxd
7+
- library https://kaitai.io/
18
- tool: web ui https://datasette.io/
29
- tool: fake data generator https://github.com/multiprocessio/fakegen
310
- tool: yaml/json/xml/csv/toml https://github.com/TomWright/dasel

terminal/tools/visualization/gnuplot/self.org

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -264,25 +264,47 @@ b -0.890 1.000
264264
| label | N at X,Y S | puts a label at X,Y position |
265265
|---------------+----------------+----------------------------------|
266266
*** general: splot
267-
|-------------+-------------+-----------------------------------|
268-
| dgrid3d | N,N | ???? |
269-
| xyplane | N | Z value where xyplane is |
270-
| +ticslevel+ | N | " DEPRECATED |
271-
| colorbox | - | color range box |
272-
| pm3d | border lw 1 | surface with lines |
273-
| isosamples | N | splot lines draw per xz axis |
274-
| view | X,Z | 0-180 rotation around axis |
275-
| hidden3d | - | non translucent (disables sample) |
276-
| | | linestyle 1/2 for top/bottom |
277-
| | | aka "hidden line removal" |
278-
|-------------+-------------+-----------------------------------|
267+
|-------------+------------------------------+-----------------------------------|
268+
| dgrid3d | N,N | ???? |
269+
| xyplane | N | Z value where xyplane is |
270+
| +ticslevel+ | N | " DEPRECATED |
271+
| colorbox | - | color range box |
272+
| pm3d | border lw 1 | surface with lines |
273+
| isosamples | N | splot lines draw per xz axis |
274+
| view | X,Z | 0-180 rotation around axis |
275+
| contour | base | |
276+
| cntrparam | levels auto 9 | |
277+
| | levels discrete 1, -1 | |
278+
| | levels incremental -2 .05 .2 | |
279+
| | first 10 sort | |
280+
| hidden | | |
281+
| hidden3d | - | non translucent (disables sample) |
282+
| | | linestyle 1/2 for top/bottom |
283+
| | | aka "hidden line removal" |
284+
|-------------+------------------------------+-----------------------------------|
279285

280286
#+begin_src gnuplot
281287
splot f(x,y) with pm3d # surface
282288
splot f(x,y) lc pal lw 2 # sets isolines color/thicc
283289
set lt 1 lc "seagreen" lw 3
284290
#+end_src
285291

292+
*** palette
293+
294+
http://gnuplot.info/demo/pm3dcolors.html
295+
296+
#+begin_src gnuplot
297+
set palette gray
298+
set palette rgb 7,5,15
299+
set palette defined (0 0 0 0, 0.3 1 0 0, 0.6 "blue", 1 "#ffffff")
300+
set palette defined (0 "blue", 0.5 "red", 1 "white")
301+
set palette defined (0 "black", 0.5 "blue", 0.5 "red", 1 "white")
302+
set palette cubehelix start 0 cycles -1. saturation 1
303+
set palette cubehelix start 1.2 cycles -1 saturation 1
304+
set palette cubehelix start pi/2 cycles -1 saturation 1
305+
set palette cubehelix start pi/2 cycles -15 saturation 1
306+
#+end_src
307+
286308
*** key
287309

288310
|-----+---------------+-------------------------------|
@@ -328,22 +350,6 @@ b -0.890 1.000
328350
- xterm (xterm tektronix mode)
329351
- dumb (aka ascii)
330352

331-
*** palette
332-
333-
http://gnuplot.info/demo/pm3dcolors.html
334-
335-
#+begin_src gnuplot
336-
set palette gray
337-
set palette rgb 7,5,15
338-
set palette defined (0 0 0 0, 0.3 1 0 0, 0.6 "blue", 1 "#ffffff")
339-
set palette defined (0 "blue", 0.5 "red", 1 "white")
340-
set palette defined (0 "black", 0.5 "blue", 0.5 "red", 1 "white")
341-
set palette cubehelix start 0 cycles -1. saturation 1
342-
set palette cubehelix start 1.2 cycles -1 saturation 1
343-
set palette cubehelix start pi/2 cycles -1 saturation 1
344-
set palette cubehelix start pi/2 cycles -15 saturation 1
345-
#+end_src
346-
347353
* snippets
348354

349355
- stream - draw last 200 lines, ten times per second

0 commit comments

Comments
 (0)