Landmark Learning (Due Novemebr 5)
For this exercise you need to have a good understanding of Section 3.4, pages (151-155) from the text book (Metaphorical Brain 2 by M. Arbib)
Homework
1.[2pts] Assume that the robot always starts to learn from the SE corner of the space and is never allowed to enter the NW quadrant during learning. After the robot learns to navigate towards the tree from the SE corner, if we place the robot to the NW corner what do you expect the robot to do ? Do you think it can navigate towards the tree in (almost) a straight trajectory as it has been doing from the SE corner? Justify your answer using the weight update rule in the text book (TMB2 page 153, equation 3).
2.[4pts] Implement the landmark learning model described in the
book. Specifically you need to replicate the result given in Figure3.4.8
in TMB2 (page 152). Use the guidelines below.
- The attractant tree is located at the origin (20, 20).
- The coordinates of the landmarks are: (0, 20), (40, 20), (20, 0), and (20, 40).
- The strength of landmark smell (cue or signal) reduces linearly with the distance (d).
Use the function smell(d) = 0.5*(1-d/r), if d<=r , 0 otherwise (take r=28 for both the landmarks and the central tree).
Note that the smell function serves as the Xi's for the landmarks and Z for the central tree (Xi and Z is defined in TMB2).
- To visualize the process in NSL define a 41x41 matrix where you can encode the current position of the system (e.g. a matrix filled with all -1s, except the current position of the robot, which is marked with a +1. You can use zeros to encode the position of the landmarks)
- If you wish you may use a plain model structure such as the one given at the bottom of the page.
For this part of the homework submit the following:
Sample Skeleton for the Landmark learning model implementation:
nslModel Landmark () {
private int N_ACTION = 4;
private int N_LMARK = 4;
// You can declare the tree
as one of the landmarks for programming convenience. In this case N_LMARK
= 5;
private int LAND_SIZE = 41;
private NslInt0 dis();
public NslDouble2 land(LAND_SIZE,LAND_SIZE);
public NslDouble2 weight(N_LMARK,N_ACTION);
public NslInt0 posx;
public NslInt0 posy;
// current position of the robot
public int landmark[N_LMARK][2];
// lanmark[i][0] is x of landmark i
// lanmark[i][1] is y of landmark i
public int treex=LAND_SIZE/2;
// the tree is in the center
public int treey=LAND_SIZE/2;
public void makeConn() { }
public void initSys()
{
nslPrintln("Initializing
Landmark Learning model");
system.setRunEndTime(150);
system.setTrainEndTime(1);
}
public void initModule()
{
system.nslSetTrainDelta(1);
system.nslSetRunDelta(1);
//setup landmark[][] array
here
//setup initial weights
here (e.g. set the weights to small
//
random values)
}
public void initRun()
{
// initialization code
for the each run
}
public void
simRun() {
// Actual code goes here.
}
}