Ejemplo n.º 1
0
def build_visual_cortex():
	strengths = 1.0
	v1_strength = strengths*0.5
	v1_inhib = False
	print "strengths:%.5f"%strengths
	print "v1_strength:%.5f"%v1_strength
	print "v1_inhib:",v1_inhib
	print "--- Building Visual Cortex ---"
	c.start_timer()
	# retina.shape = (12,12)x
	# v1.shape = (14,14)x
	retina = RetinalLayer(36,36,'Retina') #emerg: 12x12
	v1 = c.Layer(168,168,'V1')#emerg: 14x14
	v4 = c.Layer(24,24,'V4')
	it = c.OutputLayer(10,10,'IT')
	c.print_timer("made layers")
	
	ret_v1_p = RetinaV1PositiveConnection(retina,v1,(12,12),strength=strengths,fixed=True)
	ret_v1_n = RetinaV1NegativeConnection(retina,v1,(12,12),strength=strengths,fixed=True)
	v1_v1 = c.FixedMountainConnection(v1,v1,(7,7),inhib=v1_inhib,strength=v1_strength) #emerg: 11x11
	v1_v4 = c.Connection(v1,v4,(12,12))
	v4_it = c.Connection(v4,it,None)
	it_v4 = c.Connection(it,v4,None)
	c.print_timer("made connections")
	
	network = c.Cortex([retina,v1,v4,it],[ret_v1_p,ret_v1_n,v1_v4,v4_it,it_v4],'Visual Cortex')
	network.print_structure()
	network.load_data()
	return network
Ejemplo n.º 2
0
def build_v1_cortex():
    strengths = 1.0  #0.526315789473684
    v1_strength = strengths * 0.5  #1.0/3.0
    v1_inhib = False
    print "strengths:%.5f" % strengths
    print "v1_strength:%.5f" % v1_strength
    print "v1_inhib:", v1_inhib
    print "--- Building Visual Cortex ---"
    c.start_timer()
    # retina.shape = (12,12)x
    # v1.shape = (14,14)x
    retina = RetinalLayer(12, 12, 'Retina')  #emerg: 12x12
    v1 = c.Layer(14, 14, 'V1')  #,k=0.3) #emerg: 14x14
    c.print_timer("made layers")

    ret_v1_p = RetinaV1PositiveConnection(retina,
                                          v1, (12, 12),
                                          strength=strengths)
    ret_v1_n = RetinaV1NegativeConnection(retina,
                                          v1, (12, 12),
                                          strength=strengths)
    v1_v1 = c.FixedMountainConnection(v1,
                                      v1, (11, 11),
                                      inhib=v1_inhib,
                                      strength=v1_strength)  #emerg: 11x11
    c.print_timer("made connections")

    network = c.Cortex([retina, v1], [ret_v1_p, ret_v1_n, v1_v1],
                       'Visual Cortex')
    network.print_structure()
    network.load_data('../data/v1 tests/weights/')
    return network
Ejemplo n.º 3
0
def build_visual_cortex():
    strengths = 1.0
    v1_strength = strengths * 0.5
    v1_inhib = False
    print "strengths:%.5f" % strengths
    print "v1_strength:%.5f" % v1_strength
    print "v1_inhib:", v1_inhib
    print "--- Building Visual Cortex ---"
    c.start_timer()
    # retina.shape = (12,12)x
    # v1.shape = (14,14)x
    retina = RetinalLayer(36, 36, 'Retina')  #emerg: 12x12
    v1 = c.Layer(168, 168, 'V1')  #emerg: 14x14
    v4 = c.Layer(24, 24, 'V4')
    it = c.OutputLayer(10, 10, 'IT')
    c.print_timer("made layers")

    ret_v1_p = RetinaV1PositiveConnection(retina,
                                          v1, (12, 12),
                                          strength=strengths,
                                          fixed=True)
    ret_v1_n = RetinaV1NegativeConnection(retina,
                                          v1, (12, 12),
                                          strength=strengths,
                                          fixed=True)
    v1_v1 = c.FixedMountainConnection(v1,
                                      v1, (7, 7),
                                      inhib=v1_inhib,
                                      strength=v1_strength)  #emerg: 11x11
    v1_v4 = c.Connection(v1, v4, (12, 12))
    v4_it = c.Connection(v4, it, None)
    it_v4 = c.Connection(it, v4, None)
    c.print_timer("made connections")

    network = c.Cortex([retina, v1, v4, it],
                       [ret_v1_p, ret_v1_n, v1_v4, v4_it, it_v4],
                       'Visual Cortex')
    network.print_structure()
    network.load_data()
    return network
Ejemplo n.º 4
0
def build_v1_cortex():
	strengths = 1.0#0.526315789473684
	v1_strength = strengths*0.5#1.0/3.0
	v1_inhib = False
	print "strengths:%.5f"%strengths
	print "v1_strength:%.5f"%v1_strength
	print "v1_inhib:",v1_inhib
	print "--- Building Visual Cortex ---"
	c.start_timer()
	# retina.shape = (12,12)x
	# v1.shape = (14,14)x
	retina = RetinalLayer(12,12,'Retina') #emerg: 12x12
	v1 = c.Layer(14,14,'V1')#,k=0.3) #emerg: 14x14
	c.print_timer("made layers")
	
	ret_v1_p = RetinaV1PositiveConnection(retina,v1,(12,12),strength=strengths)
	ret_v1_n = RetinaV1NegativeConnection(retina,v1,(12,12),strength=strengths)
	v1_v1 = c.FixedMountainConnection(v1,v1,(11,11),inhib=v1_inhib,strength=v1_strength) #emerg: 11x11
	c.print_timer("made connections")
	
	network = c.Cortex([retina,v1],[ret_v1_p,ret_v1_n,v1_v1],'Visual Cortex')
	network.print_structure()
	network.load_data('../data/v1 tests/weights/')
	return network