Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
zomux committed Nov 20, 2016
1 parent cf897ff commit ebaf5ff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion deepy/import_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from dataset import *
from deepy.tensor.functions import *
from layers import *
from multigpu import *
from networks import *
from trainers import *
from utils import *
Expand Down
13 changes: 11 additions & 2 deletions deepy/layers/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
# -*- coding: utf-8 -*-

from deepy.layers.layer import NeuralLayer

from deepy.core import graph

class Block(NeuralLayer):
"""
Create a block, which contains the parameters of many connected layers.
"""

_BLOCK_COUNT = 0

def __init__(self, name=None):
super(Block, self).__init__(name if name else "block")
super(Block, self).__init__(name if name else "block_{}".format(self._BLOCK_COUNT + 1))
self._BLOCK_COUNT += 1
self.layers = []
self.fixed = False

Expand All @@ -26,6 +29,12 @@ def fix(self):
self.register_inner_layers(layer)
self.fixed = True

def add_parameters(self, *parameters):
from deepy.core.neural_var import NeuralVariable
for param in parameters:
if isinstance(param, NeuralVariable):
param = param.tensor
self.parameters.append(param)

def register(self, *layers):
"""
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
numpy <= 1.10.4
theano <= 0.7.0
theano <= 0.8.1
scipy <= 0.17.0
filelock <= 2.0.6
git+https://github.com/mila-udem/platoon
filelock <= 2.0.6

0 comments on commit ebaf5ff

Please sign in to comment.