Skip to main content
Bounty Ended with 250 reputation awarded by dim
−211.21
Source Link
Anders Kaseorg
  • 40.1k
  • 3
  • 75
  • 146

Pyth (no built-in compression), score 4695.07 46564656.03 4444.0382

The current network is built from 45 sigmoid neurons, with each neuron connected to the x, y inputs and to every previous neuron, and the last three neurons interpreted as r, g, b. It’s trained using the Adam algorithm without batching. The parameters weighting the 1125 connections are quantized to a range of 11193 possible values (except the constant terms, which have 932 possible values) using a variant of stochastic quantization (the, the primary variation being that we set the gradient for quantized parameters to zero).

outputoutput

10241023 bytes, encoded with xxd (decode with xxd -r). I used the 2016-01-22 version of Pyth that was current when this challenge was released. You can run the code directly in Pyth, but Pyth in PyPy3 (pypy3 pyth starry.pyth) runs it nine times faster, in about 3 minutes. The output image is written to o.png.

00000000: 4b6a 7943 2205 2816 9967 c2f8 84f9 3569  KjyC".(..g....5i
00000010: c7d4 ec44 d654 6d9b 244f a8b9 c34d 55c3  ...D.Tm.$O...MU.
00000020: 105b b089 4a6b 2a74 3b4e 1e0b c6a3 2fc5  .[..Jk*t;N..../.
00000030: 525c 72af 238c b0a4 ffb8 70d4 ce43 5c47  R\r.#.....p..C\G
00000040: 59fe b248 4203 f475 3d16 1161 8724 1e0c  Y..HB..u=..a.$..
00000050: 9038 180a adc8 dd9c 1273 a453 8660 4cf1  .8.......s.S.`L.
00000060: e959 e66d 06db 8565 d1b3 a777 8e7c bc74  .Y.m...e...w.|.t
00000070: b42c 67e6 960c a876 be8e 6668 6f48 94e9  .,g....v..fhoH..
00000080: f394 f731 6897 f126 b112 e83f 1652 0e4f  ...1h..&...?.R.O
00000090: 10d6 5783 0b06 66e7 0a6d ea4e c229 f993  ..W...f..m.N.)..
000000a0: aef5 ceae 6c0b 155c 2204 ef26 def6 a987  ....l..\"..&....
000000b0: 7834 c294 51ec a66a 95b9 f099 e0e3 07d1  x4..Q..j........
000000c0: 8e88 c056 abd9 67d0 cd75 2681 6fc0 f0ad  ...V..g..u&.o...
000000d0: 520f 4bb0 ed8a 8d81 d5ef 95fe 35d6 d310  R.K.........5...
000000e0: 5d47 a578 20cb 33f8 f248 c203 0a23 caba  ]G.x .3..H...#..
000000f0: 0649 f3e1 98c2 0c7b 4f64 0773 c153 dbe0  .I.....{Od.s.S..
00000100: 507b f92d 513b 79d7 7d4d 3402 1c5d 34d9  P{.-Q;y.}M4..]4.
00000110: d52d 2174 4709 996d 5c86 413a 1acd 9303  .-!tG..m\.A:....
00000120: 9432 d79d 715b 9667 af48 c987 6f8c f9e3  .2..q[.g.H..o...
00000130: 8c35 6af8 37ce cc71 601e 9dea 7892 057c  .5j.7..q`...x..|
00000140: 454b 865a 4fcb 8c46 bb1e 3aab 4d68 875c  EK.ZO..F..:.Mh.\
00000150: 22fe a206 0cba beaf 8c4d ac09 13c4 bd14  "........M......
00000160: 6b20 a347 ff8e 98f1 e2c0 80a0 a87b ac6c  k .G.........{.l
00000170: ce73 2c6b 0306 ac08 ea4a 8ecc 6b7c 7e24  .s,k.....J..k|~$
00000180: c351 8d83 32a1 c1ff 9a4d 72d4 b113 6e4c  .Q..2....Mr...nL
00000190: c279 fb94 83ed 78d5 a4e7 1295 7f0b c6b7  .y....x.........
000001a0: 9a37 638e 15be 8af0 aca0 1230 30db 7a57  .7c........00.zW
000001b0: 7a81 8bfa a0aa 98b6 3ea2 d5b9 11bd b5ef  z.......>.......
000001c0: e06f 89fd f290 d099 794b 8af0 54e6 54b9  .o......yK..T.T.
000001d0: d3bf 4f49 ce8f 3684 fe90 b366 4ac8 9300  ..OI..6....fJ...
000001e0: 4a3f 5bbc 1eb3 4b41 782c fd20 47e2 97b0  J?[...KAx,. G...
000001f0: 97ca 0e62 f651 ef20 d80c bdc3 a888 64b8  ...b.Q. ......d.
00000200: fde1 c066 d8d0 5c72 c811 50cb 4679 fdab  ...f..\r..P.Fy..
00000210: 0f78 081c 2548 0bc0 57e9 69a2 c357 bc76  .x..%H..W.i..W.v
00000220: b404 037a 8e3b d216 7aa3 67e7 19f1 9e84  ...z.;..z.g.....
00000230: 26bd 7da7 89da d41d 9541 a491 fbdb d615  &.}......A......
00000240: fb20 9887 fb85 71d0 ef9b 974a 9daa 90fc  . ....q....J....
00000250: 913b b156 1f3a f268 90d7 ab8b 505b a1c5  .;.V.:.h....P[..
00000260: dbce 1fcf f42c 1ade 8718 52d1 3761 0fe0  .....,....R.7a..
00000270: 16e7 1faa 5e28 1e70 eee7 0914 b878 8b75  ....^(.p.....x.u
00000280: d61c e30c 923d e892 3309 a084 3c8f bd61  .....=..3...<..a
00000290: a6fc 755b 7636 4138 de67 93fa e415 8377  ..u[v6A8.g.....w
000002a0: d92a 4d54 ab62 ebf5 7554 5b64 2f8f dc17  .*MT.b..uT[d/...
000002b0: 2bbe 9dd4 f1b5 14ef 37bc cf07 f6a3 5c22  +.......7.....\"
000002c0: a2ea fae1 c1f0 ef7b 92a8 45b5 c560 becf  .......{..E..`..
000002d0: ac12 56de 13d3 4cd8 523b 2e2a 432f c585  ..V...L.R;.*C/..
000002e0: d8ea d1ea 0e5e 1361 b34b 6980 6d19 2cce  .....^.a.Ki.m.,.
000002f0: 1615 e977 95ed 95bd 11b8 28c7 d74b ddcc  ...w......(..K..
00000300: 4584 79b4 074c f529 dc5b c57d 9e27 6d1e  E.y..L.).[.}.'m.
00000310: ccdf c193 8c90 9529 4802 b9a8 5d6f 9f59  .......)H...]o.Y
00000320: 42cf d182 9e7e 0f0c f25c 5c00 bb24 30da  B....~...\\..$0.
00000330: db1f 4cdd 1a54 c010 a3b0 b0ee ec16 adf5  ..L..T..........
00000340: 4ff4 d9f2 efe7 448d 8082 9565 72ff 2adc  O.....D....er.*.
00000350: fa80 a2db 3b4e 7da6 0f2b d458 be51 989e  ....;N}..+.X.Q..
00000360: cc77 caf2 9abe 7e59 d4a7 a36d ef4d fe93  .w....~Y...m.M..
00000370: 7ab7 4190 1629 0cab 1649 2069 e78f 8d9f  z.A..)...I i....
00000380: 7d5b d3ee 9789 9f25 887c 9d6c cb01 d277  }[.....%.|.l...w
00000390: 8e2f 1909 045d 6bf2 5161 1f4d cda9 a94f  ./...]k.Qa.M...O
000003a0: 7865 2355 1112 b5f9 8818 27b1 c166 e2ba  xe#U......'..f..
000003b0: c6b6 5df1 9d32 db44 8905 23e2 ee6c 35f4  ..]..2.D..#..l5.
000003c0: 9279 894f 4691 5c5c 2231 3131 2e77 6d6d  .y.OF.\\"111.wmm
000003d0: 2b4a 4b73 4d3e 332e 574a 615a 6332 3536  +JKsM>3.WJaZc256
000003e0: 685e 3863 732a 4c2d 3535 2e29 4a5a 3333  h^8cs*L-55.)JZ33
000003f0: 3634 5b32 3536 6b64 2933 3836 2033 3230  64[256kd)386 320
00000000: 4b6a 4322 05d4 7bb1 06f8 6149 da66 28e3  KjC"..{...aI.f(.
00000010: 8d17 92de a833 9b70 f937 9fc6 a74e 544d  .....3.p.7...NTM
00000020: 1388 e4e5 1d7e 9432 fe38 1313 3c34 0c54  .....~.2.8..<4.T
00000030: 89fe 553b 83a3 84bb 08c8 09fe 72be 3597  ..U;........r.5.
00000040: b799 34f8 8809 4868 feb8 acde 2e69 34e6  ..4...Hh.....i4.
00000050: 1c1a c49a 27f0 f06a 3b27 0564 178a 1718  ....'..j;'.d....
00000060: 1440 e658 e06a c46d aa81 ac3f c4b7 8262  [email protected]...?...b
00000070: 398a 39e3 c9b7 6f71 e2ab 37e0 7566 9997  9.9...oq..7.uf..
00000080: 54eb eb95 0076 0adf 103c f34c 0b4e e528  T....v...<.L.N.(
00000090: a2df 6b4a 7a02 011a 10a9 2cf0 2edc 9f6f  ..kJz.....,....o
000000a0: 33f3 5c96 9e83 fadb a2fa 80fc 5179 3906  3.\.........Qy9.
000000b0: 9596 4960 8997 7225 edb1 9db5 435e fdd8  ..I`..r%....C^..
000000c0: 08a6 112f 32de c1a5 3db8 160f b729 649a  .../2...=....)d.
000000d0: 51fa 08e8 dcfa 11e0 b763 61e6 02b3 5dbb  Q........ca...].
000000e0: 6e64 be69 3939 b5b2 d196 5b85 7991 bda5  nd.i99....[.y...
000000f0: 087a f3c0 6b76 b1d0 bb29 f7a4 29a3 e21a  .z..kv...)..)...
00000100: 3b1b 97ae 1d1b 1e0f f3c7 9759 2458 c2db  ;..........Y$X..
00000110: 386f 5fbb a166 9f27 2910 a1b5 cfcc d8db  8o_..f.').......
00000120: afaf bdb4 573d efb1 399b e160 6acf e14b  ....W=..9..`j..K
00000130: 4c6b 957a 245a 6f87 63c7 737d 6218 6ab2  Lk.z$Zo.c.s}b.j.
00000140: e388 a0b3 2007 1ddf b55c 7266 4333 f3a2  .... ....\rfC3..
00000150: d58f d80b a3a6 c6c1 d474 58f3 274b 6d32  .........tX.'Km2
00000160: 9d72 b674 7cc4 fdf6 6b86 fb45 1219 cc5c  .r.t|...k..E...\
00000170: 7244 396d 1411 d734 a796 ff54 cf1f 119d  rD9m...4...T....
00000180: 91af 5eab 9aad 4300 1dae d42e 13f8 62a1  ..^...C.......b.
00000190: a894 ab0b 9cb1 5ee2 bb63 1fff 3721 2328  ......^..c..7!#(
000001a0: 7609 34f5 fcfe f486 46e9 dfa8 9885 4dac  v.4.....F.....M.
000001b0: f464 3666 e8b9 cd82 1159 8434 95e8 5901  .d6f.....Y.4..Y.
000001c0: f0f5 426c ef53 6c7e ad28 60f6 8dd8 edaa  ..Bl.Sl~.(`.....
000001d0: 8784 a966 81b6 dc3a e0ea d5bf 7f15 683e  ...f...:......h>
000001e0: 93f2 23ae 0845 c218 6bdc f47c 08e8 41c2  ..#..E..k..|..A.
000001f0: 950e f309 d1de 0b64 5868 924e 933e 7ab8  .......dXh.N.>z.
00000200: dab7 8efb b53a 5413 c64b 48e6 fc4d 26fe  .....:T..KH..M&.
00000210: 594a 7d6b 2dd0 914e 6947 afa7 614d b605  YJ}k-..NiG..aM..
00000220: 8737 554e 31bc b21c 3673 76bf fb98 94f8  .7UN1...6sv.....
00000230: 1a7d 0030 3035 2ce6 c302 f6c2 5434 5f74  .}.005,.....T4_t
00000240: c692 349a a33e b327 425c 22e8 8735 37e1  ..4..>.'B\"..57.
00000250: 942a 2170 ef10 ff42 b629 e572 cd0f ca4f  .*!p...B.).r...O
00000260: 5d52 247d 3e62 6d9a d71a 8b01 4826 d54b  ]R$}>bm.....H&.K
00000270: f26f fe8e d33d efb5 30a8 54fb d50a 8f44  .o...=..0.T....D
00000280: a3ac 170a b9a0 e436 50d5 0589 6fda 674a  .......6P...o.gJ
00000290: 26fb 5cf6 27ef 714e fe74 64fa d487 afea  &.\.'.qN.td.....
000002a0: 09f7 e1f1 21b6 38eb 54cd c736 2afa d031  ....!.8.T..6*..1
000002b0: 853c 8890 8cc0 7fab 5f15 91d5 de6e 460f  .<......_....nF.
000002c0: 4b95 6a4d 02e4 7824 1bbe ae36 5e6c 0acd  K.jM..x$...6^l..
000002d0: 0603 b86c f9fd a299 480f 4123 627e 951f  ...l....H.A#b~..
000002e0: a678 3510 912c 26a6 2efc f943 af96 53cd  .x5..,&....C..S.
000002f0: 3f6c 435c cbae 832f 316c e90e 01e7 8fd6  ?lC\.../1l......
00000300: 3e6d d7b4 fffb cd4a 69c7 5f23 2fe7 bf52  >m.....Ji._#/..R
00000310: 3632 3990 17ed 045a b543 8b79 8231 bc9b  629....Z.C.y.1..
00000320: 4452 0f10 b342 3e41 6e70 187c 9cb2 7eb5  DR...B>Anp.|..~.
00000330: cdff 5c22 9e34 618f b372 8acf 4172 a220  ..\".4a..r..Ar. 
00000340: 0136 3eff 2702 dc5d b946 076d e5fd 6045  .6>.'..].F.m..`E
00000350: 8465 661a 1c6e b6c8 595f 6091 daf2 103b  .ef..n..Y_`....;
00000360: 23ab 343a 2e47 95cf 4218 7bf5 8a46 0a69  #.4:.G..B.{..F.i
00000370: dabb 4b8d 7f9b b0c1 23b1 c917 839c 358c  ..K.....#.....5.
00000380: b33c de51 e41c e84d 12bf 8379 f4c5 65fa  .<.Q...M...y..e.
00000390: 0b65 7fe7 e1a0 fb0e 30f4 a7d2 b323 3400  .e......0....#4.
000003a0: 15e8 8a48 5d42 9a70 3979 7bba abf5 4b80  ...H]B.p9y{...K.
000003b0: b239 4ceb d301 89f8 9f4d 5ce6 8caa 2a74  .9L......M\...*t
000003c0: ca1b 9d3f f934 0622 3933 2e77 6d6d 2b4a  ...?.4."93.wmm+J
000003d0: 4b73 4d3e 332e 574a 615a 6332 3536 685e  KsM>3.WJaZc256h^
000003e0: 3463 732a 4c2d 3436 2e29 4a5a 3138 3739  4cs*L-46.)JZ1879
000003f0: 5b32 3739 6b33 6429 3338 3620 3332 30    [279k3d)386 320
KjyC"…"111KjC"…"93
   C"…"      convert the long binary string to an integer in base 256
  y          double it
 j     11193   list its base 11193 digits
K            assign to K

.wmm+JKsM>3.WJaZc256h^8cs*LWJaZc256h^4cs*L-5546.)JZ3364[256kdJZ1879[279k3d)386 320
  m                                              320 320  map for d in [0, …, 319]:
   m                                         386 386        map for k in [0, …, 385]
     JK                                                    copy K to J
                                      [256kd[279k3d)              initialize value to [256[3*93, k, 3, d]
           .WJ                                             while J is nonempty, replace value with
                         *L      Z                           map over value, multiplying by
                              .)J                              pop back of J
                           -5546                                 subtract from 5546
                        s                                    sum
                       c          33641879                       divide by 33641879
                     ^8^4                                      exponentiate with base 84
                    h                                        add 1
                c256                                         256 divided by that
              aZ                                             append to value
         >3                                                last three elements of the final value
       sM                                                  floor to integers
.w                                                     write that matrix of RGB triples as image o.png

neuron activationsneuron activations

Pyth (no built-in compression), score 4695.07 4656.03

The current network is built from 45 sigmoid neurons, with each neuron connected to the x, y inputs and to every previous neuron, and the last three neurons interpreted as r, g, b. It’s trained using the Adam algorithm without batching. The parameters weighting the 1125 connections are quantized to a range of 111 possible values using a variant of stochastic quantization (the primary variation being that we set the gradient for quantized parameters to zero).

output

1024 bytes, encoded with xxd (decode with xxd -r). I used the 2016-01-22 version of Pyth that was current when this challenge was released. You can run the code directly in Pyth, but Pyth in PyPy3 (pypy3 pyth starry.pyth) runs it nine times faster, in about 3 minutes. The output image is written to o.png.

00000000: 4b6a 7943 2205 2816 9967 c2f8 84f9 3569  KjyC".(..g....5i
00000010: c7d4 ec44 d654 6d9b 244f a8b9 c34d 55c3  ...D.Tm.$O...MU.
00000020: 105b b089 4a6b 2a74 3b4e 1e0b c6a3 2fc5  .[..Jk*t;N..../.
00000030: 525c 72af 238c b0a4 ffb8 70d4 ce43 5c47  R\r.#.....p..C\G
00000040: 59fe b248 4203 f475 3d16 1161 8724 1e0c  Y..HB..u=..a.$..
00000050: 9038 180a adc8 dd9c 1273 a453 8660 4cf1  .8.......s.S.`L.
00000060: e959 e66d 06db 8565 d1b3 a777 8e7c bc74  .Y.m...e...w.|.t
00000070: b42c 67e6 960c a876 be8e 6668 6f48 94e9  .,g....v..fhoH..
00000080: f394 f731 6897 f126 b112 e83f 1652 0e4f  ...1h..&...?.R.O
00000090: 10d6 5783 0b06 66e7 0a6d ea4e c229 f993  ..W...f..m.N.)..
000000a0: aef5 ceae 6c0b 155c 2204 ef26 def6 a987  ....l..\"..&....
000000b0: 7834 c294 51ec a66a 95b9 f099 e0e3 07d1  x4..Q..j........
000000c0: 8e88 c056 abd9 67d0 cd75 2681 6fc0 f0ad  ...V..g..u&.o...
000000d0: 520f 4bb0 ed8a 8d81 d5ef 95fe 35d6 d310  R.K.........5...
000000e0: 5d47 a578 20cb 33f8 f248 c203 0a23 caba  ]G.x .3..H...#..
000000f0: 0649 f3e1 98c2 0c7b 4f64 0773 c153 dbe0  .I.....{Od.s.S..
00000100: 507b f92d 513b 79d7 7d4d 3402 1c5d 34d9  P{.-Q;y.}M4..]4.
00000110: d52d 2174 4709 996d 5c86 413a 1acd 9303  .-!tG..m\.A:....
00000120: 9432 d79d 715b 9667 af48 c987 6f8c f9e3  .2..q[.g.H..o...
00000130: 8c35 6af8 37ce cc71 601e 9dea 7892 057c  .5j.7..q`...x..|
00000140: 454b 865a 4fcb 8c46 bb1e 3aab 4d68 875c  EK.ZO..F..:.Mh.\
00000150: 22fe a206 0cba beaf 8c4d ac09 13c4 bd14  "........M......
00000160: 6b20 a347 ff8e 98f1 e2c0 80a0 a87b ac6c  k .G.........{.l
00000170: ce73 2c6b 0306 ac08 ea4a 8ecc 6b7c 7e24  .s,k.....J..k|~$
00000180: c351 8d83 32a1 c1ff 9a4d 72d4 b113 6e4c  .Q..2....Mr...nL
00000190: c279 fb94 83ed 78d5 a4e7 1295 7f0b c6b7  .y....x.........
000001a0: 9a37 638e 15be 8af0 aca0 1230 30db 7a57  .7c........00.zW
000001b0: 7a81 8bfa a0aa 98b6 3ea2 d5b9 11bd b5ef  z.......>.......
000001c0: e06f 89fd f290 d099 794b 8af0 54e6 54b9  .o......yK..T.T.
000001d0: d3bf 4f49 ce8f 3684 fe90 b366 4ac8 9300  ..OI..6....fJ...
000001e0: 4a3f 5bbc 1eb3 4b41 782c fd20 47e2 97b0  J?[...KAx,. G...
000001f0: 97ca 0e62 f651 ef20 d80c bdc3 a888 64b8  ...b.Q. ......d.
00000200: fde1 c066 d8d0 5c72 c811 50cb 4679 fdab  ...f..\r..P.Fy..
00000210: 0f78 081c 2548 0bc0 57e9 69a2 c357 bc76  .x..%H..W.i..W.v
00000220: b404 037a 8e3b d216 7aa3 67e7 19f1 9e84  ...z.;..z.g.....
00000230: 26bd 7da7 89da d41d 9541 a491 fbdb d615  &.}......A......
00000240: fb20 9887 fb85 71d0 ef9b 974a 9daa 90fc  . ....q....J....
00000250: 913b b156 1f3a f268 90d7 ab8b 505b a1c5  .;.V.:.h....P[..
00000260: dbce 1fcf f42c 1ade 8718 52d1 3761 0fe0  .....,....R.7a..
00000270: 16e7 1faa 5e28 1e70 eee7 0914 b878 8b75  ....^(.p.....x.u
00000280: d61c e30c 923d e892 3309 a084 3c8f bd61  .....=..3...<..a
00000290: a6fc 755b 7636 4138 de67 93fa e415 8377  ..u[v6A8.g.....w
000002a0: d92a 4d54 ab62 ebf5 7554 5b64 2f8f dc17  .*MT.b..uT[d/...
000002b0: 2bbe 9dd4 f1b5 14ef 37bc cf07 f6a3 5c22  +.......7.....\"
000002c0: a2ea fae1 c1f0 ef7b 92a8 45b5 c560 becf  .......{..E..`..
000002d0: ac12 56de 13d3 4cd8 523b 2e2a 432f c585  ..V...L.R;.*C/..
000002e0: d8ea d1ea 0e5e 1361 b34b 6980 6d19 2cce  .....^.a.Ki.m.,.
000002f0: 1615 e977 95ed 95bd 11b8 28c7 d74b ddcc  ...w......(..K..
00000300: 4584 79b4 074c f529 dc5b c57d 9e27 6d1e  E.y..L.).[.}.'m.
00000310: ccdf c193 8c90 9529 4802 b9a8 5d6f 9f59  .......)H...]o.Y
00000320: 42cf d182 9e7e 0f0c f25c 5c00 bb24 30da  B....~...\\..$0.
00000330: db1f 4cdd 1a54 c010 a3b0 b0ee ec16 adf5  ..L..T..........
00000340: 4ff4 d9f2 efe7 448d 8082 9565 72ff 2adc  O.....D....er.*.
00000350: fa80 a2db 3b4e 7da6 0f2b d458 be51 989e  ....;N}..+.X.Q..
00000360: cc77 caf2 9abe 7e59 d4a7 a36d ef4d fe93  .w....~Y...m.M..
00000370: 7ab7 4190 1629 0cab 1649 2069 e78f 8d9f  z.A..)...I i....
00000380: 7d5b d3ee 9789 9f25 887c 9d6c cb01 d277  }[.....%.|.l...w
00000390: 8e2f 1909 045d 6bf2 5161 1f4d cda9 a94f  ./...]k.Qa.M...O
000003a0: 7865 2355 1112 b5f9 8818 27b1 c166 e2ba  xe#U......'..f..
000003b0: c6b6 5df1 9d32 db44 8905 23e2 ee6c 35f4  ..]..2.D..#..l5.
000003c0: 9279 894f 4691 5c5c 2231 3131 2e77 6d6d  .y.OF.\\"111.wmm
000003d0: 2b4a 4b73 4d3e 332e 574a 615a 6332 3536  +JKsM>3.WJaZc256
000003e0: 685e 3863 732a 4c2d 3535 2e29 4a5a 3333  h^8cs*L-55.)JZ33
000003f0: 3634 5b32 3536 6b64 2933 3836 2033 3230  64[256kd)386 320
KjyC"…"111
   C"…"      convert the long binary string to an integer in base 256
  y          double it
 j     111   list its base 111 digits
