Saturday, January 31, 2009

Overhead of a Google Search..

In my very last lecture of undergraduate life, my lecturer brought out a really interesting point about the overhead of a google search, which we perform really often.

I found out that Harvard University physicist Alex Wissner-Gross had done the math on that and estimated each Google search is responsible for 7 grams of Carbon Emissions. To put that in less virtual terms, he suggests every two searches generate as much carbon dioxide as it does to boil a kettle of water for tea. In terms of greenhouse gases, one Google search is equivalent to about 0.2 grams of CO2. The current EU standard for tailpipe emissions calls for 140 grams of CO2 per kilometer driven, but most cars don't reach that level yet. Thus, the average car driven for one kilometer produces as many greenhouse gases as a thousand Google searches.

Google explains that issue in its official blog as follows. "Queries vary in degree of difficulty, but for the average query, the servers it touches each work on it for just a few thousandths of a second. Together with other work performed before your search even starts (such as building the search index) this amounts to 0.0003 kWh of energy per search, or 1 kJ. For comparison, the average adult needs about 8000 kJ a day of energy from food, so a Google search uses just about the same amount of energy that your body burns in ten seconds."

So its time to think twice before a google search. Having said so, I truly believe that no software Engineer in this world can survive without a google search. 

Thursday, January 29, 2009

How to repair the GRUB..

I have been using both Windows XP and Ubuntu 8.04 as the operating systems in my laptop. But after formatting the Windows XP OS of my laptop, I had no way of accessing the ubuntu partition. I was wondering whether I will have to reinstall ubuntu in my laptop. Then I found the solution. The following steps will lead you to repair the GRUB and reaccess the unseen ubuntu partition, if you have the same problem.

1. Boot the PC or Laptop with an Ubuntu Live CD.

2. Open a Terminal

3. Type the following command..

sudo grub

4. Type the following followed by the TAB key

root (hd

5. This will show the list of physical drives.

6. Type the number of the drive you installed ubuntu on,.

7. If you are not sure about the ubuntu installed drive add a ‘,‘ after the number and press theTAB key again.

root (hd0,

8. This will enable you to see something like following,

grub> root (hd0,
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0×7
Partition num: 1, Filesystem type is ext2fs, partition type 0×83
Partition num: 2, Filesystem type unknown, partition type 0×7
Partition num: 3, Filesystem type is fat, partition type 0xb
Partition num: 4, Filesystem type is fat, partition type 0xb

9. The ext2fs partition is the one Ubuntu is installed partition of your machine. 

10. The type the following with replacing 1 with the ubuntu installed partition num of your mechine.

root (hd0,1) 

11. Finally type the following, replacing hd0 with the physical drive Ubuntu is installed

setup (hd0)

This worked out fine for me. Hope it will work with you too. Let me know if there are any issues.

Cheers!!



Monday, January 26, 2009

Basics on Neural Networks

Currently I'm working on a project, which integrates Artificial Intelligence to a software application of a local software company in Sri Lanka. So I thought of writing down some of the basics on neural networks, which could be helpful for a beginner in the field. Some of the information follows, are the theories of neural networks and some of the information are my own experience in the field.

The best definition for the term 'Neural Network' I found was  provided by the inventor of one of the first neurocomputers, Dr. Robert Hecht-Nielsen. He defines a neural network as: "...a computing system made up of a number of simple, highly interconnected processing elements, which process information by their dynamic state response to external inputs". 

The motivation for the development of neural network technology stemmed from the desire to develop an artificial system that could perform "intelligent" tasks similar to those performed by the human brain. Neural networks resemble the human brain in the following two ways:

1.  A neural network acquires knowledge through learning.
2. A neural network's knowledge is stored within inter-neuron connection strengths known as    synaptic weights.

The true power and advantage of neural networks lies in their ability to represent both linear and non-linear relationships and in their ability to learn these relationships directly from the data being modeled. Traditional linear models are simply inadequate when it comes to modeling data that contains non-linear characteristics. Depending on the nature of the application and the strength of the internal data patterns you can generally expect a network to train quite well. This applies to problems where the relationships may be quite dynamic or non-linear. Artificial Neural Networks(ANN) provide an analytical alternative to conventional techniques which are often limited by strict assumptions of normality, linearity, variable independence etc. Because an ANN can capture many kinds of relationships it allows the user to quickly and relatively easily model phenomena which otherwise may have been very difficult or imposible to explain otherwise.

Neural neworks are typically organized in layers. Layers are made up of a number of interconnected 'nodes' which contain an 'activation function'. Patterns are presented to the network via the 'input layer', which communicates to one or more 'hidden layers' where the actual processing is done via a system of weighted 'connections'. The hidden layers then link to an 'output layer' where the answer is output to that.




A trained neural network can be thought of as an "expert" in the category of information it has been given to analyze. This expert can then be used to provide projections given new situations of interest and answer "what if" questions. Other advantages include:

1. Adaptive learning: An ability to learn how to do tasks based on the data given for training or initial experience.

2. Self-Organization: An Artificial Neural Network can create its own organization or representation of the information it receives during learning time.

3. Real Time Operation: Artificial Neural Network computations may be carried out in parallel, and special hardware devices are being designed and manufactured which take advantage of this capability.

4. Fault Tolerance via Redundant Information Coding: Partial destruction of a network leads to the corresponding degradation of performance. However, some network capabilities may be retained even with major network damage.

There are a few drawbacks in using neural networks for modeling applications too. 

1. Minimizing overfitting requires a great deal of computational effort.

2. The individual relations between the input variables and the output variables are not developed by engineering judgment so that the model tends to be a black box or input/output table without analytical basis.

3. The sample size has to be large.

I hope this will give a basic introduction to the field of neural networks. I hope to give an implementation tutorial on neural networks by upcoming posts. 

cheers!!