4 ms·
TensorFlow Lite for Commodore 64
- fareesh 4y agoAstronaut: Wait, it's all "if" statements? Astronaut with gun: Always has been
- smoldesu 4y agoLisp boffins who had been building AI this exact way for decades: noncommittal silence
- molticrystal 4y agoI wonder if there is a 3rd astronaut wielding their feelings about the lack of goto statements in this code.
- junon 4y agoDijkstra rolling in his grave.
- mysterydip 4y agoyou can put all the elegant sugar coating you want on it, but in the end your code gets executed as gotos.
- junon 4y agoReminds me of the MOV compiler. https://github.com/xoreaxeaxeax/movfuscator https://github.com/xoreaxeaxeax/movfuscator
- vintermann 4y agoIn your dreams, von Neumann!
- spkm 4y agoIt's worse, turns out in the end it's just 0s and 1s.
- deleted 4y ago[deleted]
- caramelcustard 4y agoThe observer astronaut back on Earth: you two weren't supposed to say that!
- savant_penguin 4y agoNow fit it a gpt3 in there and BAM: local aidungeon
- westoncb 4y agoThe final step in their "How it works" diagram: "Intelligent C64s restore themselves to their former position of prominence. The singularity is near."
- anitil 4y agoFormer?
- hansword 4y agoThis was really useful for me. Seeing the c64 basic code produced (0) is only 6000 lines, a comparison to how a human would (re-)write the SIN() function is now feasible. (0) https://github.com/nickbild/tflite_c64/blob/main/neural_net.bas https://github.com/nickbild/tflite_c64/blob/main/neural_net.... Edit: clarification
- davmar 4y agoneato. what kind of chip you got in there, a dorito?
- YesThatTom2 4y agoThese two if statements are repeated frequently. I bet they can be optimized but for the life of me, I can’t think of an improvement. 5550 if acc < -128 then acc = -128 5560 if acc > 127 then acc = 127 Anyone?
- plmpsu 4y agoacc = min(max(acc, -128), 127)?
- Someone 4y agoCommodore 64 basic doesn’t have min or max functions. DEF (https://www.c64-wiki.com/wiki/DEF https://www.c64-wiki.com/wiki/DEF) would be the way to do this, but I don’t see how to write a performant version in a single expression (you can’t use IF as an expression. You could cast to float, compute some specially chosen sigmoid function, and round to int, but that’s slow) A USR function (https://www.c64-wiki.com/wiki/USR https://www.c64-wiki.com/wiki/USR) would work, but that’s cheating.
- kbelder 4y agoAlmost seems like you could get there by bit twiddling, but I'm not sure. What's "-1 AND 127" in Commodore basic?
- Someone 4y ago127. I don’t think bit masking alone will get you there. You want to map anything over 0x80 to 0x7F. I think you can do something like x + (x < -127) * (x + 127) + (x > 127)) * (x - 127) ^^^^^^^^^^^^^^^^^^^^^^ can give you clamping, but haven’t checked it ((x < -127) is minus one for true or zero for false, so the part marked ^^^^ subtracts x + 127 from x when it is too low, and that’s equivalent to subtracting x (yielding zero) and subtracting -127 (yielding -127). The other part is similar, but for values that are too high. That expression can be put in a DEF FN.
- londons_explore 4y ago
- 99112000 4y agoCan you benchmark this against a nvidia rtx 3090, must be close
- vintermann 4y agoWith no native floating point type and no parallelism whatsoever, I hate to admit it, but the C64 isn't the optimal platform for this sort of thing. (Apropos floating point, are you SURE it runs the same, Nick? those aren't exactly IEEE 754 floats you've got there!)