K            assign to K

.wmm+JKsM>3.WJaZc256h^8cs*L-55.)JZ3364[256kd)386 320
  m                                              320   map for d in [0, …, 319]:
   m                                         386         map for k in [0, …, 385]
     JK                                                    copy K to J
                                      [256kd)              initialize value to [256, k, d]
           .WJ                                             while J is nonempty, replace value with
                         *L      Z                           map over value, multiplying by
                              .)J                              pop back of J
                           -55                                 subtract from 55
                        s                                    sum
                       c          3364                       divide by 3364
                     ^8                                      exponentiate with base 8
                    h                                        add 1
                c256                                         256 divided by that
              aZ                                             append to value
         >3                                                last three elements of the final value
       sM                                                  floor to integers
.w                                                     write that matrix of RGB triples as image o.png

neuron activations

Pyth (no built-in compression), score 4695.07 4656.03 4444.82

The current network is built from 45 sigmoid neurons, with each neuron connected to the x, y inputs and to every previous neuron, and the last three neurons interpreted as r, g, b. It’s trained using the Adam algorithm without batching. The parameters weighting the 1125 connections are quantized to a range of 93 possible values (except the constant terms, which have 932 possible values) using a variant of stochastic quantization, the primary variation being that we set the gradient for quantized parameters to zero.

