From rytting at ling.ohio-state.edu Mon Dec 19 14:22:48 2005 From: rytting at ling.ohio-state.edu (C. Anton Rytting) Date: Mon Dec 19 14:36:46 2005 Subject: [Pyro-developers] Proposed bug fix on conx.py (version 1.153) Message-ID: <20051219192248.GA11024@julius.ling.ohio-state.edu> to: pyro-developers@emergent.brynmawr.edu RE: Bug fix to conx.py (using symbolic names in MLPs) Dear Development team: I recently discovered a bug in conx.py revision 1.153 (though I believe this is also relevant to 1.154). I was trying to replicate some studies I had done in an SRN in an MLP format, while keeping the symbolic names I had chosen for my patterns. On doing this, I got the following exceptions raised: conx.LayerError: ('Mismatched activation size and layer size in call to copyActivations()', (3, 24)) (3 was the length of the symbolic name I was using for a 24-feature vector.) As it was clear that replacePatterns() was not being called correctly, I fixed this with the following change to conx.py: ##Change at lines 1353-1360: #old line layer.copyActivations(args[key]) self.copyActivations(layer, args[key]) elif layer.type == 'Output': #old line layer.copyTargets(args[key]) self.copyTargets(layer, args[key]) elif layer.type == 'Context': #old line layer.copyActivations(args[key]) self.copyActivations(layer, args[key]) else: raise LayerError, ('Unknown or incorrect layer type in step() method.', layer.name) #typo--inserted 'n' This changed fixed the problem for me, and my replication ran without further incident. However, I have not rigorously tested this new version to see if it breaks anything else. If you do discover any unfortunate or unintended consequences of this change, I would like to hear about it. In any event, I hope this information is helpful. Sincerely, -- ================================================================== C. Anton Rytting | "You must be the change The Ohio State University | you wish to see Department of Linguistics | in the world." Oxley Hall 222 | -- M.K. Gandhi 1712 Neil Avenue | Columbus OH 43210 | Tel: +614 292 7343 Email:rytting AT ling.osu.edu | Fax: +614 292 8833 ================================================================== From dblank at brynmawr.edu Mon Dec 19 16:26:13 2005 From: dblank at brynmawr.edu (dblank@brynmawr.edu) Date: Mon Dec 19 16:26:18 2005 Subject: [Pyro-developers] Proposed bug fix on conx.py (version 1.153) In-Reply-To: <20051219192248.GA11024@julius.ling.ohio-state.edu> References: <20051219192248.GA11024@julius.ling.ohio-state.edu> Message-ID: <54655.68.34.179.225.1135027573.squirrel@webmail.brynmawr.edu> Thanks! You're right, and that was subtle to see from just looking at the code. In effect "Network.copyActivations(layerObject, vector)" is not the same as "Layer.copyActivations(vector)" because of the additional check for patterns in the Network version. (We should probably make the Layer version less likely to be called by the user.) I'm not sure why we didn't catch that before, but thanks. I've made the changes to fix this, and the typo. I don't think that -Doug PS - some of the Conx code comes from our inspiration from The Ohio State University, specifically from Jordan Pollack's development of RAAM when he was there. Hope that you all find Conx useful there! > to: pyro-developers@emergent.brynmawr.edu > RE: Bug fix to conx.py (using symbolic names in MLPs) > > Dear Development team: > > I recently discovered a bug in conx.py revision 1.153 (though I > believe this is also relevant to 1.154). I was trying to replicate > some studies I had done in an SRN in an MLP format, while keeping the > symbolic names I had chosen for my patterns. On doing this, I got the > following exceptions raised: > > conx.LayerError: ('Mismatched activation size and layer size in call to > copyActivations()', (3, 24)) > > (3 was the length of the symbolic name I was using for a 24-feature > vector.) > > As it was clear that replacePatterns() was not being called correctly, > I fixed this with the following change to conx.py: > > ##Change at lines 1353-1360: > #old line layer.copyActivations(args[key]) > self.copyActivations(layer, args[key]) > elif layer.type == 'Output': > #old line layer.copyTargets(args[key]) > self.copyTargets(layer, args[key]) > elif layer.type == 'Context': > #old line layer.copyActivations(args[key]) > self.copyActivations(layer, args[key]) > else: > raise LayerError, ('Unknown or incorrect layer type in > step() method.', layer.name) #typo--inserted 'n' > > This changed fixed the problem for me, and my replication ran without > further incident. However, I have not rigorously tested this new > version to see if it breaks anything else. If you do discover any > unfortunate or unintended consequences of this change, I would like to > hear about it. In any event, I hope this information is helpful. > > Sincerely, > -- > ================================================================== > C. Anton Rytting | "You must be the change > The Ohio State University | you wish to see > Department of Linguistics | in the world." > Oxley Hall 222 | -- M.K. Gandhi > 1712 Neil Avenue | > Columbus OH 43210 | Tel: +614 292 7343 > Email:rytting AT ling.osu.edu | Fax: +614 292 8833 > ================================================================== From dblank at brynmawr.edu Mon Dec 19 16:32:57 2005 From: dblank at brynmawr.edu (dblank@brynmawr.edu) Date: Mon Dec 19 16:33:01 2005 Subject: [Pyro-developers] Proposed bug fix on conx.py (version 1.153) In-Reply-To: <54655.68.34.179.225.1135027573.squirrel@webmail.brynmawr.edu> References: <20051219192248.GA11024@julius.ling.ohio-state.edu> <54655.68.34.179.225.1135027573.squirrel@webmail.brynmawr.edu> Message-ID: <54672.68.34.179.225.1135027977.squirrel@webmail.brynmawr.edu> To finish the sentence from the previous post: I don't think that... this will effect any other conx processing. There may be one or two additional places where this same issue needs to be addressed. If you do run into the problem again, please let us know. We'll have to think a bit to see if we need to add the pattern replacement check at the Layer level too (or only there). -Doug > Thanks! You're right, and that was subtle to see from just looking at the > code. In effect "Network.copyActivations(layerObject, vector)" is not the > same as "Layer.copyActivations(vector)" because of the additional check > for patterns in the Network version. (We should probably make the Layer > version less likely to be called by the user.) > > I'm not sure why we didn't catch that before, but thanks. I've made the > changes to fix this, and the typo. I don't think that > > -Doug > > PS - some of the Conx code comes from our inspiration from The Ohio State > University, specifically from Jordan Pollack's development of RAAM when he > was there. Hope that you all find Conx useful there! > >> to: pyro-developers@emergent.brynmawr.edu >> RE: Bug fix to conx.py (using symbolic names in MLPs) >> >> Dear Development team: >> >> I recently discovered a bug in conx.py revision 1.153 (though I >> believe this is also relevant to 1.154). I was trying to replicate >> some studies I had done in an SRN in an MLP format, while keeping the >> symbolic names I had chosen for my patterns. On doing this, I got the >> following exceptions raised: >> >> conx.LayerError: ('Mismatched activation size and layer size in call to >> copyActivations()', (3, 24)) >> >> (3 was the length of the symbolic name I was using for a 24-feature >> vector.) >> >> As it was clear that replacePatterns() was not being called correctly, >> I fixed this with the following change to conx.py: >> >> ##Change at lines 1353-1360: >> #old line layer.copyActivations(args[key]) >> self.copyActivations(layer, args[key]) >> elif layer.type == 'Output': >> #old line layer.copyTargets(args[key]) >> self.copyTargets(layer, args[key]) >> elif layer.type == 'Context': >> #old line layer.copyActivations(args[key]) >> self.copyActivations(layer, args[key]) >> else: >> raise LayerError, ('Unknown or incorrect layer type in >> step() method.', layer.name) #typo--inserted 'n' >> >> This changed fixed the problem for me, and my replication ran without >> further incident. However, I have not rigorously tested this new >> version to see if it breaks anything else. If you do discover any >> unfortunate or unintended consequences of this change, I would like to >> hear about it. In any event, I hope this information is helpful. >> >> Sincerely, >> -- >> ================================================================== >> C. Anton Rytting | "You must be the change >> The Ohio State University | you wish to see >> Department of Linguistics | in the world." >> Oxley Hall 222 | -- M.K. Gandhi >> 1712 Neil Avenue | >> Columbus OH 43210 | Tel: +614 292 7343 >> Email:rytting AT ling.osu.edu | Fax: +614 292 8833 >> ================================================================== > > > _______________________________________________ > Pyro-developers mailing list > Pyro-developers@emergent.brynmawr.edu > http://emergent.brynmawr.edu/mailman/listinfo/pyro-developers >