site banner

Wellness Wednesday for July 5, 2023

The Wednesday Wellness threads are meant to encourage users to ask for and provide advice and motivation to improve their lives. It isn't intended as a 'containment thread' and any content which could go here could instead be posted in its own thread. You could post:

  • Requests for advice and / or encouragement. On basically any topic and for any scale of problem.

  • Updates to let us know how you are doing. This provides valuable feedback on past advice / encouragement and will hopefully make people feel a little more motivated to follow through. If you want to be reminded to post your update, see the post titled 'update reminders', below.

  • Advice. This can be in response to a request for advice or just something that you think could be generally useful for many people here.

  • Encouragement. Probably best directed at specific users, but if you feel like just encouraging people in general I don't think anyone is going to object. I don't think I really need to say this, but just to be clear; encouragement should have a generally positive tone and not shame people (if people feel that shame might be an effective tool for motivating people, please discuss this so we can form a group consensus on how to use it rather than just trying it).

1
Jump in the discussion.

No email address required.

Not a wellness question, but I don't want it to get lost in the old small scale question thread:

I've always been mildly interested in programming, but my formal training in it was only in the absolute basics of Javascript in school. We didn't even get to pointers in C, to give you an idea where I bottomed out.

However, my fondness for rat-adjacent spaces makes me probably one of the people who sorta somewhat understand programming concepts as much as possible without actually being able to code well.

I can mostly follow code or pseudocode, but I've noticed that programmers mostly leverage existing functions in libraries or APIs to massively abstract their work.

My issue is that I simply don't know most of the interesting functions that might be relevant if I have a specific concept in mind. I don't know whether there's an existing function I can call, let alone something I can import as a library, like math.js. I know that there's plenty unknown to me, and unknown unknowns I couldn't possibly estimate.

I can definitely ask GPT-4 about such things, but leaving it aside, how do I understand the options available to me as best as I can?

For example, when I look at a little of the code for the few ML models I've learned, it seems simple enough if you can abstract a lot of it. I simply don't know what to abstract.

How do I build this fundamental knowledge? I suspect it involves something I'd find mildly unpleasant like reading documentation, textbooks, or trawling through code on Github. But I'm asking just in case a more interesting alternative exists that I'm not aware of.

I'll pre-emptively tag @DaseindustriesLtd, because of course I will haha. But I know there are plenty of you programmers out there, don't be shy!

If it helps, I have the following concrete interests-

  1. Modding games. I'm aware reading documentation or code is mandatory here. I'm sure @ZorbaTHut would be mildly pleased to hear that I'd like to make small mods for Rimworld, especially if AI makes generating art assets easier.

  2. Small automation tasks on my PC. GPT is helpful here if I know what to ask.

  3. ML, just enough so I could apply it to medicine if I needed to. I'd like to think upskilling myself there might lead to more money if I can leverage my medical degree into a career involving it.

For machine learning in particular and scientific computing more generally, you have the following extremely useful libraries, all in python, because that's the most common language here:

  1. Numpy, short for Numerical Python. This is a very deep library that does everything from numerical derivatives, integrals, matrix multiplication, everything in linear algebra, sorting arrays of numbers, and even simple linear regression. The main workhorse here is the "ndarray" datatype that numpy defines, which allows you to create an object which stores a multi-dimensional array of numbers very efficiently.

  2. Scipy, short for Scientific Python. This is an extension of numpy, which includes optimisation routines, solving differential equations, algebraic equations, etc. Less overwhelmingly used than numpy, but still very common

  3. Scikit-learn. This is the library to use if you want off-the-shelf classical machine learning algorithms, so anything outside of deep-learning stuff. Decision trees, linear/logistic regression, clustering, nearest neighbors, or whatever, this does basically all of it.

  4. matplotlib. This is the most common visualisation library to make graphs or charts. Endlessly customizable, and hence kind of a pain to use, but it's the most common and very useful.

  5. Pytorch. Now we're getting into deep learning and GPU computing. Pytorch essentially does much of the same job as Numpy, but it also automatically interfaces with your GPU, so that all your matrix multiplies are run much, much faster. This is the library you use to define your deep learning models, and the one you use to write your training code.

And so on and so on. There are other libraries like Pandas for data analysis, and all the huggingface libraries for deep learning, which get you even more abstraction, so that you can use transformers without even knowing. I don't think there is any more pleasant way of getting to know these libraries than reading a few textbooks and then inevitably drudging through their documentations when the need arises.

Thank you, I was afraid that was the case, but having the options clearly arrayed before me makes it far less daunting!

I suspect that my usual method of using GPT-4 will run into issues with a lot of newer techniques and functions falling outside the September 2021 knowledge cutoff. It's a fast moving field after all.

Hmm, basically all the libraries I listed except maybe for pytorch haven't changed all that much since 2021, gpt-4 should really still be very useful with all of them. What it will have trouble with is a library like "Transformer" by huggingface, which lets you automatically download and use pretrained deep learning models. But to even use a super-high-abstraction library like that one you still need a bunch of "glue skills" like knowing how to load a .png image from your computer into a format that the high-level functions can understand, and how to interpret and visualise the output of those high-level functions. GPT-4 would be amazing for all of that.

I think Transformers has been around. Langchain on the other hand...

That said, you can use search enabled GPT or bing for this stuff too.

But- I have noticed GPT will mess up when setting up ML models sometimes. Stuff like mixing up the ordering of dimensions. I wound up with a toy transformers model that was trying to learn a string reversal task using positional embeddings that were spread across batches instead of across tokens the other day. And on other tasks it has all sorts of other minor errors. The code usually compiles- but it doesn't always do what you thought you asked for.

It certainly gives you experience doing critical thinking with regards to code debugging though, while also doing a lot to help you learn new libraries. The loop goes from

Read Demos and example code and textbooks -> Write hopefully passable code -> Debug code

to

Have GPT4 write weird, buggy or technically correct but silly code -> Debug Code while asking GPT4/googling/inferring/testing what the functions do.

Which I much prefer.