Sunday, April 12, 2009

open lab architecture

as i'm approaching the time to write my thesis, and getting lots of requests for my code, and collaborating with a bunch of people, and learning about version control, good coding/documentation practice etc., i want to establish for myself an architecture within which i can accomplish all my goals. the desirata for this architecture are as follows:

desirata:

1) easy collaboration on projects
2) version control of everything (keeps a complete archived scientific record)
3) allows for arbitrary openness (to eventually have a kind of "open lab notebook", but that is well organized)
4) general enough to incorporate both real experiments, and code development, and everything else my "lab" might do
5) custom rss feeds

i've been working on the back end (in my spare time), over the last few months. i've now converged on something that seems pretty good to me. in particular, for each project, i have the following hierarchical folder system:

-- code (folder for each set of scripts collectively implementing some function)
-- data (organized into subfolders according to lab of origin)
-- docs(folder for each publication)
-- meeting notes (folder for each meeting)
-- talks (a folder for each talk)

each project is under version control using git, with a private repo hosted by github. this seems to work pretty well, although i still haven't figured out a particularly good way to integrate documentation of code with this.

with regards to the front end, i want to create a wiki homepage, organized as follows:

-- projects
-- papers
-- posters
-- talks
-- blog

the papers, posters, and talks would really just be a bibliography, with links to final versions. blog would also just be a link to my blog (which would ideally be formatted to look like the rest of the webpage). the projects section, however, is really the key thing under consideration. each project's front end would then be organized much like a publication. for instance, a random project might be organized as follows:

I. Intro
II. Model
III. Algorithm
IV. Results
V. Discussion
VI. Bibliography

each section would be organized somewhat differently. consider, for instance, the "results" section. it would be organized with a number of subsections, one for each "feature". each feature would be organized as follows:

-- some text with equations/figures
-- source code (and data necessary to generate figures/statistics)
-- documentation for implementing this feature on new data

the key, however, is how that organization gets there. essentially, what i'd want to do is use commands such as \input{...}, which would call appropriate files. the text subsection, for instance, would call a tex file, that is written to be compiled either by a wiki, or by latex. this is actually pretty easy to do, since most wiki engines use latex markup for equation editing (i'm looking into the details on various wiki forums).

it seems to me, that with this architecture, i would have achieve all my desirata, and it could transform the way i work in a positive way. for instance, nobody would ever have to email me to ask me about my progress on a project that i am working on with them, as they would have an rss feed updating them on my progress. making all my code available would simply be a matter of changing permissions.

perhaps most importantly, i would have a single source documenting all my work. although the current culture of science requires that, every so often, scientists package some elements of their work, and publish it as a stand alone *document*. obviously, that approach is totally antiquated, for a number of reasons. first, science is a progression of steps, with no obvious delineation between major landmarks, necessarily. thus, forcing us to publish everything at once, instead of steadily over time, is unnatural. second, if there are mistakes in the published version, they simply stay in the scientific record. clearly, if mistakes are found, it would be advantageous to update the scientific record. third, this facilitates a more collaborative attitude, as other people, if they find mistakes, can simply make edits directly, or suggest them at the least. fourth, incorporating things like simulations, videos, etc, is straightforward. fourth, publications could link directly to my wiki, so people could easily find it.

anyway, this idea leads me to the following questions:

1) do you have any suggestions/modifications to the proposed architecture
2) in particular, do you have any good ideas about where to incorporate documentation of my code
3) do you think, generally, this is a good idea and would be worth my time
4) do you think i should locally host everything (ie, version control and wiki), or use other people's stuff (which would mean something like github and wikidot)? if other peoples, do you have any suggestions of which wiki host to use?
5) how much work/time, realistically, do you think this would take to set up? and do you think it is worth it?

Thursday, September 11, 2008

cAlarm

i want an iphone app that automatically determines when my first meeting of the day is (from my google calendar), and then automatically sets the alarm on my iphone to go off a predetermined amount of time before that meeting (eg, 1 hour). that way, i don't have to remember to set my alarm all the time. if you read this and don't make the app, please forward this to someone that will....

Wednesday, August 27, 2008

spatiotemporal calendars

