Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Final project topic descriptions and outline instructions PNB 2A03 This document describes each of the 3 final project topics in detail

Final project topic descriptions and outline instructions PNB 2A03 This document describes each of the 3 final project topics in detail

Computer Science

Final project topic descriptions and outline instructions

PNB 2A03

This document describes each of the 3 final project topics in detail. The drift diffusion model is fairly mathematically simple, but you will need to write extra code for data manipulation and statistical analysis. Meanwhile, the HodgkinHuxley model is more mathematically complex, but you aren’t asked to do much more than simply get the model to work. The Hopfield network is somewhere in the middle.

Under each project description is a set of questions to be answered in your final project outline. Your answers to these should specify in words programming solutions that are specific (i.e., detailed enough translate into code) and workable (i.e., they would work efficiently), and you should endeavour to use the vocabulary we’ve learned in lecture. It will generally not take more than a few sentences per question to do this. Please submit your outline via Avenue as a PDF that contains your student number, the project you are choosing, and your answers to the 5 questions corresponding to that project.

For the Hodgkin–Huxley model, a question might be, “How will you ensure that updates to Vm stop when t ≥ 200?” An answer that uses the correct vocabulary and is specific but not workable might be:

Updates to Vm will take place in a loop that begins “while True:”. During each loop iteration, t will be appended to a list called “ts”. Using an if statement, I will test whether the length of ts is greater than or equal to 200 and, if it is, the code will break out of the while loop and Vm will no longer be updated.

Meanwhile, an answer that uses the correct vocabulary and is workable but not specific might be:

It would be a loop where t is less than 200. That way, when t is 200, Vm stops being updated.

Finally, a solution that is both specific and workable and uses the correct vocabulary might be:

Updates to Vm will take place in a while loop, and the condition for the while loop to repeat will be t < 200. During each loop iteration, t will be incremented by ?t, so it is guaranteed to eventually reach 200, at which point the loop will end and Vm will no longer be updated.

Each question will be graded according to the following rubric: Specificity:

  • (0/2) It is not at all clear how the solution would be implemented.
  • (1/2) The solution could be implemented if a bit more detail were provided.
  • (2/2) The solution contains enough detail to be implemented.

Workability:

  • (0/2) The solution would not work and is not plausible.
  • (1/2) The solution would work but would not be ideal (e.g., would be significantly inefficient), or would not work for reasons that are not obvious.
  • (2/2) The solution is ideal.

Vocabulary:

  • (0/2) The correct vocabulary was not used.
  • (1/2) The correct vocabulary was sometimes used.
  • (2/2) The correct vocabulary was always used.

Drift diffusion model

The drift diffusion model is a model of decision making in 2-alternative forced choice tasks, in which participants must choose between 2 options. We will use it to simulate choice data in a lexical decision-making task, in which participants must decide whether a stimulus is a real word or not.

In the drift diffusion model, a hypothetical quantity called X changes over time. If it reaches some threshold a, one of the choices is made (for this project, the participant decides the stimulus is a real word); if it drops below 0, the other choice is made (the participant decides the stimulus is not a real word). X changes over time according to the following equation:

                                                   Xt+?t = Xt + A?t + cW?t                                                      (1)

where ?t is the time step (the time between successive updates to X), Xt+?t is the value of X at the next time step, Xt is the value of X at the current time step, A determines the average rate of change of X, W is white noise (i.e., the value of W is sampled from a normal/Gaussian distribution with mean 0 and variance 1 each time X is updated), and c controls the magnitude of the noise. X starts from some value z, 0 < z < a, at the first time step and X is repeatedly updated for as long as X is not less than 0 and not greater than a.

Various alterations in these parameters, and in their statistical distributions, can re-create accuracy and reaction time effects found in human participants.

In the lexical decision task, there are typically speed–accuracy trade-offs both within participants (quicker decisions are more likely to be erroneous) and between participants (quicker participants make more errors overall).

Use the drift diffusion model to simulate a lexical decision task in which 40 participants complete 300 trials each, 150 with words and 150 with non-words. ?t will always be 0.1 and c will always be 1.2. Each participant will have a different individual value of a, which will be drawn at random from a uniform distribution between 0.5 and 1.5. At the beginning of each trial z and A are initialized at random: z is drawn at random from a uniform distribution between 0 and a; A is drawn from a normal distribution with mean µ and standard deviation 0.1, where µ = 0.8 if the stimulus is a real word and µ = −0.8 if it is not.

Each trial proceeds as follows: t is initialized to 0 and X is initialized to z.

For as long as X is greater than 0 and less than a, t is incremented by ?t and X is updated according to equation 1. If the stimulus is a word, X exceeding z is a true positive and X dropping below 0 is a false negative. If the stimulus is not a word, X exceeding z is a false positive and X dropping below 0 is a true negative.

To demonstrate the within-participant speed–accuracy trade-off, compute each participant’s mean reaction time for correct responses (true positives and true negatives) and their mean reaction time for incorrect responses (false positives and false negatives). Then compute a difference score by subtracting the mean reaction time for correct responses from the mean reaction time for incorrect responses. Thus each participant will have their own difference score. Do a t-test on these difference scores to demonstrate that they are on average greater than 0.

To demonstrate the between-participants speed–accuracy trade-off, compute each participant’s mean reaction time across all their 300 trials and their overall accuracy (where overall accuracy is computed as the number of true positives plus the number of true negatives divided by the total number of trials). Compute the correlation between mean reaction time across all trials and overall accuracy.

