[HN Gopher] Advent of Code 2021 in pure TensorFlow - day 1
___________________________________________________________________
Advent of Code 2021 in pure TensorFlow - day 1
Author : me2too
Score : 41 points
Date : 2021-12-11 18:33 UTC (4 hours ago)
(HTM) web link (pgaleone.eu)
(TXT) w3m dump (pgaleone.eu)
| NeutralForest wrote:
| That's pretty funny, AoC is rule-based so I don't think there
| will be much "deep" learning going but I hope I'll be surprised!
| an-allen wrote:
| Lovely effort. Looks like the approach to the first one is just
| programatic, procedural updates to a variable.
|
| Was hoping to see some training of a model to produce outputs.
| Good effort nonetheless!
| exdsq wrote:
| I'd like to read this but the number of ads navigating the blog
| on mobile is a horrible UX :(
| mlajtos wrote:
| This is fun idea. With these kind of coding tasks you won't get
| any advantage of using differentiable programming paradigm, but
| it is a nice reminder how syntactically bad TensorFlow is. Code
| of any differentiable program should look identical to any non-
| differentiable program. Maybe a small annotation a la TorchScript
| [0] can be tolerated, but not reimplementing everything via
| function calls with overly descriptive names.
|
| Btw link to GitHub repo is broken. Copy&pasting URL works.
|
| [0]
| https://pytorch.org/docs/stable/jit_language_reference.html#...
| brilee wrote:
| You wrote this... All the comparisons like > are
| better written using their TensorFlow equivalent (e.g
| tf.greater). Autograph can convert them (you could write >), but
| it's less idiomatic and I recommend to do not relying upon the
| automatic conversion, for having full control.
|
| ...but I'm not sure you realized that the for loop and the if
| statement in your code are being transparently compiled to
| dataset.map() and tf.cond() for you by Autograph :)
___________________________________________________________________
(page generated 2021-12-11 23:00 UTC)