output

1023 bytes, encoded with xxd (decode with xxd -r). I used the 2016-01-22 version of Pyth that was current when this challenge was released. You can run the code directly in Pyth, but Pyth in PyPy3 (pypy3 pyth starry.pyth) runs it nine times faster, in about 3 minutes. The output image is written to o.png.

00000000: 4b6a 4322 05d4 7bb1 06f8 6149 da66 28e3  KjC"..{...aI.f(.
00000010: 8d17 92de a833 9b70 f937 9fc6 a74e 544d  .....3.p.7...NTM
00000020: 1388 e4e5 1d7e 9432 fe38 1313 3c34 0c54  .....~.2.8..<4.T
00000030: 89fe 553b 83a3 84bb 08c8 09fe 72be 3597  ..U;........r.5.
00000040: b799 34f8 8809 4868 feb8 acde 2e69 34e6  ..4...Hh.....i4.
00000050: 1c1a c49a 27f0 f06a 3b27 0564 178a 1718  ....'..j;'.d....
00000060: 1440 e658 e06a c46d aa81 ac3f c4b7 8262  [email protected]...?...b
00000070: 398a 39e3 c9b7 6f71 e2ab 37e0 7566 9997  9.9...oq..7.uf..
00000080: 54eb eb95 0076 0adf 103c f34c 0b4e e528  T....v...<.L.N.(
00000090: a2df 6b4a 7a02 011a 10a9 2cf0 2edc 9f6f  ..kJz.....,....o
000000a0: 33f3 5c96 9e83 fadb a2fa 80fc 5179 3906  3.\.........Qy9.
000000b0: 9596 4960 8997 7225 edb1 9db5 435e fdd8  ..I`..r%....C^..
000000c0: 08a6 112f 32de c1a5 3db8 160f b729 649a  .../2...=....)d.
000000d0: 51fa 08e8 dcfa 11e0 b763 61e6 02b3 5dbb  Q........ca...].
000000e0: 6e64 be69 3939 b5b2 d196 5b85 7991 bda5  nd.i99....[.y...
000000f0: 087a f3c0 6b76 b1d0 bb29 f7a4 29a3 e21a  .z..kv...)..)...
00000100: 3b1b 97ae 1d1b 1e0f f3c7 9759 2458 c2db  ;..........Y$X..
00000110: 386f 5fbb a166 9f27 2910 a1b5 cfcc d8db  8o_..f.').......
00000120: afaf bdb4 573d efb1 399b e160 6acf e14b  ....W=..9..`j..K
00000130: 4c6b 957a 245a 6f87 63c7 737d 6218 6ab2  Lk.z$Zo.c.s}b.j.
00000140: e388 a0b3 2007 1ddf b55c 7266 4333 f3a2  .... ....\rfC3..
00000150: d58f d80b a3a6 c6c1 d474 58f3 274b 6d32  .........tX.'Km2
00000160: 9d72 b674 7cc4 fdf6 6b86 fb45 1219 cc5c  .r.t|...k..E...\
00000170: 7244 396d 1411 d734 a796 ff54 cf1f 119d  rD9m...4...T....
00000180: 91af 5eab 9aad 4300 1dae d42e 13f8 62a1  ..^...C.......b.
00000190: a894 ab0b 9cb1 5ee2 bb63 1fff 3721 2328  ......^..c..7!#(
000001a0: 7609 34f5 fcfe f486 46e9 dfa8 9885 4dac  v.4.....F.....M.
000001b0: f464 3666 e8b9 cd82 1159 8434 95e8 5901  .d6f.....Y.4..Y.
000001c0: f0f5 426c ef53 6c7e ad28 60f6 8dd8 edaa  ..Bl.Sl~.(`.....
000001d0: 8784 a966 81b6 dc3a e0ea d5bf 7f15 683e  ...f...:......h>
000001e0: 93f2 23ae 0845 c218 6bdc f47c 08e8 41c2  ..#..E..k..|..A.
000001f0: 950e f309 d1de 0b64 5868 924e 933e 7ab8  .......dXh.N.>z.
00000200: dab7 8efb b53a 5413 c64b 48e6 fc4d 26fe  .....:T..KH..M&.
00000210: 594a 7d6b 2dd0 914e 6947 afa7 614d b605  YJ}k-..NiG..aM..
00000220: 8737 554e 31bc b21c 3673 76bf fb98 94f8  .7UN1...6sv.....
00000230: 1a7d 0030 3035 2ce6 c302 f6c2 5434 5f74  .}.005,.....T4_t
00000240: c692 349a a33e b327 425c 22e8 8735 37e1  ..4..>.'B\"..57.
00000250: 942a 2170 ef10 ff42 b629 e572 cd0f ca4f  .*!p...B.).r...O
00000260: 5d52 247d 3e62 6d9a d71a 8b01 4826 d54b  ]R$}>bm.....H&.K
00000270: f26f fe8e d33d efb5 30a8 54fb d50a 8f44  .o...=..0.T....D
00000280: a3ac 170a b9a0 e436 50d5 0589 6fda 674a  .......6P...o.gJ
00000290: 26fb 5cf6 27ef 714e fe74 64fa d487 afea  &.\.'.qN.td.....
000002a0: 09f7 e1f1 21b6 38eb 54cd c736 2afa d031  ....!.8.T..6*..1
000002b0: 853c 8890 8cc0 7fab 5f15 91d5 de6e 460f  .<......_....nF.
000002c0: 4b95 6a4d 02e4 7824 1bbe ae36 5e6c 0acd  K.jM..x$...6^l..
000002d0: 0603 b86c f9fd a299 480f 4123 627e 951f  ...l....H.A#b~..
000002e0: a678 3510 912c 26a6 2efc f943 af96 53cd  .x5..,&....C..S.
000002f0: 3f6c 435c cbae 832f 316c e90e 01e7 8fd6  ?lC\.../1l......
00000300: 3e6d d7b4 fffb cd4a 69c7 5f23 2fe7 bf52  >m.....Ji._#/..R
00000310: 3632 3990 17ed 045a b543 8b79 8231 bc9b  629....Z.C.y.1..
00000320: 4452 0f10 b342 3e41 6e70 187c 9cb2 7eb5  DR...B>Anp.|..~.
00000330: cdff 5c22 9e34 618f b372 8acf 4172 a220  ..\".4a..r..Ar. 
00000340: 0136 3eff 2702 dc5d b946 076d e5fd 6045  .6>.'..].F.m..`E
00000350: 8465 661a 1c6e b6c8 595f 6091 daf2 103b  .ef..n..Y_`....;
00000360: 23ab 343a 2e47 95cf 4218 7bf5 8a46 0a69  #.4:.G..B.{..F.i
00000370: dabb 4b8d 7f9b b0c1 23b1 c917 839c 358c  ..K.....#.....5.
00000380: b33c de51 e41c e84d 12bf 8379 f4c5 65fa  .<.Q...M...y..e.
00000390: 0b65 7fe7 e1a0 fb0e 30f4 a7d2 b323 3400  .e......0....#4.
000003a0: 15e8 8a48 5d42 9a70 3979 7bba abf5 4b80  ...H]B.p9y{...K.
000003b0: b239 4ceb d301 89f8 9f4d 5ce6 8caa 2a74  .9L......M\...*t
000003c0: ca1b 9d3f f934 0622 3933 2e77 6d6d 2b4a  ...?.4."93.wmm+J
000003d0: 4b73 4d3e 332e 574a 615a 6332 3536 685e  KsM>3.WJaZc256h^
000003e0: 3463 732a 4c2d 3436 2e29 4a5a 3138 3739  4cs*L-46.)JZ1879
000003f0: 5b32 3739 6b33 6429 3338 3620 3332 30    [279k3d)386 320
KjC"…"93
  C"…"     convert the long binary string to an integer in base 256
 j    93   list its base 93 digits
K          assign to K

.wmm+JKsM>3.WJaZc256h^4cs*L-46.)JZ1879[279k3d)386 320
  m                                               320  map for d in [0, …, 319]:
   m                                          386        map for k in [0, …, 385]
     JK                                                    copy K to J
                                      [279k3d)             initialize value to [3*93, k, 3, d]
           .WJ                                             while J is nonempty, replace value with
                         *L      Z                           map over value, multiplying by
                              .)J                              pop back of J
                           -46                                 subtract from 46
                        s                                    sum
                       c          1879                       divide by 1879
                     ^4                                      exponentiate with base 4
                    h                                        add 1
                c256                                         256 divided by that
              aZ                                             append to value
         >3                                                last three elements of the final value
       sM                                                  floor to integers
.w                                                     write that matrix of RGB triples as image o.png

neuron activations

−39.04
Source Link
Anders Kaseorg
  • 40.1k
  • 3
  • 75
  • 146

Pyth (no built-in compression), score 46954695.07 4656.0703

outputoutput

10201024 bytes, encoded with xxd (decode with xxd -r). I used the 2016-01-22 version of Pyth that was current when this challenge was released. You can run the code directly in Pyth, but Pyth in PyPy3 (pypy3 pyth starry.pyth) runs it nine times faster, in about 3 minutes. The output image is written to o.png.

00000000: 4b6a 4322 0bf9 084a 6143 7853 022b 4d7d  KjC"...JaCxS.+M}
00000010: e23f 42f4 5c22 09df 7337 52d9 dcbf 9567  .?B.\"..s7R....g
00000020: d5be b388 1493 da66 5398 2579 a9fd eb34  .......fS.%y...4
00000030: 6472 5e97 0519 336d ab36 30cd 8a83 165c  dr^...3m.60....\
00000040: 72f2 bc43 d8d4 951e 51c1 57ba 3f80 3a12  r..C....Q.W.?.:.
00000050: eb2e 1294 7361 a657 b575 a67b 1644 b31c  ....sa.W.u.{.D..
00000060: 79dc 553c a78a 7e42 2d14 2d60 e2db 11e3  y.U<..~B-.-`....
00000070: fcb6 6fd8 4a44 db53 4662 1841 9536 4fd0  ..o.JD.SFb.A.6O.
00000080: cfe9 3cbd 98a2 b8b2 7034 3258 0ee4 a4e7  ..<.....p42X....
00000090: 5d27 4c24 839f 8070 1d8c 7f69 0c3c 177d  ]'L$...p...i.<.}
000000a0: b678 a1d0 de97 e5d0 b008 9bb6 ae17 5172  .x............Qr
000000b0: 5e6b f4fd 9142 b2f2 a83c d594 5999 d424  ^k...B...<..Y..$
000000c0: 9d04 d45c 42aa ff6f 7869 24db c691 bab9  ...\B..oxi$.....
000000d0: b235 c26d 87b6 8a2e 5e78 980a 64b8 e3aa  .5.m....^x..d...
000000e0: db46 143c feae 94fc 928e 1e58 da07 d441  .F.<.......X...A
000000f0: d926 459a e2b3 fc27 ddef cc1a c576 faee  .&E....'.....v..
00000100: 0397 160c ba40 966d c0de 8e96 2a66 859a  [email protected]....*f..
00000110: 82cb 2690 1633 27bb e3bd 41b6 597d d36e  ..&..3'...A.Y}.n
00000120: 570b 1038 43b3 7387 ded8 ca58 a3c0 6f6c  W..8C.s....X..ol
00000130: 447b 2565 c9e2 fff7 7064 bcba 36e4 9340  D{%e....pd..6..@
00000140: a16e 52b4 b4ed a721 fe9e 7693 d679 b8f3  .nR....!..v..y..
00000150: 3739 4b0a 4e1f 5a6e a5e1 f7e5 5c20 0942  79K.N.Zn....\ .B
00000160: 3d3c c000 962a 2106 7b79 9c95 44ea c120  =<...*!.{y..D.. 
00000170: 9310 2b7c beef 40ee 4ccc 5fb2 b4f9 a2b8  ..+|[email protected]._.....
00000180: 8fcb 3029 bb0b 7723 ab94 4ea7 ecf6 02b1  ..0)..w#..N.....
00000190: 3e95 bced b677 5888 172c b7e4 25c0 256e  >....wX..,..%.%n
000001a0: 13d2 c837 f4f6 1b0f ed78 5c72 abca 1413  ...7.....x\r....
000001b0: c490 b628 7753 2cd3 5b68 df63 e08f 57f4  ...(wS,.[h.c..W.
000001c0: b172 da04 18dc 9c96 620e 342c bd23 f24b  .r......b.4,.#.K
000001d0: 2c1c 95ec efba 5df4 8a18 433c 70a5 ac07  ,.....]...C<p...
000001e0: e082 97f2 3a09 d33e e002 2076 c764 15e4  ....:..>.. v.d..
000001f0: 5cfa 427e 40ea 89b7 9cd9 afda d121 6440  \.B~@........!d@
00000200: 1e54 2700 3e60 3b16 ea84 07cb b4b3 027c  .T'.>`;........|
00000210: f3b8 0f54 d759 563c 7ef2 b4df 4deb 476f  ...T.YV<~...M.Go
00000220: 3731 5839 9058 fa98 7a14 f511 6b55 4a90  71X9.X..z...kUJ.
00000230: d60f 2f65 4875 a618 4bac 3c5d b9b7 359d  ../eHu..K.<]..5.
00000240: dee5 3c71 d13d 9129 dab3 4bed e89e 3127  ..<q.=.)..K...1'
00000250: 975c 22bf fd41 85a8 52a1 13de e1fb 6679  .\"..A..R.....fy
00000260: 55af 1431 ae2f 6230 ec4e 560e 90e9 939b  U..1./b0.NV.....
00000270: a4ef 5b84 0cb3 8dd4 fab0 d5c0 23eb d687  ..[.........#...
00000280: 733d ac2c edad e8fb cce6 6960 6365 ac1d  s=.,......i`ce..
00000290: 934e de39 d7b6 08ba a321 3c83 3104 892f  .N.9.....!<.1../
000002a0: 1578 ff04 06c6 b4b0 579d e986 592a 691b  .x......W...Y*i.
000002b0: 4f71 d60b 47f3 ab04 53d2 9586 9772 3150  Oq..G...S....r1P
000002c0: 5883 52bb 3079 1588 fd89 d767 f74b a73a  X.R.0y.....g.K.:
000002d0: 8066 5de5 bafd 3d1b c862 d72d 2992 ddd5  .f]...=..b.-)...
000002e0: 1483 e090 dce0 1770 4146 2b60 fcc2 e526  .......pAF+`...&
000002f0: 5449 8807 750c 9148 f53c adf3 ce23 8328  TI..u..H.<...#.(
00000300: 39b2 1cd2 ac64 6432 74b0 3198 b072 d8b0  9....dd2t.1..r..
00000310: 9405 2bb4 7c95 d2da 7c9d f126 f693 3ef9  ..+.|...|..&..>.
00000320: 5169 5ab1 cefa 56b6 95c3 45b0 c6b9 4567  QiZ...V...E...Eg
00000330: 3caf 16a7 125f 4606 5100 99ec a354 0abc  <...._F.Q....T..
00000340: eaaf 2797 5816 af89 b309 379a 4806 638c  ..'.X.....7.H.c.
00000350: 0c78 b56a 763e f11f 67e2 a6cb 0008 a9d7  .x.jv>..g.......
00000360: 7443 03fd f809 ae7d 38c2 fe36 fdd3 8842  tC.....}8..6...B
00000370: bd6e f714 0426 550e f781 9d16 2e05 f884  .n...&U.........
00000380: bb6c dba6 d144 d69b a94f d3bf da27 5d70  .l...D...O...']p
00000390: a356 dfb0 2715 b5ba 28af 5f0b 85ff 8aff  .V..'...(._.....
000003a0: f0a9 dd2c e1c0 b13a 8337 8f17 c5fc bf43  ...,...:.7.....C
000003b0: f306 30e1 eb15 4d4e 9400 07fd 0694 acac  ..0...MN........
000003c0: 3acc 0431 2231 3131 2e77 6d6d 2b4a 4b73  :..1"111.wmm+JKs
000003d0: 4d3e 332e 574a 615a 6332 3536 685e 3863  M>3.WJaZc256h^8c
000003e0: 732a 4c2d 3535 2e29 4a5a 3333 3634 5b32  s*L-55.)JZ3364[2
000003f0: 3536 6b64 2933 3836 2033 3230            56kd)386 320
00000000: 4b6a 7943 2205 2816 9967 c2f8 84f9 3569  KjyC".(..g....5i
00000010: c7d4 ec44 d654 6d9b 244f a8b9 c34d 55c3  ...D.Tm.$O...MU.
00000020: 105b b089 4a6b 2a74 3b4e 1e0b c6a3 2fc5  .[..Jk*t;N..../.
00000030: 525c 72af 238c b0a4 ffb8 70d4 ce43 5c47  R\r.#.....p..C\G
00000040: 59fe b248 4203 f475 3d16 1161 8724 1e0c  Y..HB..u=..a.$..
00000050: 9038 180a adc8 dd9c 1273 a453 8660 4cf1  .8.......s.S.`L.
00000060: e959 e66d 06db 8565 d1b3 a777 8e7c bc74  .Y.m...e...w.|.t
00000070: b42c 67e6 960c a876 be8e 6668 6f48 94e9  .,g....v..fhoH..
00000080: f394 f731 6897 f126 b112 e83f 1652 0e4f  ...1h..&...?.R.O
00000090: 10d6 5783 0b06 66e7 0a6d ea4e c229 f993  ..W...f..m.N.)..
000000a0: aef5 ceae 6c0b 155c 2204 ef26 def6 a987  ....l..\"..&....
000000b0: 7834 c294 51ec a66a 95b9 f099 e0e3 07d1  x4..Q..j........
000000c0: 8e88 c056 abd9 67d0 cd75 2681 6fc0 f0ad  ...V..g..u&.o...
000000d0: 520f 4bb0 ed8a 8d81 d5ef 95fe 35d6 d310  R.K.........5...
000000e0: 5d47 a578 20cb 33f8 f248 c203 0a23 caba  ]G.x .3..H...#..
000000f0: 0649 f3e1 98c2 0c7b 4f64 0773 c153 dbe0  .I.....{Od.s.S..
00000100: 507b f92d 513b 79d7 7d4d 3402 1c5d 34d9  P{.-Q;y.}M4..]4.
00000110: d52d 2174 4709 996d 5c86 413a 1acd 9303  .-!tG..m\.A:....
00000120: 9432 d79d 715b 9667 af48 c987 6f8c f9e3  .2..q[.g.H..o...
00000130: 8c35 6af8 37ce cc71 601e 9dea 7892 057c  .5j.7..q`...x..|
00000140: 454b 865a 4fcb 8c46 bb1e 3aab 4d68 875c  EK.ZO..F..:.Mh.\
00000150: 22fe a206 0cba beaf 8c4d ac09 13c4 bd14  "........M......
00000160: 6b20 a347 ff8e 98f1 e2c0 80a0 a87b ac6c  k .G.........{.l
00000170: ce73 2c6b 0306 ac08 ea4a 8ecc 6b7c 7e24  .s,k.....J..k|~$
00000180: c351 8d83 32a1 c1ff 9a4d 72d4 b113 6e4c  .Q..2....Mr...nL
00000190: c279 fb94 83ed 78d5 a4e7 1295 7f0b c6b7  .y....x.........
000001a0: 9a37 638e 15be 8af0 aca0 1230 30db 7a57  .7c........00.zW
000001b0: 7a81 8bfa a0aa 98b6 3ea2 d5b9 11bd b5ef  z.......>.......
000001c0: e06f 89fd f290 d099 794b 8af0 54e6 54b9  .o......yK..T.T.
000001d0: d3bf 4f49 ce8f 3684 fe90 b366 4ac8 9300  ..OI..6....fJ...
000001e0: 4a3f 5bbc 1eb3 4b41 782c fd20 47e2 97b0  J?[...KAx,. G...
000001f0: 97ca 0e62 f651 ef20 d80c bdc3 a888 64b8  ...b.Q. ......d.
00000200: fde1 c066 d8d0 5c72 c811 50cb 4679 fdab  ...f..\r..P.Fy..
00000210: 0f78 081c 2548 0bc0 57e9 69a2 c357 bc76  .x..%H..W.i..W.v
00000220: b404 037a 8e3b d216 7aa3 67e7 19f1 9e84  ...z.;..z.g.....
00000230: 26bd 7da7 89da d41d 9541 a491 fbdb d615  &.}......A......
00000240: fb20 9887 fb85 71d0 ef9b 974a 9daa 90fc  . ....q....J....
00000250: 913b b156 1f3a f268 90d7 ab8b 505b a1c5  .;.V.:.h....P[..
00000260: dbce 1fcf f42c 1ade 8718 52d1 3761 0fe0  .....,....R.7a..
00000270: 16e7 1faa 5e28 1e70 eee7 0914 b878 8b75  ....^(.p.....x.u
00000280: d61c e30c 923d e892 3309 a084 3c8f bd61  .....=..3...<..a
00000290: a6fc 755b 7636 4138 de67 93fa e415 8377  ..u[v6A8.g.....w
000002a0: d92a 4d54 ab62 ebf5 7554 5b64 2f8f dc17  .*MT.b..uT[d/...
000002b0: 2bbe 9dd4 f1b5 14ef 37bc cf07 f6a3 5c22  +.......7.....\"
000002c0: a2ea fae1 c1f0 ef7b 92a8 45b5 c560 becf  .......{..E..`..
000002d0: ac12 56de 13d3 4cd8 523b 2e2a 432f c585  ..V...L.R;.*C/..
000002e0: d8ea d1ea 0e5e 1361 b34b 6980 6d19 2cce  .....^.a.Ki.m.,.
000002f0: 1615 e977 95ed 95bd 11b8 28c7 d74b ddcc  ...w......(..K..
00000300: 4584 79b4 074c f529 dc5b c57d 9e27 6d1e  E.y..L.).[.}.'m.
00000310: ccdf c193 8c90 9529 4802 b9a8 5d6f 9f59  .......)H...]o.Y
00000320: 42cf d182 9e7e 0f0c f25c 5c00 bb24 30da  B....~...\\..$0.
00000330: db1f 4cdd 1a54 c010 a3b0 b0ee ec16 adf5  ..L..T..........
00000340: 4ff4 d9f2 efe7 448d 8082 9565 72ff 2adc  O.....D....er.*.
00000350: fa80 a2db 3b4e 7da6 0f2b d458 be51 989e  ....;N}..+.X.Q..
00000360: cc77 caf2 9abe 7e59 d4a7 a36d ef4d fe93  .w....~Y...m.M..
00000370: 7ab7 4190 1629 0cab 1649 2069 e78f 8d9f  z.A..)...I i....
00000380: 7d5b d3ee 9789 9f25 887c 9d6c cb01 d277  }[.....%.|.l...w
00000390: 8e2f 1909 045d 6bf2 5161 1f4d cda9 a94f  ./...]k.Qa.M...O
000003a0: 7865 2355 1112 b5f9 8818 27b1 c166 e2ba  xe#U......'..f..
000003b0: c6b6 5df1 9d32 db44 8905 23e2 ee6c 35f4  ..]..2.D..#..l5.
000003c0: 9279 894f 4691 5c5c 2231 3131 2e77 6d6d  .y.OF.\\"111.wmm
000003d0: 2b4a 4b73 4d3e 332e 574a 615a 6332 3536  +JKsM>3.WJaZc256
000003e0: 685e 3863 732a 4c2d 3535 2e29 4a5a 3333  h^8cs*L-55.)JZ33
000003f0: 3634 5b32 3536 6b64 2933 3836 2033 3230  64[256kd)386 320
KjC"…"111KjyC"…"111
   C"…"      convert the long binary string to an integer in base 256
  y          double it
 j     111   list its base 111 digits
K            assign to K

.wmm+JKsM>3.WJaZc256h^8cs*L-55.)JZ3364[256kd)386 320
  m                                              320   map for d in [0, …, 319]:
   m                                         386         map for k in [0, …, 385]
     JK                                                    copy K to J
                                      [256kd)              initialize value to [256, k, d]
           .WJ                                             while J is nonempty, replace value with
                         *L      Z                           map over value, multiplying by
                              .)J                              pop back of J
                           -55                                 subtract from 55
                        s                                    sum
                       c          3364                       divide by 3364
                     ^8                                      exponentiate with base 8
                    h                                        add 1
                c256                                         256 divided by that
              aZ                                             append to value
         >3                                                last three elements of the final value
       sM                                                  floor to integers
.w                                                     write that matrix of RGB triples as image o.png

neuron activationsneuron activations

Pyth (no built-in compression), score 4695.07

output

1020 bytes, encoded with xxd (decode with xxd -r). I used the 2016-01-22 version of Pyth that was current when this challenge was released. You can run the code directly in Pyth, but Pyth in PyPy3 (pypy3 pyth starry.pyth) runs it nine times faster, in about 3 minutes. The output image is written to o.png.

00000000: 4b6a 4322 0bf9 084a 6143 7853 022b 4d7d  KjC"...JaCxS.+M}
00000010: e23f 42f4 5c22 09df 7337 52d9 dcbf 9567  .?B.\"..s7R....g
00000020: d5be b388 1493 da66 5398 2579 a9fd eb34  .......fS.%y...4
00000030: 6472 5e97 0519 336d ab36 30cd 8a83 165c  dr^...3m.60....\
00000040: 72f2 bc43 d8d4 951e 51c1 57ba 3f80 3a12  r..C....Q.W.?.:.
00000050: eb2e 1294 7361 a657 b575 a67b 1644 b31c  ....sa.W.u.{.D..
00000060: 79dc 553c a78a 7e42 2d14 2d60 e2db 11e3  y.U<..~B-.-`....
00000070: fcb6 6fd8 4a44 db53 4662 1841 9536 4fd0  ..o.JD.SFb.A.6O.
00000080: cfe9 3cbd 98a2 b8b2 7034 3258 0ee4 a4e7  ..<.....p42X....
00000090: 5d27 4c24 839f 8070 1d8c 7f69 0c3c 177d  ]'L$...p...i.<.}
000000a0: b678 a1d0 de97 e5d0 b008 9bb6 ae17 5172  .x............Qr
000000b0: 5e6b f4fd 9142 b2f2 a83c d594 5999 d424  ^k...B...<..Y..$
000000c0: 9d04 d45c 42aa ff6f 7869 24db c691 bab9  ...\B..oxi$.....
000000d0: b235 c26d 87b6 8a2e 5e78 980a 64b8 e3aa  .5.m....^x..d...
000000e0: db46 143c feae 94fc 928e 1e58 da07 d441  .F.<.......X...A
000000f0: d926 459a e2b3 fc27 ddef cc1a c576 faee  .&E....'.....v..
00000100: 0397 160c ba40 966d c0de 8e96 2a66 859a  [email protected]....*f..
00000110: 82cb 2690 1633 27bb e3bd 41b6 597d d36e  ..&..3'...A.Y}.n
00000120: 570b 1038 43b3 7387 ded8 ca58 a3c0 6f6c  W..8C.s....X..ol
00000130: 447b 2565 c9e2 fff7 7064 bcba 36e4 9340  D{%e....pd..6..@
00000140: a16e 52b4 b4ed a721 fe9e 7693 d679 b8f3  .nR....!..v..y..
00000150: 3739 4b0a 4e1f 5a6e a5e1 f7e5 5c20 0942  79K.N.Zn....\ .B
00000160: 3d3c c000 962a 2106 7b79 9c95 44ea c120  =<...*!.{y..D.. 
00000170: 9310 2b7c beef 40ee 4ccc 5fb2 b4f9 a2b8  ..+|[email protected]._.....
00000180: 8fcb 3029 bb0b 7723 ab94 4ea7 ecf6 02b1  ..0)..w#..N.....
00000190: 3e95 bced b677 5888 172c b7e4 25c0 256e  >....wX..,..%.%n
000001a0: 13d2 c837 f4f6 1b0f ed78 5c72 abca 1413  ...7.....x\r....
000001b0: c490 b628 7753 2cd3 5b68 df63 e08f 57f4  ...(wS,.[h.c..W.
000001c0: b172 da04 18dc 9c96 620e 342c bd23 f24b  .r......b.4,.#.K
000001d0: 2c1c 95ec efba 5df4 8a18 433c 70a5 ac07  ,.....]...C<p...
000001e0: e082 97f2 3a09 d33e e002 2076 c764 15e4  ....:..>.. v.d..
000001f0: 5cfa 427e 40ea 89b7 9cd9 afda d121 6440  \.B~@........!d@
00000200: 1e54 2700 3e60 3b16 ea84 07cb b4b3 027c  .T'.>`;........|
00000210: f3b8 0f54 d759 563c 7ef2 b4df 4deb 476f  ...T.YV<~...M.Go
00000220: 3731 5839 9058 fa98 7a14 f511 6b55 4a90  71X9.X..z...kUJ.
00000230: d60f 2f65 4875 a618 4bac 3c5d b9b7 359d  ../eHu..K.<]..5.
00000240: dee5 3c71 d13d 9129 dab3 4bed e89e 3127  ..<q.=.)..K...1'
00000250: 975c 22bf fd41 85a8 52a1 13de e1fb 6679  .\"..A..R.....fy
00000260: 55af 1431 ae2f 6230 ec4e 560e 90e9 939b  U..1./b0.NV.....
00000270: a4ef 5b84 0cb3 8dd4 fab0 d5c0 23eb d687  ..[.........#...
00000280: 733d ac2c edad e8fb cce6 6960 6365 ac1d  s=.,......i`ce..
00000290: 934e de39 d7b6 08ba a321 3c83 3104 892f  .N.9.....!<.1../
000002a0: 1578 ff04 06c6 b4b0 579d e986 592a 691b  .x......W...Y*i.
000002b0: 4f71 d60b 47f3 ab04 53d2 9586 9772 3150  Oq..G...S....r1P
000002c0: 5883 52bb 3079 1588 fd89 d767 f74b a73a  X.R.0y.....g.K.:
000002d0: 8066 5de5 bafd 3d1b c862 d72d 2992 ddd5  .f]...=..b.-)...
000002e0: 1483 e090 dce0 1770 4146 2b60 fcc2 e526  .......pAF+`...&
000002f0: 5449 8807 750c 9148 f53c adf3 ce23 8328  TI..u..H.<...#.(
00000300: 39b2 1cd2 ac64 6432 74b0 3198 b072 d8b0  9....dd2t.1..r..
00000310: 9405 2bb4 7c95 d2da 7c9d f126 f693 3ef9  ..+.|...|..&..>.
00000320: 5169 5ab1 cefa 56b6 95c3 45b0 c6b9 4567  QiZ...V...E...Eg
00000330: 3caf 16a7 125f 4606 5100 99ec a354 0abc  <...._F.Q....T..
00000340: eaaf 2797 5816 af89 b309 379a 4806 638c  ..'.X.....7.H.c.
00000350: 0c78 b56a 763e f11f 67e2 a6cb 0008 a9d7  .x.jv>..g.......
00000360: 7443 03fd f809 ae7d 38c2 fe36 fdd3 8842  tC.....}8..6...B
00000370: bd6e f714 0426 550e f781 9d16 2e05 f884  .n...&U.........
00000380: bb6c dba6 d144 d69b a94f d3bf da27 5d70  .l...D...O...']p
00000390: a356 dfb0 2715 b5ba 28af 5f0b 85ff 8aff  .V..'...(._.....
000003a0: f0a9 dd2c e1c0 b13a 8337 8f17 c5fc bf43  ...,...:.7.....C
000003b0: f306 30e1 eb15 4d4e 9400 07fd 0694 acac  ..0...MN........
000003c0: 3acc 0431 2231 3131 2e77 6d6d 2b4a 4b73  :..1"111.wmm+JKs
000003d0: 4d3e 332e 574a 615a 6332 3536 685e 3863  M>3.WJaZc256h^8c
000003e0: 732a 4c2d 3535 2e29 4a5a 3333 3634 5b32  s*L-55.)JZ3364[2
000003f0: 3536 6b64 2933 3836 2033 3230            56kd)386 320
KjC"…"111
  C"…"      convert the long binary string to an integer in base 256
 j    111   list its base 111 digits
K           assign to K

.wmm+JKsM>3.WJaZc256h^8cs*L-55.)JZ3364[256kd)386 320
  m                                              320   map for d in [0, …, 319]:
   m                                         386         map for k in [0, …, 385]
     JK                                                    copy K to J
                                      [256kd)              initialize value to [256, k, d]
           .WJ                                             while J is nonempty, replace value with
                         *L      Z                           map over value, multiplying by
                              .)J                              pop back of J
                           -55                                 subtract from 55
                        s                                    sum
                       c          3364                       divide by 3364
                     ^8                                      exponentiate with base 8
                    h                                        add 1
                c256                                         256 divided by that
              aZ                                             append to value
         >3                                                last three elements of the final value
       sM                                                  floor to integers
.w                                                     write that matrix of RGB triples as image o.png

neuron activations

Pyth (no built-in compression), score 4695.07 4656.03

output

1024 bytes, encoded with xxd (decode with xxd -r). I used the 2016-01-22 version of Pyth that was current when this challenge was released. You can run the code directly in Pyth, but Pyth in PyPy3 (pypy3 pyth starry.pyth) runs it nine times faster, in about 3 minutes. The output image is written to o.png.

00000000: 4b6a 7943 2205 2816 9967 c2f8 84f9 3569  KjyC".(..g....5i
00000010: c7d4 ec44 d654 6d9b 244f a8b9 c34d 55c3  ...D.Tm.$O...MU.
00000020: 105b b089 4a6b 2a74 3b4e 1e0b c6a3 2fc5  .[..Jk*t;N..../.
00000030: 525c 72af 238c b0a4 ffb8 70d4 ce43 5c47  R\r.#.....p..C\G
00000040: 59fe b248 4203 f475 3d16 1161 8724 1e0c  Y..HB..u=..a.$..
00000050: 9038 180a adc8 dd9c 1273 a453 8660 4cf1  .8.......s.S.`L.
00000060: e959 e66d 06db 8565 d1b3 a777 8e7c bc74  .Y.m...e...w.|.t
00000070: b42c 67e6 960c a876 be8e 6668 6f48 94e9  .,g....v..fhoH..
00000080: f394 f731 6897 f126 b112 e83f 1652 0e4f  ...1h..&...?.R.O
00000090: 10d6 5783 0b06 66e7 0a6d ea4e c229 f993  ..W...f..m.N.)..
000000a0: aef5 ceae 6c0b 155c 2204 ef26 def6 a987  ....l..\"..&....
000000b0: 7834 c294 51ec a66a 95b9 f099 e0e3 07d1  x4..Q..j........
000000c0: 8e88 c056 abd9 67d0 cd75 2681 6fc0 f0ad  ...V..g..u&.o...
000000d0: 520f 4bb0 ed8a 8d81 d5ef 95fe 35d6 d310  R.K.........5...
000000e0: 5d47 a578 20cb 33f8 f248 c203 0a23 caba  ]G.x .3..H...#..
000000f0: 0649 f3e1 98c2 0c7b 4f64 0773 c153 dbe0  .I.....{Od.s.S..
00000100: 507b f92d 513b 79d7 7d4d 3402 1c5d 34d9  P{.-Q;y.}M4..]4.
00000110: d52d 2174 4709 996d 5c86 413a 1acd 9303  .-!tG..m\.A:....
00000120: 9432 d79d 715b 9667 af48 c987 6f8c f9e3  .2..q[.g.H..o...
00000130: 8c35 6af8 37ce cc71 601e 9dea 7892 057c  .5j.7..q`...x..|
00000140: 454b 865a 4fcb 8c46 bb1e 3aab 4d68 875c  EK.ZO..F..:.Mh.\
00000150: 22fe a206 0cba beaf 8c4d ac09 13c4 bd14  "........M......
00000160: 6b20 a347 ff8e 98f1 e2c0 80a0 a87b ac6c  k .G.........{.l
00000170: ce73 2c6b 0306 ac08 ea4a 8ecc 6b7c 7e24  .s,k.....J..k|~$
00000180: c351 8d83 32a1 c1ff 9a4d 72d4 b113 6e4c  .Q..2....Mr...nL
00000190: c279 fb94 83ed 78d5 a4e7 1295 7f0b c6b7  .y....x.........
000001a0: 9a37 638e 15be 8af0 aca0 1230 30db 7a57  .7c........00.zW
000001b0: 7a81 8bfa a0aa 98b6 3ea2 d5b9 11bd b5ef  z.......>.......
000001c0: e06f 89fd f290 d099 794b 8af0 54e6 54b9  .o......yK..T.T.
000001d0: d3bf 4f49 ce8f 3684 fe90 b366 4ac8 9300  ..OI..6....fJ...
000001e0: 4a3f 5bbc 1eb3 4b41 782c fd20 47e2 97b0  J?[...KAx,. G...
000001f0: 97ca 0e62 f651 ef20 d80c bdc3 a888 64b8  ...b.Q. ......d.
00000200: fde1 c066 d8d0 5c72 c811 50cb 4679 fdab  ...f..\r..P.Fy..
00000210: 0f78 081c 2548 0bc0 57e9 69a2 c357 bc76  .x..%H..W.i..W.v
00000220: b404 037a 8e3b d216 7aa3 67e7 19f1 9e84  ...z.;..z.g.....
00000230: 26bd 7da7 89da d41d 9541 a491 fbdb d615  &.}......A......
00000240: fb20 9887 fb85 71d0 ef9b 974a 9daa 90fc  . ....q....J....
00000250: 913b b156 1f3a f268 90d7 ab8b 505b a1c5  .;.V.:.h....P[..
00000260: dbce 1fcf f42c 1ade 8718 52d1 3761 0fe0  .....,....R.7a..
00000270: 16e7 1faa 5e28 1e70 eee7 0914 b878 8b75  ....^(.p.....x.u
00000280: d61c e30c 923d e892 3309 a084 3c8f bd61  .....=..3...<..a
00000290: a6fc 755b 7636 4138 de67 93fa e415 8377  ..u[v6A8.g.....w
000002a0: d92a 4d54 ab62 ebf5 7554 5b64 2f8f dc17  .*MT.b..uT[d/...
000002b0: 2bbe 9dd4 f1b5 14ef 37bc cf07 f6a3 5c22  +.......7.....\"
000002c0: a2ea fae1 c1f0 ef7b 92a8 45b5 c560 becf  .......{..E..`..
000002d0: ac12 56de 13d3 4cd8 523b 2e2a 432f c585  ..V...L.R;.*C/..
000002e0: d8ea d1ea 0e5e 1361 b34b 6980 6d19 2cce  .....^.a.Ki.m.,.
000002f0: 1615 e977 95ed 95bd 11b8 28c7 d74b ddcc  ...w......(..K..
00000300: 4584 79b4 074c f529 dc5b c57d 9e27 6d1e  E.y..L.).[.}.'m.
00000310: ccdf c193 8c90 9529 4802 b9a8 5d6f 9f59  .......)H...]o.Y
00000320: 42cf d182 9e7e 0f0c f25c 5c00 bb24 30da  B....~...\\..$0.
00000330: db1f 4cdd 1a54 c010 a3b0 b0ee ec16 adf5  ..L..T..........
00000340: 4ff4 d9f2 efe7 448d 8082 9565 72ff 2adc  O.....D....er.*.
00000350: fa80 a2db 3b4e 7da6 0f2b d458 be51 989e  ....;N}..+.X.Q..
00000360: cc77 caf2 9abe 7e59 d4a7 a36d ef4d fe93  .w....~Y...m.M..
00000370: 7ab7 4190 1629 0cab 1649 2069 e78f 8d9f  z.A..)...I i....
00000380: 7d5b d3ee 9789 9f25 887c 9d6c cb01 d277  }[.....%.|.l...w
00000390: 8e2f 1909 045d 6bf2 5161 1f4d cda9 a94f  ./...]k.Qa.M...O
000003a0: 7865 2355 1112 b5f9 8818 27b1 c166 e2ba  xe#U......'..f..
000003b0: c6b6 5df1 9d32 db44 8905 23e2 ee6c 35f4  ..]..2.D..#..l5.
000003c0: 9279 894f 4691 5c5c 2231 3131 2e77 6d6d  .y.OF.\\"111.wmm
000003d0: 2b4a 4b73 4d3e 332e 574a 615a 6332 3536  +JKsM>3.WJaZc256
000003e0: 685e 3863 732a 4c2d 3535 2e29 4a5a 3333  h^8cs*L-55.)JZ33
000003f0: 3634 5b32 3536 6b64 2933 3836 2033 3230  64[256kd)386 320
KjyC"…"111
   C"…"      convert the long binary string to an integer in base 256
  y          double it
 j     111   list its base 111 digits
K            assign to K

.wmm+JKsM>3.WJaZc256h^8cs*L-55.)JZ3364[256kd)386 320
  m                                              320   map for d in [0, …, 319]:
   m                                         386         map for k in [0, …, 385]
     JK                                                    copy K to J
                                      [256kd)              initialize value to [256, k, d]
           .WJ                                             while J is nonempty, replace value with
                         *L      Z                           map over value, multiplying by
                              .)J                              pop back of J
                           -55                                 subtract from 55
                        s                                    sum
                       c          3364                       divide by 3364
                     ^8                                      exponentiate with base 8
                    h                                        add 1
                c256                                         256 divided by that
              aZ                                             append to value
         >3                                                last three elements of the final value
       sM                                                  floor to integers
.w                                                     write that matrix of RGB triples as image o.png

neuron activations

Source Link
Anders Kaseorg
  • 40.1k
  • 3
  • 75
  • 146

Pyth (no built-in compression), score 4695.07

Pyth’s only image-related functionality is a builtin to write a matrix of RGB triples as an image file. So the crazy idea here is to train a small deep neural network on the (x, y) ↦ (r, g, b) function representing the image, and run it on the coordinates of each pixel.

The plan

  1. Write a custom backpropagation loop in C++.
  2. Curse at how slow it is.
  3. Learn Tensorflow.
  4. Build a new desktop with a sick GPU using Black Friday deals.
  5. Scour the literature for ways to compress neural networks, and do that.
  6. Scour the literature for ways to avoid overfitting neural networks, and do the opposite of that.

The current network is built from 45 sigmoid neurons, with each neuron connected to the x, y inputs and to every previous neuron, and the last three neurons interpreted as r, g, b. It’s trained using the Adam algorithm without batching. The parameters weighting the 1125 connections are quantized to a range of 111 possible values using a variant of stochastic quantization (the primary variation being that we set the gradient for quantized parameters to zero).

The result

output

The code

1020 bytes, encoded with xxd (decode with xxd -r). I used the 2016-01-22 version of Pyth that was current when this challenge was released. You can run the code directly in Pyth, but Pyth in PyPy3 (pypy3 pyth starry.pyth) runs it nine times faster, in about 3 minutes. The output image is written to o.png.

00000000: 4b6a 4322 0bf9 084a 6143 7853 022b 4d7d  KjC"...JaCxS.+M}
00000010: e23f 42f4 5c22 09df 7337 52d9 dcbf 9567  .?B.\"..s7R....g
00000020: d5be b388 1493 da66 5398 2579 a9fd eb34  .......fS.%y...4
00000030: 6472 5e97 0519 336d ab36 30cd 8a83 165c  dr^...3m.60....\
00000040: 72f2 bc43 d8d4 951e 51c1 57ba 3f80 3a12  r..C....Q.W.?.:.
00000050: eb2e 1294 7361 a657 b575 a67b 1644 b31c  ....sa.W.u.{.D..
00000060: 79dc 553c a78a 7e42 2d14 2d60 e2db 11e3  y.U<..~B-.-`....
00000070: fcb6 6fd8 4a44 db53 4662 1841 9536 4fd0  ..o.JD.SFb.A.6O.
00000080: cfe9 3cbd 98a2 b8b2 7034 3258 0ee4 a4e7  ..<.....p42X....
00000090: 5d27 4c24 839f 8070 1d8c 7f69 0c3c 177d  ]'L$...p...i.<.}
000000a0: b678 a1d0 de97 e5d0 b008 9bb6 ae17 5172  .x............Qr
000000b0: 5e6b f4fd 9142 b2f2 a83c d594 5999 d424  ^k...B...<..Y..$
000000c0: 9d04 d45c 42aa ff6f 7869 24db c691 bab9  ...\B..oxi$.....
000000d0: b235 c26d 87b6 8a2e 5e78 980a 64b8 e3aa  .5.m....^x..d...
000000e0: db46 143c feae 94fc 928e 1e58 da07 d441  .F.<.......X...A
000000f0: d926 459a e2b3 fc27 ddef cc1a c576 faee  .&E....'.....v..
00000100: 0397 160c ba40 966d c0de 8e96 2a66 859a  [email protected]....*f..
00000110: 82cb 2690 1633 27bb e3bd 41b6 597d d36e  ..&..3'...A.Y}.n
00000120: 570b 1038 43b3 7387 ded8 ca58 a3c0 6f6c  W..8C.s....X..ol
00000130: 447b 2565 c9e2 fff7 7064 bcba 36e4 9340  D{%e....pd..6..@
00000140: a16e 52b4 b4ed a721 fe9e 7693 d679 b8f3  .nR....!..v..y..
00000150: 3739 4b0a 4e1f 5a6e a5e1 f7e5 5c20 0942  79K.N.Zn....\ .B
00000160: 3d3c c000 962a 2106 7b79 9c95 44ea c120  =<...*!.{y..D.. 
00000170: 9310 2b7c beef 40ee 4ccc 5fb2 b4f9 a2b8  ..+|[email protected]._.....
00000180: 8fcb 3029 bb0b 7723 ab94 4ea7 ecf6 02b1  ..0)..w#..N.....
00000190: 3e95 bced b677 5888 172c b7e4 25c0 256e  >....wX..,..%.%n
000001a0: 13d2 c837 f4f6 1b0f ed78 5c72 abca 1413  ...7.....x\r....
000001b0: c490 b628 7753 2cd3 5b68 df63 e08f 57f4  ...(wS,.[h.c..W.
000001c0: b172 da04 18dc 9c96 620e 342c bd23 f24b  .r......b.4,.#.K
000001d0: 2c1c 95ec efba 5df4 8a18 433c 70a5 ac07  ,.....]...C<p...
000001e0: e082 97f2 3a09 d33e e002 2076 c764 15e4  ....:..>.. v.d..
000001f0: 5cfa 427e 40ea 89b7 9cd9 afda d121 6440  \.B~@........!d@
00000200: 1e54 2700 3e60 3b16 ea84 07cb b4b3 027c  .T'.>`;........|
00000210: f3b8 0f54 d759 563c 7ef2 b4df 4deb 476f  ...T.YV<~...M.Go
00000220: 3731 5839 9058 fa98 7a14 f511 6b55 4a90  71X9.X..z...kUJ.
00000230: d60f 2f65 4875 a618 4bac 3c5d b9b7 359d  ../eHu..K.<]..5.
00000240: dee5 3c71 d13d 9129 dab3 4bed e89e 3127  ..<q.=.)..K...1'
00000250: 975c 22bf fd41 85a8 52a1 13de e1fb 6679  .\"..A..R.....fy
00000260: 55af 1431 ae2f 6230 ec4e 560e 90e9 939b  U..1./b0.NV.....
00000270: a4ef 5b84 0cb3 8dd4 fab0 d5c0 23eb d687  ..[.........#...
00000280: 733d ac2c edad e8fb cce6 6960 6365 ac1d  s=.,......i`ce..
00000290: 934e de39 d7b6 08ba a321 3c83 3104 892f  .N.9.....!<.1../
000002a0: 1578 ff04 06c6 b4b0 579d e986 592a 691b  .x......W...Y*i.
000002b0: 4f71 d60b 47f3 ab04 53d2 9586 9772 3150  Oq..G...S....r1P
000002c0: 5883 52bb 3079 1588 fd89 d767 f74b a73a  X.R.0y.....g.K.:
000002d0: 8066 5de5 bafd 3d1b c862 d72d 2992 ddd5  .f]...=..b.-)...
000002e0: 1483 e090 dce0 1770 4146 2b60 fcc2 e526  .......pAF+`...&
000002f0: 5449 8807 750c 9148 f53c adf3 ce23 8328  TI..u..H.<...#.(
00000300: 39b2 1cd2 ac64 6432 74b0 3198 b072 d8b0  9....dd2t.1..r..
00000310: 9405 2bb4 7c95 d2da 7c9d f126 f693 3ef9  ..+.|...|..&..>.
00000320: 5169 5ab1 cefa 56b6 95c3 45b0 c6b9 4567  QiZ...V...E...Eg
00000330: 3caf 16a7 125f 4606 5100 99ec a354 0abc  <...._F.Q....T..
00000340: eaaf 2797 5816 af89 b309 379a 4806 638c  ..'.X.....7.H.c.
00000350: 0c78 b56a 763e f11f 67e2 a6cb 0008 a9d7  .x.jv>..g.......
00000360: 7443 03fd f809 ae7d 38c2 fe36 fdd3 8842  tC.....}8..6...B
00000370: bd6e f714 0426 550e f781 9d16 2e05 f884  .n...&U.........
00000380: bb6c dba6 d144 d69b a94f d3bf da27 5d70  .l...D...O...']p
00000390: a356 dfb0 2715 b5ba 28af 5f0b 85ff 8aff  .V..'...(._.....
000003a0: f0a9 dd2c e1c0 b13a 8337 8f17 c5fc bf43  ...,...:.7.....C
000003b0: f306 30e1 eb15 4d4e 9400 07fd 0694 acac  ..0...MN........
000003c0: 3acc 0431 2231 3131 2e77 6d6d 2b4a 4b73  :..1"111.wmm+JKs
000003d0: 4d3e 332e 574a 615a 6332 3536 685e 3863  M>3.WJaZc256h^8c
000003e0: 732a 4c2d 3535 2e29 4a5a 3333 3634 5b32  s*L-55.)JZ3364[2
000003f0: 3536 6b64 2933 3836 2033 3230            56kd)386 320

How it works

KjC"…"111
  C"…"      convert the long binary string to an integer in base 256
 j    111   list its base 111 digits
K           assign to K

.wmm+JKsM>3.WJaZc256h^8cs*L-55.)JZ3364[256kd)386 320
  m                                              320   map for d in [0, …, 319]:
   m                                         386         map for k in [0, …, 385]
     JK                                                    copy K to J
                                      [256kd)              initialize value to [256, k, d]
           .WJ                                             while J is nonempty, replace value with
                         *L      Z                           map over value, multiplying by
                              .)J                              pop back of J
                           -55                                 subtract from 55
                        s                                    sum
                       c          3364                       divide by 3364
                     ^8                                      exponentiate with base 8
                    h                                        add 1
                c256                                         256 divided by that
              aZ                                             append to value
         >3                                                last three elements of the final value
       sM                                                  floor to integers
.w                                                     write that matrix of RGB triples as image o.png

Training

During my final training run, I used a much slower quantization schedule and did some interactive fiddling with that and the learning rate, but the code I used was roughly as follows.

from __future__ import division, print_function
import sys
import numpy as np
import tensorflow as tf

NEURONS, SCALE_BASE, SCALE_DIV, BASE, MID = 48, 8, 3364, 111, 55

def idx(n):
    return n * (n - 1) // 2 - 3

WEIGHTS = idx(NEURONS)
SCALE = SCALE_DIV / np.log(SCALE_BASE)
W_MIN, W_MAX = -MID, BASE - 1 - MID

sess = tf.Session()

with open('ORIGINAL.png', 'rb') as f:
    img = sess.run(tf.image.decode_image(f.read(), channels=3))
y_grid, x_grid = np.mgrid[0:img.shape[0], 0:img.shape[1]]
x = tf.constant(x_grid.reshape([-1]).astype(np.float32))
y = tf.constant(y_grid.reshape([-1]).astype(np.float32))
color_ = tf.constant(img.reshape([-1, 3]).astype(np.float32))

w_real = tf.Variable(
    np.random.uniform(-16, 16, [WEIGHTS]).astype(np.float32),
    constraint=lambda w: tf.clip_by_value(w, W_MIN, W_MAX))

quantization = tf.placeholder(tf.float32, shape=[])
w_int = tf.round(w_real)
qrate = 1 / (tf.abs(w_real - w_int) + 1e-6)
qscale = 0
for _ in range(16):
    v = tf.exp(-qscale * qrate)
    qscale -= ((1 - quantization) * WEIGHTS - tf.reduce_sum(v)) / \
        tf.tensordot(qrate, v, 1)
unquantized = tf.distributions.Bernoulli(
    probs=tf.exp(-qscale * qrate), dtype=tf.bool).sample()
num_unquantized = tf.reduce_sum(tf.cast(unquantized, tf.int64))
w = tf.where(unquantized, w_real, w_int)

a = tf.stack([tf.ones_like(x) * 256, x, y], 1)
for n in range(3, NEURONS):
    a = tf.concat([a, 256 * tf.sigmoid(
        tf.einsum('in,n->i;', a, w[idx(n):idx(n + 1)]) / SCALE)[:, None]], 1)
color = a[:, -3:]
err = tf.reduce_sum(tf.square((color - 0.5 - color_) / 255))

train_step = tf.train.AdamOptimizer(0.01).minimize(err, var_list=[w_real])

sess.run(tf.global_variables_initializer())

count = 0
quantization_val = 0
best_err = float("inf")

while True:
    num_unquantized_val, err_val, w_val, _ = sess.run(
        [num_unquantized, err, w, train_step],
        {quantization: quantization_val})
    if num_unquantized_val == 0 and err_val < best_err:
        print(end='\r\x1b[K', file=sys.stderr)
        sys.stderr.flush()
        print(
            'weights', list(w_val.astype(np.int64)),
            'count', count, 'err', err_val)
        best_err = err_val
    count += 1
    print(
        '\r\x1b[Kcount', count, 'err', err_val,
        'unquantized', num_unquantized_val, end='', file=sys.stderr)
    sys.stderr.flush()
    quantization_val = (1 - 1e-4) * quantization_val + 1e-4

Visualization

This picture shows the activations of all 45 neurons as a function of the x, y coordinates. Click to enlarge.

neuron activations