updating shared variables in theano

Background: I am running python with Theano on a GPU, and I care about speed. Scenario: I have a largeish matrix (C) which is stored as a shared variable, and I need to update a subset of the rows (modified_rows) by some other matrix (C_delta). What should I do? Initialising …

deletion and replacement of strings in bash

I try to record useful one-liners for future reference. I forgot to write down what this one does: mv $f ${f##START}.${f%%${f##START}} This awkwardly-timed (time-zone troubles) blog post is atonement for my carelessness. Like all one-liners it looks complicated but is pretty simple. It does this: > f …

putting a line in a filename (with sed)

"How can I cut a line from a file and paste the rest into a file whose title is the line I just cut?" If you find yourself asking yourself this question with any degree of regularity, you may have issues. Luckily for you, the help you so desperately need …

learning hangul(한글)

The Korean alphabet (Hangul) is - so far - my favourite writing system. It is logical and efficient. It pleases my sense of style. Since starting this post over a month ago I took up learning Mandarin so my feelings towards Hanzi are liable to threaten Hangul's dominance in the future, but …

man cut and other simple yet useful unix bits

Instead of just reading the man file, you could read this post about cut! Printing columns ('fields') n to m (inclusive) from a file: cut -d [delimiter] -f n-m filename Thus, removing the first n-1 fields from a file: cut -d [delimiter] -f n- filename [delimiter] is automatically a …