def build_model(self, input_dim):
        with open(os.environ['PYNET_SAVE_PATH'] + '/log/'
                    + self.state.hidden1.model + '/model.pkl') as f1:
            model1 = cPickle.load(f1)

        with open(os.environ['PYNET_SAVE_PATH'] + '/log/'
                    + self.state.hidden2.model + '/model.pkl') as f2:
            model2 = cPickle.load(f2)

        model = AutoEncoder(input_dim=input_dim)
        while len(model1.encode_layers) > 0:
            model.add_encode_layer(model1.pop_encode_layer())
        while len(model2.encode_layers) > 0:
            model.add_encode_layer(model2.pop_encode_layer())
        while len(model2.decode_layers) > 0:
            model.add_decode_layer(model2.pop_decode_layer())
        while len(model1.decode_layers) > 0:
            model.add_decode_layer(model1.pop_decode_layer())
        return model
dataset/ETHPy150Open hycis/Pynet/hps/deprecated/AE.py/Laura_Two_Layers.build_model/original