Recently been taking antipsychotics

Wednesday, March 26th, 2008

All the drugs I’ve taken for most of my psychiatric life — except for that brief contact with bupropion — have been anticonvulsants. And I’ve actually been okay, oscillating between mild hypomania and no hypomania at all. Remember, I started psychiatric drugs because of depression, which hasn’t happened for more than a night or two since I started treatment.

Then somehow I got into the (hypo)mania that wouldn’t stop. I’d take 6 or 8mg of clonazepam and still be awake all night. Spending massive amounts of money in luxury stuff like $250 headphones or a 160gb iPod. So we finally entered the strange world of atypical antipsychotics. I had learned a lot about anticonvulsants, but this is brave new world to me.

For a while I though they were horrible drugs that silence the chatter inside your head. 1.5mg o risperidone made me smart — as in shutting out all other stimuli that made it difficult to concentrate on the smarter stuff. 2mg made me a bot.

We’re phasing risperidone now and introducing Seroquel. Like with risperidone I’m quite liking the effect — which is very different — but I’m not at the final dose yet. OTOH, I’m still on risperidone, so I might be on the right track regarding antipsychotics.

I’m getting pleasure waves around 6PM everyday, and my first theory was that that could just be the Seroquel (which has a half-life of 7 hours only) wearing off and leaving the 4mg clonazepam that’s still on my daily cocktail. But, hey, I’m on minimal doses of Seroque, and that’s supposed to hit your H1 receptors first, which could mean I’m only getting a sedative — or maybe it’s enough for the antipsychotic effect to kick in — and no one in the world can tell. And I’m on risperidone as well.

Tuesday, July 17th, 2007

A máquina acima é uma impressora em 3D que pode fabricar objetos de plástico, cerâmica ou metal conforme comandada por um computador. Várias pessoas já construiram uma Darwin (a versão atual da RepRap). Em breve, a máquina poderá fabricar a si mesma — a previsão é 2008.

And then everything we know goes out the window.

A única coisa que eu sei é que a economia pós-escassez será o teste definitivo da controvérsia Malthus-Ricardo e dos princípios da demanda efetiva/lei de Say.

RepRap will make plastic, ceramic, or metal parts, and is itself made from plastic parts, so it will be able to make copies of itself. It is a three-axis robot that moves several material extruders. These extruders produce fine filaments of their working material with a paste-like consistency. If RepRap were making a plastic cone, it would use its plastic extruder to lay down a quickly-hardening 0.5mm filament of molten plastic, drawing a filled-in disc. It would then raise the plastic extrusion head and draw the next layer (a smaller filled disc) on top of the first, repeating the process until it completed the cone. To make an inverted cone it would also lay down a support material under the overhanging parts. The support would be removed when the cone was complete. Conductors can be intermixed with the plastic to form electronic circuits - in 3D even! This process is called fused deposition modeling; machines that do this are called 3D printers, rapid prototypers, or fabbers. They are very useful. Unfortunately they are also very expensive - $20,000 US or more - and existing models don’t self-replicate. The RepRap build cost will be less than $400 US for the bought-in materials, all of which have been selected to be as widely available everywhere in the world as possible. Also, the RepRap software will work on all computer platforms for free. Complete open-source instructions and plans are published on this website for zero cost and available to everyone so, if you want to make one yourself, you can. We hope to announce self-replication in 2008.

Making a monad: Martin Erwig’s Dist

Sunday, February 11th, 2007

Much of statistical modelling involves shuffling around operations on stochastic variables — i.e. on their probability distributions. This can be tricky stuff: it either involves loads of manual lifting with fully discrete distributions or clever analytic methods for continuous ones. This is complicated enough that most of basic and intermediate-level applied statistical analysis is done working with a normality assumption; the normal distribution has some simple linearity properties regarding affine functions of normal stochastic variables, and is thus used to avoid dicking around with convolutions and the jacobian method.

Like with Pancito, this is something I once independently tried to do, but got lost trying to model dense spaces and measure theory. Martin Erwig did the actual work so far, even though there’s no work in continuous spaces at all. I’m working on cleaning his code up — that is, making it more like the other GHC libraries, since this was done for an academic paper. I’d like to eventually turn this into Control.Stochastic; it’s not a Data.* library, as it allows for transititions, functions whose outcome depends on stochastic variables. This together with sigfpe’s CA comonad could lead to a very compact library for simulating percolation systems! In general, stochastic programming has wide, deep applications that make this econometrician’s eyes shine with hope.

So after this short status report (apparently I finally manage to become interested enough to work on a project for a significant ammount of time), let’s take a look ath the centerpiece of Erwig’s PFP library: the Dist monad.

First of all, probability is a measure over an algebra of events. Erwig doesn’t mull over too much on algebras, sigma-algebras and measure theory — I admire his restraint. Instead, we have merely the concept of an event: something that might or not happen.

type Event a = a -> Bool

Baby steps with Pancito: a simple color filter

Saturday, January 20th, 2007

I was thrilled to find out about Pancito today, a simple-to-use Haskell library for functional image manipulation. In Pancito, images are functions from a Point datatype to a Colour type. Slow, but fun.

As a quick showcase, this is a simple color filter in Pancito:

module Main where
import Pancito2
import Colour
import Common
import Point
import Reprocess
import System
 

jamma j c = rgba  ((r c)/j) ((g c)*j) ((b c)**j) (a c)

getImg fn = readPpm fn square01 white;
writeImg fno func ws im =  ppm square01 ws  fno (func .  im);

main = do { [fn, fno, j]<-getArgs; y<-getImg fn ; writeImg fno (jamma (read j)) (snd y) (fst y); putStr $ "Applied " ++  j ++ "-level Jamma filter to "++fn++"; written to "++fno;}

For convenience, I also wrote a quick shell script that handles conversion from JPEG to PNM and back with NetPBM, and opens original and altered image on OS X’s Preview.

echo "1. Converting JPG to PNM…"
jpegtopnm $1 > t1.pnm
pnmtoplainpnm t1.pnm > t2.pnm
echo "2. Running Jamma plugin.."
./jamma t2.pnm t3.pnm $3
echo
echo "3. Converting back to JPG .."
ppmtojpeg t3.pnm > $2 && open $2 && open $1

This is all a horrible hack, but I’ve only worked in this for half an hour and I’m excited enough to want to share immediately. Here’s a picture of my hand:

original after jamma
manito.jpg manito2.jpg

Here’s a NSFW classic in original.jpg and jammaed version.

Sure, from a Haskell viewpoint this isn’t really that exciting — it’s all rather simple — but I’m very fond of image manipulation, and wrote 30% of a Pancito-type library before dropping it. I might just be excited that someone went through the end of it. It’s at the very least a good framework for image processing research.

Free counter and web stats