I did indeed have a topology issue (I'd set up two layers both named input, and didn't get a conx-related error, which seems a bit unfortunate :-). Thanks for the pointer.

I was aware of the syntax you discuss below. The issue that made it difficult for me to just use that stuff was that bias is not treated as a connection. Personally, it would have been easier for me to get my head around some of this stuff had it not been treated differently in the API, as many text just refer to the bias units as the 0th input to a unit. :-)

--b

On Apr 24, 2007, at 11:12 AM, Douglas S. Blank wrote:

Belinda,

I don't think that a layer should be Undefined. Sounds like that layer hasn't been .connect() ed to another layer yet (when the layers get connected, there is logic there to determine if each of the layers are Input, Hidden, or Output types). Could there be a mistake in the topology?

FYI, there are bias units (aka, .weight[]) on Input and Context layers, even though they are not used.

Also, did you know that you can refer to weights with this syntax:

A single weight:

net["fromLayerName", "toLayerName"][fromPos][toPos]         
net["input", "hidden"][0][1]

and the entire matrix:

net["fromLayerName", "toLayerName"].weight  
net["input", "hidden"].weight

If none of these bits help, feel free to send me some code and I'll take a look at it.

-Doug

belinda thom wrote:
Hi,
I'd borrowed and then modified some code to store weights in a dictionary:
    for layer in layers:
        if layer.type != 'Input':
            for i in range(layer.size):
                debug_here()
                d['%s[%d][0]'%(layer.name[0:3],i+1)]=layer.weight[i]
    for connection in connections:
        for i in range(connection.fromLayer.size):
            for j in range(connection.toLayer.size):
d['%s[%d]%s[%d]'%(connection.fromLayer.name[0:3],i +1, \ connection.toLayer.name[0:3],j +1)] = connection.weight[i][j] w/the hope that putting these things in a dictionary would make the actual weight values easier to understand/explain in class. My plan was to have connection weights available via, e.g. d['inp [1]hid[1]'] where this would access the 1st input to 1st hidden unit weight. For biases, I would do, e.g. d['hid[1][0]'] which would access 1st hidden unit's bias. My problem is with the "if layer.type != 'Input'" check (part of the code I inherited), as I'm getting more bias weights than make sense. So I started poking around in the debugger and noticed an 'Undefined' layer type. What is this? I think its the thing that's producing, e.g. d['inp[1][0]'], where I would expect the input layers to have no useful bias.
Thanks,
--b
_______________________________________________
Pyro-users mailing list
[email protected]
http://emergent.brynmawr.edu/mailman/listinfo/pyro-users


_______________________________________________
Pyro-users mailing list
[email protected]
http://emergent.brynmawr.edu/mailman/listinfo/pyro-users

Reply via email to