i want a calendar that is built - from the ground up - realizing that people traverse both space and time. in other words, i want certain reminders to occur when i arrive at a particular space-time, not just time. a calendar that operated only in the spatial domain, and not the temporal domain, might have send me a reminder when i arrive next in nyc, or on campus. i often have to remember, for instance, to go to the office upon reaching campus, but i am stuck making a reminder in time, and hoping that i am around at the time the reminder goes off, and not busy. i may want spatiotemporal reminders as well, ie, remind me to call my friend when i get back to nyc and it is september. alternately, when i'm on campus, i'd like to know about seminars that i attend (but i don't care about them when i'm out of town). i believe this would be a very useful function for many people. given the iPhone knows where i am all the time, and what time it is, it seems like a perfect app. i can imagine creating a calendar for various locations in my google account, ie, home, office, new york, europe, etc. then, in each calendar, i can create appointments at specific times, or at arrival times, or arrival times between certain dates/times. appointments could potentially span several calendars (ie, when i'm in baltimore or new york, do something). somebody who makes iphone apps: please make this for the world. thank you.

Wednesday, May 7, 2008

Juice Fast

So, as you may know, i started a juice fast 3 days ago, mostly because i felt as though i hadn't been eating as healthy as i usually do in the last few months, so i wanted to start over. some interesting things have happened so far.

most notably, prior to starting this fast, i weighed myself a couple times a week, and for the past month or so, seemed to weigh 150 lbs (plus or minus a pound or two). Today, 72 hours in, i weighed in at 145 lbs, 5 lbs less. some important factors to keep in mind are that i typically weigh myself after working out (i.e., naked but dehydrated). this time, it was prior to working out (i.e., clothed and hydrated). nonetheless, it is interesting to speculate....

3500 kcal comprise a pound. for the last 3 days, it has been very easy to calculate how many calories i've ingested, as it is listed right on the bottle. turns out, each day, i ingest about 2000 kcal (4 Bolthouse Farms smoothies), which mean's i've ingested a total of 6000 kcal. to have lost 5 lbs, that means i must have had 5*3500=16,500 kcal fewer than normal. this means i must normally be eating 16,500/3=5500 kcal more. in other words, on an average day (prior to this juice fast), i consume around 7500 kcal! this is almost 4 times the normal amount for human beings. keeping in mind that i am a vegetarian, and mostly subsist on fruits, vegetables, and then some grains, i hope you can appreciate how i must be constantly stuffing my fat face hole.

the end.

Saturday, April 5, 2008

so, how should one go about trying to understand how a brain works

so, how would one go about understanding how a computer works. well, unfortunately, the answer to this question largely depends on the motivation for asking it. for instance, if one knows how a PC works, but not a mac, then the answer would look very different then the answer to the same question from somebody who knows nothing about computers at all. thus, to appropriately answer the question: "how should one go about trying to understand how the brain works?" one should probably first specify a set of motivating factors (and maybe also desirata). so, some things we'd like include:

1) memory augmentation: our memories are limited in ways that are often detrimental to quality of life. how often is one arguing about whether or not one spouted a particular utterance? also, if i could remember everything i learned, i wouldn't need to look things up again, or even keep books after reading them.

2) optimal learning: we spend a large fraction of our lives learning knowledge that we then apply to our daily lives, whether it is in the form of wisdom or semantic information or something else, it often takes many years for us to achieve satisfactory mastering of a discipline. if we could learn more faster, technology and development could advance faster as well.

3) creative juices: while "creativity" is not particularly well understood feature of the human experience (at least i haven't found a satisfactory account of it), i still feel comfortable suggesting that if we were more creative, we could more quickly find better solutions to current problems.

4) "objective" perspectives: our lack of predictive power often results in our experiences being severely biased by previous experience. if we could somehow "objectify" our perceptions, we may be better at predicting the responses of others, and therefore be able to have more fruitful relationships.

5) better language: surely, languages are a very cool invention (or discovery, depending on perspective). and yet, they are not quite as expressive as they could be. some ideas are very difficult to express using language (for instance, abstract concepts such as the wave-particle duality). it would be great if somehow we could make languages have more expressive power.

6) love: something we all (or nearly all) of us want more of, both on the receiving and giving sides. if everybody loved one another, i imagine that many of todays problems would cease. clearly, this is a very hippie-dippie idea, and maybe seems somewhat in juxtaposition with a set of desirata for contemporary neuroscience. but, who better to figure out such a thing?

7) introspective accuracy: a common finding in psychological studies is that introspection is simply not that accurate. it'd be great if when we reflected on why we responded in the way we did, we could be more accurate.

although i have just enumerated 7 desirata, only the first two are "real" neuroscientific questions, in the sense that only two can even be expressed as questions using a neural vocabulary. the relationship between neural hardware and creativity, perspective, language, love, and introspection is so tenuous at this point, that it is probably not even worth considering until further notice. furthermore, the first two: learning and memory, are conserved evolutionarily, so we can start out by studying significantly simpler systems.

