The Big Blob
A blog of blobs
A blog of blobs
Jul 12th
While the OpenCL API is written in C, the OpenCL 1.1 specification also comes with a specification for C++ bindings. In this post I go through how to use the C++ bindings instead of C for the simple example of vector addition from my previous post Getting started with OpenCL and GPU computing.
Jul 11th
The neural network discussed in this post, called the Boltzmann machine, is a stochastic and recurrent network. This post contains my exam notes for the course TDT4270 Statistical image analysis and learning and explains the network’s properties, activation and learning algorithm.
Jun 21st
OpenCL (Open Computing Language) is a new framework for writing programs that execute in parallel on different compute devices (such as CPUs and GPUs) from different vendors (AMD, Intel, ATI, Nvidia etc.). The framework defines a language to write “kernels” in. These kernels are the functions which are to run on the different compute devices. In this post I explain how to get started with OpenCL and how to make a small OpenCL program that will compute the sum of two lists in parallel.
Jun 18th

Simple graph made with matplotlib
Lets say you are working on a website made in Django. And you want to make some nice looking graphs real time, as images from dynamic data. This can be done by using the python 2D graph library matplotlib. The library can be found in the debian package python-matplotlib. A simple graph showing a sine curve, seen to the right, can be generated in regular python using the following code(taken from this example):
from pylab import * t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) plot(t, s, linewidth=1.0) xlabel('time (s)') ylabel('voltage (mV)') title('About as simple as it gets, folks') grid(True) show()
If you want to output this graph as a PNG image to the browser from a view in Django, you can store the image in a string buffer and output this buffer using the HttpReponse class in Django and set the mime type to image/png.
from django.http import HttpResponse from matplotlib import pylab from pylab import * import PIL, PIL.Image, StringIO def showimage(request): # Construct the graph t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) plot(t, s, linewidth=1.0) xlabel('time (s)') ylabel('voltage (mV)') title('About as simple as it gets, folks') grid(True) # Store image in a string buffer buffer = StringIO.StringIO() canvas = pylab.get_current_fig_manager().canvas canvas.draw() pilImage = PIL.Image.fromstring("RGB", canvas.get_width_height(), canvas.tostring_rgb()) pilImage.save(buffer, "PNG") pylab.cose() # Send buffer in a http response the the browser with the mime type image/png set return HttpResponse(buffer.getvalue(), mimetype="image/png")
Jun 7th
In this essay, written as my final essay in the course IT3708 spring 2010, I discuss two phenomenas that are the driving forces for a lot of the complex biological systems in nature with several simple components that interact with each other. These two phenomenas are competition and cooperation. I will discuss examples from the process of evolution, where competition play a crucial part, to ant colonies, where cooperation between ants enables these simple creatures to do extraordinary things. All of the examples presented here have an inspiration from biology and has been applied successfully to computer AI problems. I start by defining competitive and cooperative interactions among individual components in a broad sense. Then six examples, with competitive and cooperative interactions, are presented. I finished off with a conclusion on the advantages and disadvantages of using these two phenomenas in AI systems.
More >
Apr 30th
Da var faget Eksperter i Team over og jeg og resten av gruppa mi er stolte over å presentere resultatet av vårt arbeid. Som sagt i et tidligere blogginnlegg gikk oppgaven vår ut på å gjenskape Hamar domkirke i virtuell virkelighet. I den sammenheng har vi laget en film over gamle Hamar domkirke som vi har lagt ut på Youtube, se under. Filmen viser tre ulike byggefaser kirka gikk gjennom.
3D modellene av kirka er laget i programmet 3D studio max 2009, landskapet i Grome 2, teksturene er funnet på cgtextures.com og fantastiske gratis Unreal Development Kit er brukt til å sette det hele sammen med realistisk grafikk.
Feb 27th
I det obligatoriske faget Eksperter i Team har jeg og en gruppe på 3 andre valgt oppgaven med å gjenskape Hamar domkirke i virtuell virkelighet. Det vil si at vi skal modellere den i 3D på datamaskiner og så plassere den i et 3D landskap. Kirken ble bygget rundt år 1200 og ble rasert i 1567 av svenskene under den nordiske 7 års krigen.
Etter andre dag med jobbing har gruppa fått modellert hovedtrekkene til både fase 1 og 2.
Neste steg er å legge mer detaljer til modellene. Som f.eks. dører, vinduer, takpynt o.l.
Feb 27th
This neural network proposed by Hopfield in 1982 can be seen as a network with associative memory and can be used for different pattern recognition problems. This post contains my exam notes for the course TDT4270 Statistical image analysis and learning and explains the network properties, activation and learning algorithm of the Hopfield network.
More >
Dec 17th
One often needs a source of random numbers for use in stochastic simulations. Since a computer is deterministic, it can’t generate real random numbers, unless one happen to have a quantum random generator at hand, like these. But computers can generate sequences of pseudo-random numbers which are deterministic sequences of numbers which has the same statistical properties as sequences of real random numbers. All of the different random functions in various programming languages, like rand() in C, create sequences of pseudo-random numbers. This post contains my exam notes for the course TDT4270 Statistical image analysis and learning and explains how to generate these sequences, what sampling is and how to sample from any probability distribution.
Recent Comments