- Finish the Jets and Sharks network implementation from Lab 12. In your definition
of new-unit, include an extra state variable called
graphics-painter (initialized to #f), and add the following
two methods to new-unit:
(define method:get-painter
(lambda () graphics-painter))
(define method:set-painter
(lambda (painter)
(set! graphics-painter painter)
'ok))
These methods will enable you to use the simple user interface defined in the
file js-graphics.scm. Loading this file
into DrScheme will create a graphics window that displays the activations of
all units in the network (positive activations are shown in green, negative in
red). Put this file in the same folder as your Jets and Sharks program, and
then add the following line to the end of your code, after the section
that creates all of the network units and connections:
(load "js-graphics.scm")
-
This file also defines the following useful commands:
- (show-active) prints out all units with positive activations
- (show-clamped) prints out all clamped units
- (clamp unit1 unit2 ...) clamps the specified units
- (clear unit1 unit2 ...) unclamps the specified units
- (clear-all) unclamps all units in the network
- (reset-network) unclamps all units and resets their activations to the
resting level
- (run n) runs the network for n cycles
Perform the following test to make sure your network updates the
activations of all units correctly:
- (reset-network)
- (clamp ken)
- (run 100)
- (show-active)
The resulting activations should match the values shown below:
Sharks: 0.5064877987024132
H.S.: 0.5244301902932138
Single: 0.5064877987024132
Burglar: 0.3783457617251305
20s: 0.37822356300799614
30s: 0.005074536937235068
Ken: 0.8064494010682347
(pete): 0.03816710007054064
(fred): 0.03816710007054064
(nick): 0.23830693996726438
(ken): 0.6832206158490971
(earl): 0.038167100070540715
(rick): 0.03835619534961257
(neal): 0.23830693996726438
If your network generates the above values, you are ready to investigate the
properties of the memory model. Answer the following questions as clearly as
you can.
- Retrieving an individual from their name. After performing the test
in Part 2, why are some of Ken's properties more strongly activated than
others? None of the other name units are activated, yet several other
instance units are active. Why is this?
- Retrieval from a partial description. Ken can be uniquely described
by two properties: his gang and his age. Reset the network, then clamp the units
sharks and 20s. Run the network for 100 cycles. What are
the main differences between this state and the state at the end of
Part 2? Why do the occupation units show partial activations of units
other than Ken's occupation (Burglar)?
- Graceful degradation. To investigate the effect of erroneous
information in the probe supplied to the network, first run the network with
all of Ken's properties other than his name clamped. Then try it again with
junior-high clamped in place of high-school. How well does
the model do with the "noisy" version of Ken compared to the correct version?
Would it do this well with all noisy versions of individuals? Test with at
least one other individual, and explain what happens.
- Default assignment. Sometimes we don't know something about an
individual; for example, we may never have been exposed to the fact that Lance
is a burglar. Yet we are able to give plausible guesses about such missing
information. The network can do this too. To see this, we will erase the
network's explicit knowledge that Lance is a burglar by disabling the
connections between the instance unit for Lance and the Burglar unit. But
first we need a way to temporarily disable connections between units.
- Add methods to new-connection called disable and
restore, both of which take no arguments. Disable should set
the strength of the connection to 0; restore should set it back to its
original value.
- Add methods to new-unit called disable-connection-from
and restore-connection-from, both of which take another unit u
as an argument. These methods should scan the list of incoming connections for
one whose from-unit matches u (use the equal? test
here), and then either disable or restore the connection.
- For convenience, define the user interface commands (cut
unit1 unit2) and (restore unit1 unit2),
to make it easy to disable or restore the bi-directional connections between
unit1 and unit2.
Now run the network for 100 cycles with lance clamped, to see what
happens with all connections intact. Next, reset the network, disable the
connections between Lance's instance unit (instance-lance) and the
burglar unit, and run the network again for 100 cycles with
lance clamped. Was the network able to fill in Lance's occupation
correctly? What is the resulting activation level of the burglar unit
in each case?
- Spontaneous generalization. Now let's consider the network's ability to
retrieve appropriate generalizations over sets of individualsthat is, its
ability to answer questions like "What are Jets like?" or "What are people who
are in their 20s and have only a junior high education like?" (Note: Be sure to
restore the connections between burglar and instance-lance
before going on.) Ask the network to generalize about the Jets by clamping
the jets unit and cycling for 100 steps. What is the general profile
of a Jets gang member, according to the network? Next, ask it to generalize
about people in their 20s with a junior high education by clamping 20s
and junior-high. What can be said about the other properties of this
type of person, in general?