as a side note, people may argue with my desirata. ok, i'm not for everyone, and neither are my ideas. i'm happy to hear about alternative desirata...

a good analogy for trying to figure out how the brain works

imagine finding a TV screen on the ground, and not knowing what it did or how. how could one figure out how it works. one strategy would be to look at each pixel in isolation, and see how it responded to various inputs, and then try to determine the "pixel-code", mapping the inputs to statistical regularities of the outputs. this might work. alternately, one could start with the simplest TV one could find that shares the same essential properties, and begin exploring the circuit underlying the behavior (ie, the mechanisms). upon developing the underlying operational principles, ie, the functions that resistors, capacitors, etc. perform, one could then scale up to increasingly complex systems. eventually, one could build up to something like a jumbotron, but it would be ill-advised to study a jumbotron, without first understanding a 4" black and white TV.

i think a similar argument applies to neuroscience. we could just start sticking electrodes in the brains of primates and humans, and hope that we can figure things out. or we could start with a much simpler system, and try to unravel the basic governing principles at work. this analogy breaks down, however, in a number of places.

first, i think the things that are especially cool about brains, are things that humans definitely do, and other animals do to a lesser degree. as the brain becomes less complex, the megacool properties become less pronounced. for instance, here is something especially cool that we do. you tell me the meaning of a word, and i then understand it, possibly forever. it is not clear what a homolog of that is in the animal kingdom. fortunately, other supercool attributes of human cognition do seem to have homologs. for instance, our ability to recognize objects. this is a megahard problem computationally. somehow, however, pretty much all animals have figured out how to do it. it is a necessary condition for behavior, at least at a very coarse level (ie, determining whether objects are predators or prey). so, this fear may be mitigated by studying properties that are conserved evolutionarily.

second, analog circuit elements are relatively simple as compared with neurons. this fear assumes that the fundamental (ie, "atomic") unit of neural computation is a neuron. so, one way to mitigate this fear is to postulate that the fundamental unit is something much simpler, ie, a synapse. while synapses are still much more complicated than analog circuit elements (eg, modeling a synapse "accurately" probably requires several states or dimensions, whereas analog circuit elements only require one), they are certainly closer, and it probably doesn't make much sense to postulate anything more atomic than a synapses. on this perspective, neurons become somewhat like integrated circuits, and then the brain becomes the whole circuit board.

third, one could argue that brains are much more general devices than TV's. but maybe that is not true. input to brains come in several possible forms: visual, auditory, etc. similarly, input to TV's come in several possible forms: tuners, cable, DVD's, etc. the output of brains also only have a few possibilities: speech, body language, movements, etc. similarly, TV's output only audio and visual signals. but brains seem to have something that TV's don't: internal states. ok, technically, TV's have 2 internal states: on and off. even if one postulates that different channels correspond to different internal states, the number of possible internal states for a TV pales in comparison to those of a brain, which are innumerable. so, let's switch the analogy from a TV to a computer. a computer (with all the appropriate dressings like an OS, programs, etc.) has may possible internal states. one may think of an internal state as follows: for a particular input, the output is different for a different internal state. so, for a computer, when running one program, a particular key stroke may lead to saving a document, whereas in another program, that same exact keystroke will lead to sending the document. in that sense, each program may be considered to correspond with a different internal state. and yet, computers are still insufficient, as the number of internal states for a computer is discrete and finite (eg, about 1 per program). however, in brains, the number of internal states may not be finite, and is certainly not discrete. for instance, i could be in a relatively good mood, in which case if i get hit by a car, it is not quite that bothersome; whereas if i were in a bad mood, it might be infuriating.

thus it seems as if even analogizing with the most sophisticated devices that humans understand (ie, computers) is insufficient, as the complexity of the human brain - at the level of internal states - is incomparably more complex. nonetheless, this seems as if its the best analogy that we can come up with, so we must work from there.

apocalypse now

quote from about 1000 years ago: "if you don't start accepting my g-d, the world as we know it will end."

quote from about now: "if you don't start recycling or fighting terrorism, the world as we know it will end."

arguments seems about the same to me. new set of beliefs, same old scare tactics. how about we focus our energies on solving real world current problems, famine, disease, poverty, crime, psychiatric illness, etc., instead of spending so much time, energy, and resources trying to prevent problems that may or may not happen?