Posts

Walsh Hadamard transform - Image Compression.

Image
A random image compressed with the WHT. Basic Image Compression An early application of the fast Walsh Hadamard transform (WHT) was for image compression. It was used on a Mariner spacecraft in 1969, to broadcast pictures back to earth. The Walsh Hadamard transform, unlike the FFT, is not bandwidth limited. One consequence is there is no need to use a 2-D WHT for image compression as is necessary with the FFT.  Another consequence is more blocky artifacts than with the FFT. There is some elementary image compression code here: https://editor.p5js.org/siobhan.491/sketches/BQcmEs9GM 8-Point WHT The WHT when used for image compression examines the image for certain square wave like patterns and extracts those of highest magnitued. The WHT is self-inverse. To decompress you simply run those high magitude values through the WHT again. Improved Compression The intermediate calculations of the fast WHT algorithm are quite wavelet like and can also advantageously be used for image compress...

Switch Net 4 - reducing the cost of a neural network layer.

Image
 Switch Net 4 The layers in a fully connected artificial neural network don't scale nicely with width. Width of a neural network. For width n the number of multiply add operations required per layer is n squared. For a layer of width 256 the number multiply adds would be 65536 (256*256.) Even with modern hardward layers cannot be made much wider than that. Or can they?  A layer of width 2 only requires 4 operations, width 4 only 16 operations, width 8 only 64 operations. If you could combine k width n (n being small) layers into a new much wider layer you'd end up with a computational advantage. For example 64 width 4 layers combined into a width 256 layer would cost 64*16=1024 multiply add operations plus the combining cost.  A combining algorithm. The fast Walsh Hadmard transform can be used as a combiner because a change in a single input causes all the outputs to vary. The combining cost is n*log2(n) add subtract operations. For a layer of width 256 the combining cost...

GPT-4 Songs

Image
 GPT-4 Songs And perhaps talking directly to OpenAI

2 Siding ReLU via Forward Projections

Image
2 Siding ReLU via Forward Projections The ReLU acivation function in neural networks has special properties that allow it to be considered in a different way to other activation functions. The Switching Viewpoint You can view ReLU as being non-conducting when x<=0 and fully conducting when x>0.  It is a switch which is automatically turned on when x>0 and automatically turned off when x<=0. Which is an ideal rectifier in electrical engineering terms.  Hence the term  Rectified Linear Unit. A switch isn't there when it is on from the point of view of the flowing electricity (or analogous thing.)  Electricity flows through pushed together switch contacts the same as through the wires to the switch.  All the ReLUs in a neural network that are conducting, wire together various sub-components of the network. The wiring being complete the ReLUs become essentially invisible, until one or more ReLUs change state. Since neural networks are computed in a ...

Artificial Neural Networks

Image
Artificial neural networks An artificial neuron. The basic behavior of an artificial neural network is determined by the dot product (weighted sum) operator in each neuron. This also has a geometric interpretation. The dot product of A and B is the magnitude (vector length) of vector A by the magnitude of vector B by the cosine of the angle between them.  Dot product video. To understand information storage in a weighted sum it helps to know the central limit theorem. Statistical properties of the dot product. The central limit theorem. If you store 1 <vector,scalar> association in a weighed sum the weight vector will point in the same direction as the input vector. Store 2 <vector,scalar> associations and both input vectors will point some angle away from the weight vector. As a result the scalar output will be more sensitive to small changes in the input vectors. A reduction in an initial mild error correction capacity. I...