Professional Documents
Culture Documents
Exercises
Problems marked with * are optional.
b(Z) = benef it · Z
where benef it denotes a constant factor. Note that the expression of LacZ (Z) is
only beneficial in the absence of glucose, i.e. when cAMP (= Sx ) is produced. On
the other hand the expression of LacZ consumes energy and reduces the growth
rate approximately by a constant factor
c = cost.
with constant maximum production rate β = 0.02 and degradation rate α = 0.02.
This results in a maximum expression rate Ymax = Zmax = β/α = 1 and decay
time constant of α = 0.02. The production rates IY /Z are given by
where Θ denotes the Heaviside step function and matrix k denotes activation
coefficients. X is in this example is activated instantaneously by input Sx , i.e.
X = Sx . This model is already implemented in MATLAB and only the activation
coefficients k have to be modified for the following analysis.
For this task the input Sx has the shape of a pulse with amplitude 1 and a
duration of either 20 ms or 200 ms occurring with probability p1 and p2 (p1 +p2 =
1), respectively. The activation coefficients k should be optimized with genetic
algorithms to maximize the growth rate for different settings of benef it, cost, p1 ,
and p2 .
b) Complete the code for the evaluation of the fitness value in the file calc fitness.m.
1
http://www.igi.tugraz.at/lehre/MLB/WS08/ga.zip
c) Optimize k consisting of only positive elements (kij ∈ [0, 10]) for cost = 2,
benef it = 4, p1 = 0.9 and p2 = 0.1 using a population size of 5000 and 500
generations. Describe and explain the mechanisms of the solution. Average
results over several runs of the genetic algorithm to average out outliers.
Hand in a plot illustrating the dynamic of the gene regulatory network
(GRN).
d) Repeat the optimization with parameters cost/benef it ∈ [0.1, 2], p1 ∈ [0, 1].
Describe different solutions (mechanisms of the GRN) found by the genetic
algorithm. Hand in a plot of the gene regulatory network dynamics for each
solution.
e) Hand in a two dimensional plot with axes cost/benef it and p1 which shows
for the results obtain in d) which solution is selected in different parameter
ranges.
Present your results clearly, structured and legible. Document them in such a
way that anybody can reproduce them effortless.
b) Modify the code in the file compare.m to train neural networks with the
standard back-propagation algorithm from the MATLAB Neural Networks
Toolbox. Train neural networks consisting of 1, 3, 5, 7, 10 and 15 hidden
units and plot the training/test errors and the run times of the algorithm
in dependence on the number of hidden units. Average the results over
several runs for each network size. Apply a standard method of your choice
to compensate for over-fitting (i.e. weight decay or early stopping).
Present your results clearly, structured and legible. Document them in such a
way that anybody can reproduce them effortless.
4 Patterning [5+4* P]
Use the artificial organism simulator (AOS) to program a blast cell B0 to grow
cells to from a pattern that resembles a Japanese flag.
a) Download the simulator4 and read the README.txt file. Modify the XML
files config/environment patterning.xml and config/organism patterning.xml
to program the environment and the cells.
You can use the following competences and reactors for this example:
DivideCompetence, MigrateCompetence, ConstReactor, SourceReactor,
DiffSourceReactor and KillReactor.
You can visualize the results of a simulation with the MATLAB script
visualize (see README.txt).
b) Program the blast cell to divide into two types of output cells C1 and C2
that should self-organize to form a pattern that resembles a Japanese flag.
To obtain a smooth pattern the output cells C1 and C2 should produce
chemicals c1 and c2 . Don’t care about the specific colors of the flag. You
can of course produce more than two cell types. Run the simulation for
100000 time steps.
c) [2* P] Program the blast cell to divide into three types of output cells C1,
C2 and C3 that should self-organize to form a pattern that resembles a
French flag. You can of course produce more than three cell types.
c) [2* P] Program the blast cell to divide into two types of output cells C1
and C2 that should self-organize to form a pattern that resembles the flag
of Austria or Burundi. You can of course produce more than two cell types.
Present your results clearly, structured and legible. Document them in such a
way that anybody can reproduce them effortless.
4
http://www.igi.tugraz.at/lehre/MLB/WS08/simulator.zip
5 Small-world networks [3 P]
Carry out a web search and find three datasets that have small-world properties.
That is
1. the cluster coefficient should be at least 20% larger than for corresponding
random networks that consist of the same number of elements.
2. the average shortest path length should differ at most by 10% compared to
random networks.
Use MATLAB to calculate the cluster coefficient and the average shortest path
length of the networks. Hints:
b) Write a function that takes the connectivity matrix W as input and calcu-
lates the cluster coefficient and the average shortest path length.
c) To calculate the cluster coefficient count only links between existing neigh-
bors. Nodes with only one or zero links are therefore not used for the
calculation. This is a property of undirected graphs. If necessary you can
convert a directed graph into an unidirected one.
d) To calculate the average shortest path length ignore unconnected nodes and
average only over shortest path lengths of connected nodes. This is a prop-
erty of directed and undirected graphs.
e) For each dataset that represents a directed graph you can choose if you
analyse the original directed graph or its undirected version obtained by
adding reciprocal links.
Present your results clearly, structured and legible. Document them in such a
way that anybody can reproduce them effortless.
6 Robustness [3 P]
Compare the memory capacity and the robustness properties of five networks
consisting of threshold gates with different connectivity graphs for a binary clas-
sification task.
a) Networks:
The five types of networks are: regular 2-dimensional lattice, random net-
works, Barabasi-Albert scale-free networks, Watts-Strogatz small-world net-
works, and Kaiser-Hilgetag small-world networks. Each network consists of
100 threshold gates and 1000 weights, where each weight is drawn randomly
from a Gaussian distribution with mean zero and standard deviation of one.
The threshold of each gate is set to zero.
1. Download the MATLAB code 5 and modify the MATLAB file robustness.m
to generate the missing networks. Implement the small-world and
scale-free networks as outlined in the exercises.
2. For each network a function should be implemented that takes the in-
put parameters as stated in the corresponding function header (nNodes,nLinks,α,...)
and outputs a connectivity matrix Wij of size 100×100 with elements
0 and 1, where 1 indicates a weight from gate j to gate i. All net-
works represent directed graphs and Wij is therefore in general not
symmetric.
b) Memory capacity:
To estimate the memory capacity simulate the networks for 1000 time steps.
During each time step binary input (1-dimensional with randomly chosen
bit values) is injected into the first 20 threshold gates of the network. The
input weights are drawn randomly from a Gaussian distribution with mean
zero and a standard deviation of eight. A linear classifier should be trained
with linear regression on the states of the last 20 gates of the network to
output the input bit that was injected ∆t ∈ {1, 2, 3, ..., 50} ms ago. For each
∆t a different classifier should be trained, thereby estimating the memory
capacity of the linear classifier for each network as a function of ∆t.
1. Perform 100 network simulations for each network type and generate
for each simulation a novel input and a novel network.
2. Train for each simulation a linear classifier for each ∆t and determine
the MAE. Calculate for all 100 simulations the average error and the
standard error of the mean SEM to verify the significance of the results.
3. Generate a plot that shows the average MAE and the SEM as a func-
tion of ∆t for all network types. Note that the output of the linear
classifier is 0 or 1. It is obtained by thresholding the output of the
linear regression model at a value of 0.5. Compare and discuss the
results for all networks.
5
http://www.igi.tugraz.at/lehre/MLB/WS08/robustness.zip
c) Robustness:
To estimate the robustnes properties train the networks for ∆t = 2ms for
which the performance of the linear classifier is highest. After training prune
all weights of P = 0, 2, 4, 6, ..., 20, 30 and 50 % of the network gates. (but not
the input weights). Simulate the network again and test the performance
of the linear classifier on the pruned network. Calculate the performance
values thereby estimating the robustness of the performance of the linear
classifier as a function of the number of gates with pruned weights.
1. Perform 100 simulations for each network type and generate for each
simulation a novel input and a novel network.
2. Train for each simulation a linear classifier for each P and determine
the MAE. Calculate for all 100 simulations the average error and the
standard error of the mean SEM to verify the significance of the results.
3. Generate a plot that shows the average MAE and the standard error
of the mean SEM as a function of P (the % of pruned gates) for all
network types. Compare the difference in performance for P = 0,
P = 0.1 and P = 0.5 for each network type. Which network has the
smallest memory loss?
Present your results clearly, structured and legible. Document them in such a
way that anybody can reproduce them effortless.
7 RL theory I [3 P]
Prove Corollary 1.1 (p. 7) from the script Theory of Reinforcement Learning 6 :
8 RL theory II [3 P]
Prove Corollary 1.3 (p. 9) from the script Theory of Reinforcement Learning 7 :
is optimal.
6
http://www.igi.tugraz.at/lehre/MLB/WS06/MDP Theory.pdf
7
http://www.igi.tugraz.at/lehre/MLB/WS06/MDP Theory.pdf
9 RL game [3* P]
Consider the following game: You have a random number generator that produces
in every round an integer number from 1 to 3 with equal probability. You play 3
rounds and have to decide at which position of a 3 digit number you want to place
the random digit. Your goal is to form the largest possible (decimal) number.
Formulate this game as a Markov decision process and find an optimal policy.
Also analyze the case where the numbers are drawn without replacement, i.e. if
the digit 3 appears in the first round, it cannot appear anymore in the remaining
two rounds.
S B
Use Q-Learning and SARSA without eligibility traces to learn policies for this
task. Use ǫ-greedy action selection with a constant ǫ = 0.1. Measure and plot the
online performance of both learning algorithms (i.e. average reward per episode),
and also sketch the policies that the algorithms find. Explain any differences in
the performance of the algorithms. Are the learned policies optimal? Try this
8
www.igi.tugraz.at/ril-toolbox/general/overview.html
9
http://www.igi.tugraz.at/lehre/MLB/WS08/intern/examples.zip
exercise again with ǫ being gradually reduced after every episode and explain
what you find. Submit your code and the gridworld configuration file.
a) (1 point) For fixed ǫ = 0.1, how large do you have to set the bonus reward at
B, such that both algorithms converge to the same policy. Plot the online
performance for both methods.
b) (1 point) How does the online performance and the final policy change if
you use eligibility traces for both algorithms? Try different values for λ.