TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Advent of Code 2021 in pure TensorFlow – day 1

80 pointsby me2tooover 3 years ago

11 comments

mlajtosover 3 years ago
This is fun idea. With these kind of coding tasks you won&#x27;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 à la TorchScript [0] can be tolerated, but not reimplementing everything via function calls with overly descriptive names.<p>Btw link to GitHub repo is broken. Copy&amp;pasting URL works.<p>[0] <a href="https:&#x2F;&#x2F;pytorch.org&#x2F;docs&#x2F;stable&#x2F;jit_language_reference.html#language-reference" rel="nofollow">https:&#x2F;&#x2F;pytorch.org&#x2F;docs&#x2F;stable&#x2F;jit_language_reference.html#...</a>
评论 #29525337 未加载
评论 #29526379 未加载
keyleover 3 years ago
Ah yes, the enthusiasm of Day 1, &quot;let&#x27;s write my own stack DSL and do it on there!&quot;<p>Day 8 &quot;FML!&quot; <i>checks python version installed...</i>
评论 #29528245 未加载
not2bover 3 years ago
The problems get a lot harder so it would be interesting to see if you can get all the way through with this approach.
评论 #29528243 未加载
an-allenover 3 years ago
Lovely effort. Looks like the approach to the first one is just programatic, procedural updates to a variable.<p>Was hoping to see some training of a model to produce outputs. Good effort nonetheless!
评论 #29528229 未加载
NeutralForestover 3 years ago
That&#x27;s pretty funny, AoC is rule-based so I don&#x27;t think there will be much &quot;deep&quot; learning going but I hope I&#x27;ll be surprised!
评论 #29528222 未加载
exdsqover 3 years ago
I’d like to read this but the number of ads navigating the blog on mobile is a horrible UX :(
评论 #29528238 未加载
评论 #29526960 未加载
评论 #29526328 未加载
brileeover 3 years ago
You wrote this...<p><pre><code> All the comparisons like &gt; are better written using their TensorFlow equivalent (e.g tf.greater). Autograph can convert them (you could write &gt;), but it’s less idiomatic and I recommend to do not relying upon the automatic conversion, for having full control. </code></pre> ...but I&#x27;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 :)
评论 #29528202 未加载
antplsover 3 years ago
Good reading ! It would be interesting to have other similar challenges, such as Euler, solved in idiomatic Tensorflow and Pytorch. Also some examples of more complicated state-of-the-art algorithms, such as sorting&#x2F;graph&#x2F;trees algorithms reimplemented in these frameworks.<p>It would be a great introduction to these frameworks for people who never touched anything ML-related, leaving the neural network content to later in the learning process.<p>Learning how to create differentiable algorithms and neural networks would be easier once the way those frameworks work is understood (ingesting data, iterating dataset, running, debugging, profiling, etc).<p>If you are starting with neural networks or differentiable programming, learning both the maths and the frameworks at the same time can be quite overwhelming
0-_-0over 3 years ago
It would have been more tensorflow-y if you did this with convolutions (1x2 and 1x3)
评论 #29528254 未加载
bufferoverflowover 3 years ago
I wonder if GPT-3 can come up with a solution
NotEvilover 3 years ago
Site is censored in india.
评论 #29528212 未加载
评论 #29527878 未加载