cnn.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:photo-auto-balance 作者: starcolon 项目源码 文件源码
def predict(self,candidates):
    print(colored('Predicting {} samples...'.format(len(candidates)), 'green'))
    inputx     = [n.input_var for n in self.input_layers]
    output     = [layers.get_output(n) for n in self.nets] # Actual output
    gen_output = [theano.function([inputx[i]], output[i]) for i in range(len(self.nets))]
    vs = [gen_output[i](candidates) for i in range(len(self.nets))]
    vs = np.transpose(vs)

    # TAODEBUG: 
    print(vs[0])

    return vs[0]

  # NOTE: 
  # Sample of [save] / [load] of Lasagne CNN model
  # can be found at: 
  # https://github.com/Lasagne/Lasagne/blob/master/examples/mnist.py

  # def save(self, path):
  #   print(colored('Saving the models at {}'.format(path),'green'))
  #   i = 0
  #   for net in self.nets:
  #     print('...Saving {}'.format(path + str(i)))
  #     np.savez(path + str(i), *lasagne.layers.get_all_param_values(self.nets[i]))
  #     i += 1
  #   print('...Done')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号