Big updates! More productive devlog today!
I added a bunch of fallbacks. Some for if the user only enters one number, some for if the user enters too many, etc.
I changed the UI, making it uncomfortably brightly coloured to enhance the experience :) Yay, gradients :D
I also added a bunch of different loading messages, which you can see in the image.
I also made it so that the model can calculate equations outside of its range!
It’s trained on arithmetic addition from 0-100. Beyond that point, it would just guess! Now, I’ve got a function that takes the inputs, checks if the highest one is over 100, and multiplies it down! (Actually, it’s between 0 and one, but the valid ranges are 1-100, because that’s how it’s sent through.)
Now it can calculate numbers in the hundreds, even thousands with accuracy!
Although it does taper off going further than 5 figures :)
I also added a nice starting page to kinda explain the project (it’ll all be explained in the ship notes too, just thought I might as well.)
I fixed several edge cases (who knew a calculator would have that many???), also adding a bool to track whether the screen’s state is “volatile”. AKA, if the calculation’s completed and it’s displaying the answer, then - when an input occurs, it’ll clear everything and start a new equation (there’s an easter egg hidden in that logic! Feel free to check it out in the repo lol).
To-do still:
Improve the UI of the other pages or just remove them from the build. By the “other pages”, I mean the page I used for training, and the page I used for dataset generation.
I’d love your feedback on this, actually!
I wouldn’t want unauthorised people to overload my hosting server with “train” instructions.
I made the calculator input panel a SvelteKit {#each} block. This was kinda a strange choice on my part, but it keeps the code looking organised and less repetitive.
It also means if I want to change one element (e.g, the CSS class name or the function name) I just have to change the one box.
Thanks for reading!
Happy coding! :D
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.