on writing

How different is writing from code? How different the sensation of identifying in language, and the sensation of almost-identifying in code?

I feel a bit of empty shame giving over the process of identification and remembering like this, to a digital object.

I think we’re all wondering about this a bit. It isn’t clear. Where. The. Center. Is.

naturalizing

… and what should be natural, in starting, on a Tuesday morning?

I must go to the bottom of things, it’s early. What is a file, how does VS Code place itself on the Terminal? Still a new environment for me, I feel myself questioning the decisions behind its organization, and not being able to find quick answers to my questions.

Running in terminal — that is, in the terminal in VS code — I can type in all of the examples.

import numpy as numpy
import tensorflow as tf 

tf.InteractiveSession()

a = tf.zeros(2)
a.eval()

… but by the way, what is to close a session? I guess this will be clarified with the idea of session… then the function

tf.interactiveSession.close()

will make more sense. It doesn’t work within a file. Clear enough: it’s not interactive.

So, setting the environment (python 3.6.8 64-bit base) allows me to run the above (by selecting) as though I were typing it in as <stdin>. That’s interactive. In a static sort of way.


And so, further, to vectors. One introductory question for the morning: why does the ‘shape’ tensor have a blank space:

<tf.Tensor 'zeros_1:0' shape=(2,) dtype=float32>
>>> a.eval()
array([0., 0.], dtype=float32)

Or more, generally, how can I parse (for myself) the info: ‘zeros_1:0’ shape=(2,)? It’s not automatic. I need a good sentence or picture that will stick with me.

Quick answer: it’s not a Tensor, it’s a Python tuple (shape, that is), and so it needs a comma there at the end. But ‘zeros_1:0’… some sort of tracking in the session?

There’s always something. Es gibt immer eine Sache.

Skimming

After a period of highlighting and detail, I had to get an overview of the chapters beyond chapter 4 in “TensorFlow for Deep Learning.”

Convolutional Neural Networks look most promising, in passing.

Meanwhile, I have to start poring over the statistical examples in Chapter 4 (see below: ‘Impediments’), to make sure I’ve got clear visions of the dimensions of tensors in NumPy and TensorFlow.

Ultimately, I am not sure whether my system is itself a version of neural network, since it involves a sort of backpropagation and one-hot juggling, or just a way of rejiggering MIDI data sets. Could be both.

Impediments

Or what I have been doing all these years is approaching these impediments.

There are three examples in chapter 3 of TensorFlow for Deep Learning. Only one seems to work:

logistic_regression_tf.py 

A patient debugging of linear_regression_tf.py shows that line 37

plt.savefig("lr_data.png")

brings a world of pain.

And the shortcode doesn’t work here… new WordPress. Fixing this will take an hour or more, I know it. Yes, it did. Simple… only in the end…

Shame that there’s always something. But that seems to be how it is. At a real scale (the scale of me, that is), it all seems faintly unreliable, piles on piles.

It brings a continuous, “Yes. That’s it. Almost.”

But at the same time, some things which were not automatic in my own processes are automatic the next day. And that does work at the scale of me.

Starting with Visual Studio Code

Notating my own slow progress: Editing Python in Visual Studio Code. There are strange impediments, always.

It is almost impossible to understand instructions on the first reading. But patience. Who wants to blog about reading the strange prose of tech-splanation? Unless it’s blogging about the strange patience that it takes to read online instructions. So: patience.

It all comes so much faster when you just muck around — until you don’t know what you’re doing, and you’re stuck for a week, and you watch the turtle passing you by…

And now, after years of slogging along in my own half-cocked patterns in Xcode, I see I have not made good use of ‘extract variable’ and ‘extract function’ over my years. And the REPL should be such a time-saver… what have I been doing, during all of this progress?

Visual Studio Code / Python / TensorFlow

The basic installation of Visual Studio Code is simple enough.

Python is setup with Anaconda. This seems to open up a lot of options.

Tensorflow also was an easy install.

The Python in Visual Studio Code page gives a pithy introduction to the environment, though generating a launch.json file with the red-dotted ‘Settings’ button produced an unsuccessful result for debugging. Using Debug -> Open Configurations worked.

My starting resource for Tensor Flow is the O’Reilly ‘TensorFlow for Deep Learning’. And off we go.

Platform

The algorithm has been written in C. This is convenient in that the entirety of it can be reduced to unsigned short integers. Portable and permanent.

However — ultimately the vector libraries of Python, along with the power of TensorFlow and other ML resources, must likely be the goal.

C/C++ is better for integration with existing music software (JUCE)… but analysis of large quantities of music for analysis and generation… will require some expertise.

So what it looks like now: engine in C; communications in C++; data analysis in TensorFlow/Python.

Right, then.

Flocking bits

I think of all this as a sensible introduction to non-binary computing.  It is more than just interesting that: 1) a musical, number-theoretical treatment of groups of bits can contain such a vast amount of harmonic information of a more or less intuitive (Jazz-related) type; 2) the problem of indefinite location/identification appears as a problem of passing time; 3) matters of completeness in identifications (i.e. what is a thing?) are at the root of the System; and 4) the system is meaningfully commutative. And one can hear it very clearly. Seeing is harder, though.

For these reasons, it is time to investigate the system itself.

Doing

Watching people learn instruments, it is hard not to wonder whether some of the beauty of playing lies in the simple fact of its being done — a fact wildly underrepresented in digital music.

There is in digital music the fact of things being conceived. But moment-for-moment facts, unpaste-able, in real contact, making sensual sense, showing failures of memory and understanding, showing self-consciousness… such things are harder.

The unexamined life and the examined life need each other. Spending all on one’s time in examination deletes the subject.

A passing thought after hearing ‘Pornographic Mind’ as broadcast by the New York Times in a pop review. Pornography is always around the corner of this discussion… the imitation or concept of contact. Which drives contact, I suppose.