# HG changeset patch # User Xavier Glorot # Date 1248796207 14400 # Node ID 5e3b7dd6f96a9a7dc138eb0c80c4735ef1f23030 # Parent 86b007959ceb239beaf4aa738f21e7d69f6c7d20 load mecanism no Tie model from Tie model for DAA_input_groups diff -r 86b007959ceb -r 5e3b7dd6f96a pylearn/algorithms/sandbox/DAA_inputs_groups.py --- a/pylearn/algorithms/sandbox/DAA_inputs_groups.py Tue Jul 28 10:07:01 2009 -0400 +++ b/pylearn/algorithms/sandbox/DAA_inputs_groups.py Tue Jul 28 11:50:07 2009 -0400 @@ -55,6 +55,8 @@ def PCAinit(data,nhid): pass +#----------------------------------------------------------------- + # Initialize containers: class CreateContainer: pass @@ -776,10 +778,18 @@ if not self.daaig[i].tie_weights: if self.daaig[i].auxinput is not None: for j in range(len(inst.daaig[i].wauxdec)): - inst.daaig[i].wauxdec[j] = load_mat('wauxdec%s_%s.ft'%(i,j),save_dir)/coefdec[i] + if 'wauxdec%s_%s.ft'%(i,j) in os.listdir(save_dir): + inst.daaig[i].wauxdec[j] = load_mat('wauxdec%s_%s.ft'%(i,j),save_dir)/coefdec[i] + else: + print "WARNING: no decoding 'wauxdec%s_%s.ft' file use 'wauxenc%s_%s.ft' instead"%(i,j,i,j) + inst.daaig[i].wauxdec[j] = numpy.transpose(load_mat('wauxenc%s_%s.ft'%(i,j),save_dir)/coefdec[i]) if self.daaig[i].input is not None: - inst.daaig[i].wdec = load_mat('wdec%s.ft'%(i),save_dir)/coefdec[i] + if 'wdec%s.ft'%(i) in os.listdir(save_dir): + inst.daaig[i].wdec = load_mat('wdec%s.ft'%(i),save_dir)/coefdec[i] + else: + print "WARNING: no decoding 'wdec%s.ft' file use 'wenc%s.ft' instead"%(i,i) + inst.daaig[i].wdec = numpy.transpose(load_mat('wenc%s.ft'%(i),save_dir)/coefdec[i]) i=i+1 if Sup_layer is None: inst.daaig[i].w = load_mat('wenc%s.ft'%(i),save_dir)