Outline questions

  1. How will you make sure there are 150 words and 150 non-words for eachparticipant? Note that you don’t have to have real stimuli anywhere in your code; you could just have a variable called stim type that would take on a value of either "word" or "nonword".
  2. How will you make sure a given participant has the same value of a for each trial and different values of z and A for each trial?
  3. How will you compute a participant’s mean reaction time?
  4. How will you figure out if a participant’s response on a given trial is a truepositive, true negative, false positive, or false negative?
  5. How will you collect participants’ difference scores, mean overall reactiontimes, and overall accuracies for later statistical analysis?

Hopfield network

A Hopfield network is a neural network model of memory where each neuron can be in one of two states. The state of each neuron is updated according to the input it receives from the other neurons such that the network settles into a low-energy pattern of neural states. The connections between the neurons are designed so that memories correspond to low-energy patterns of neural states and are likely to be retrieved.

Mathematically, the activity of the neurons are updated according the following equation:

                                                 (+1           if PNj=1u Wijsj > 0

                                             si                                     PNu Wijsj ≤ 0                                                    (2)

                                                    −1      if         j=1

where si is the state of neuron i, Wij is the strength of the connection between neurons i and j, Nu is the number of neurons, and sj is the state of neuron j. Thus

is the total input to neuron i from all the neurons. If this input is greater than 0, the state of neuron i will be set to +1; if not, it will be set to −1. The connections between neurons are set as follows:

(

                                                       p                    =1                            if i 6= j

Wij(3) 0    if i = j

where Np is the number of stored memories and

is the state of neuron i

 

when memory k is correctly retrieved.

To run the network, the states of the neurons are set to some initial values. All the neurons are updated, one at a time, according to equation 2. If any neuron changes its state (from −1 to 1 or vice versa), all the neurons are updated again. This process repeats until an entire round of updates goes by without any neuron changing its state. This entire process can be repeated many times for many different initial states of the neurons.

Create a network with 100 neurons. Then randomly generate 20 memories by setting

to +1 or −1 with equal probability, for i = 1,2,...,100 and k = 1,2,...,20 and set the connections between the neurons using these memories according to equation 3 above. Then perform the following simulation: for each memory k0, set the initial state of the network such that

 for all i. Then flip the state of the first neuron (from +1 to −1 or vice versa) so that the initial state doesn’t quite match the memory. Then repeatedly update the network according to equation 2 until an entire round of updates goes by without a change to any neuron’s state. Then test whether memory k0 was correctly retrieved—i.e., whether in the final state of the network, si = mki 0 for all i. Compute how many memories out of 20 the network is able to correctly retrieve.

Outline questions

  1. How will you store the states of the neurons such that you’ll be able toaccess the state of neuron according to its index i?
  2. How will you store the memories such that the state of neuron i when memory k is correctly retrieved will be accessible using the pair of indices k and i?
  3. How will you store the connections between neurons such that the connection between neuron i and neuron j will be accessible using the pair of indices i and j?
  4. How will you make sure the network stops updating once there are nochanges to the states of any of the neurons?
  5. How will you keep count of the number of memories the network correctlyretrieves?

Hodgkin–Huxley model

The Hodgin–Huxley model is a set of equations that describes the membrane voltage of an axon in response to externally applied current. It was designed to fit Hodgkin and Huxley’s observations of the squid giant axon and it won them a Nobel Prize. Although the original model was a set of differential equations (which are continuous-time), we will implement them here using the Euler method, which converts them to discrete-time difference equations.

Updates to the membrane voltage Vm depend on both the externally applied current and the currents through the various ion channels

where ?t is the time step (the time between successive updates to Vm),

Vm,t+?t is the value of Vm at the next time step, and Vm,t is the value of Vm at the current time step. I denotes electrical current and the subscript A denotes applied current, Na denotes sodium, K denotes potassium, and R denotes all other ions.

The current for a given ion, Ii (where i is Na, K, or R), is computed as

                                                          Ii = gi(Vm Vi)                                                               (4)

where gi is the conductance and Vi is the reversal potential for ion i. The conductances gi in turn depend on various constants and dimensionless quantities:

gK = ¯gKx4n,t+?t gNa = ¯gNax3m,t+?txh,t+?t

gR = ¯gR

where the various ¯g quantities are constants and the various x quantities change over time:

where xi,t+?t is the value of xi at the next time step, xi,t is the value of xi

at the current time step, and αi(Vm,t) and βi(Vm,t) are functions of Vm,t that are different for each i:

The reversal potentials are VK = 12, VNa = −115, and VR = −10.613; the g¯ constants are ¯gK = 36, ¯gNa = 120, and ¯gR = 0.3.

Note that there is a circular dependence among the variables, so they are updated in a certain order rather than all at once. First, the α and β variables are updated based on the previous value of Vm; then the x variables are updated; then the g variables; then the I variables; and finally Vm. t must also be incremented by ?t, but none of the equations explicitly depend on t, so it doesn’t matter where this happens. These updates repeat for as long as the model is intended to run.

Simulate the spiking of a neuron using ?t = 0.01. Start at t = −30 and Vm = 0, and initialize the x quantities as xn = 0, xm = 0, and xh = 1. Only record voltages (Vm) when t > 0 (since the difference equations take a little while to settle into an equilibrium state). For 50 < t < 100, set IA to −20. The rest of the time, set IA to 0. Stop updating the voltage when t ≥ 200.

Outline questions

  1. How will you record voltages such that they are stored in an orderedtemporal sequence?
  2. How will you ensure voltage is recorded only when t > 0?
  3. How will you ensure that IA is set to −20 and then back to 0 at the appropriate times?
  4. How will you update xn, xm, and xh such that you don’t have to write equation 5 more than once?
  5. How will you update INa, IK, and IR such that you don’t have to write equation 4 more than once?

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE