示例#1
0
 def __init__(self, lower=True, inplace=False):
     self.lower = lower
     COp.__init__(self, ['c_code/magma_cholesky.c'],
                  'APPLY_SPECIFIC(magma_cholesky)')
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
示例#2
0
 def __init__(self, relu=False, inplace=False):
     COp.__init__(self, ["gemm16.c"], "gemm16")
     self.relu = relu
     # relu = True will require more work in optimizations.
     assert self.relu is False
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
示例#3
0
文件: nerv.py 项目: xzm2004260/Theano
 def __init__(self, relu=False, inplace=False):
     COp.__init__(self, ["gemm16.c"], "gemm16")
     self.relu = relu
     # relu = True will require more work in optimizations.
     assert self.relu is False
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
示例#4
0
 def __init__(self, inplace=False):
     theano_cuda_dir = os.path.dirname(theano.sandbox.cuda.__file__)
     COp.__init__(self, ["dnn_base.c", 
                     os.path.join(theano_cuda_dir,"dnn_conv_base.c"),
                     "dnn_gi.c"],
                  "APPLY_SPECIFIC(conv_gi)")
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [2]}
示例#5
0
 def __init__(self,  inplace=False):
     # TODELAY: reenable inplace optimizations http://deeplearning.net/software/theano/extending/inplace.html
     theano_cuda_dir = os.path.dirname(theano.sandbox.cuda.__file__)
     theano_files = ["dnn_base.c",
         os.path.join(theano_cuda_dir,"dnn_conv_base.c"),
         "dnn_fwd.c"]
     COp.__init__(self, theano_files,
                  "APPLY_SPECIFIC(conv_fwd)")
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [2]}
示例#6
0
    def __init__(self, mode='per-activation', epsilon=1e-4):

        if dnn_version() < (5000, 5000):
            raise RuntimeError("cuDNN Batch Normalization requires cuDNN v5")

        assert (mode in ('per-activation', 'spatial'))
        assert (epsilon >= 1e-5)

        fname = os.path.join(os.path.dirname(theano.sandbox.cuda.dnn.__file__),
                             "dnn_base.c")
        COp.__init__(self, fname)
        self.mode = mode
        self.epsilon = epsilon
示例#7
0
文件: dnn.py 项目: max8899/Theano
    def __init__(self, border_mode, subsample=(1, 1), conv_mode='conv'):
        COp.__init__(self, ["conv_desc.c"], "APPLY_SPECIFIC(conv_desc)")

        if isinstance(border_mode, int):
            border_mode = (border_mode, ) * len(subsample)
        if isinstance(border_mode, tuple):
            assert len(border_mode) == len(subsample)
            border_mode = tuple(map(int, border_mode))
        if not ((isinstance(border_mode, tuple) and min(border_mode) >= 0)
                or border_mode in ('valid', 'full')):
            raise ValueError('invalid border_mode {}, which must be either '
                             '"valid", "full", an integer or a pair of'
                             ' integers'.format(border_mode))
        self.border_mode = border_mode
        assert len(subsample) in (2, 3)
        self.subsample = subsample
        assert conv_mode in ('conv', 'cross')
        self.conv_mode = conv_mode
示例#8
0
文件: dnn.py 项目: hfinger/Theano
    def __init__(self, border_mode, subsample=(1, 1), conv_mode='conv'):
        COp.__init__(self, ["conv_desc.c"], "APPLY_SPECIFIC(conv_desc)")

        if isinstance(border_mode, int):
            border_mode = (border_mode,) * len(subsample)
        if isinstance(border_mode, tuple):
            assert len(border_mode) == len(subsample)
            border_mode = tuple(map(int, border_mode))
        if not ((isinstance(border_mode, tuple) and min(border_mode) >= 0) or
                border_mode in ('valid', 'full')):
            raise ValueError(
                'invalid border_mode {}, which must be either '
                '"valid", "full", an integer or a pair of'
                ' integers'.format(border_mode))
        self.border_mode = border_mode
        assert len(subsample) in (2, 3)
        self.subsample = subsample
        assert conv_mode in ('conv', 'cross')
        self.conv_mode = conv_mode
示例#9
0
文件: linalg.py 项目: devhliu/SAKE
 def __init__(self, full_matrices=True, compute_uv=True):
     self.full_matrices = full_matrices
     self.compute_uv = compute_uv
     COp.__init__(self, ['magma_svd.c'], 'APPLY_SPECIFIC(magma_svd)')
示例#10
0
 def __init__(self):
     COp.__init__(self, "./doublecop.c", "APPLY_SPECIFIC(doublecop)")
示例#11
0
文件: linalg.py 项目: Theano/Theano
 def __init__(self, UPLO='L', compute_v=True):
     assert UPLO in ['L', 'U']
     self.lower = UPLO == 'L'
     self.compute_v = compute_v
     COp.__init__(self, ['c_code/magma_eigh.c'], 'APPLY_SPECIFIC(magma_eigh)')
示例#12
0
文件: linalg.py 项目: Theano/Theano
 def __init__(self, lower=True, inplace=False):
     self.lower = lower
     COp.__init__(self, ['c_code/magma_cholesky.c'], 'APPLY_SPECIFIC(magma_cholesky)')
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
示例#13
0
文件: linalg.py 项目: Theano/Theano
 def __init__(self, full_matrices=True, compute_uv=True):
     self.full_matrices = full_matrices
     self.compute_uv = compute_uv
     COp.__init__(self, ['c_code/magma_svd.c'], 'APPLY_SPECIFIC(magma_svd)')
示例#14
0
 def __init__(self, inplace=False):
     COp.__init__(self, "c_code/blockgemv.c", "APPLY_SPECIFIC(blockgemv)")
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
 def __init__(self):
     COp.__init__(self, ["doublecop.c"], "APPLY_SPECIFIC(doublecop)")
示例#16
0
 def __init__(self, ...):
     COp.__init__(self, c_files, func_name)
示例#17
0
 def __init__(self):
     COp.__init__(self, ['GruOp.cu'],
             'APPLY_SPECIFIC(gated_unit_main_2)')
示例#18
0
 def __init__(self):
     COp.__init__(self, ["doublecop.c"],
                  "APPLY_SPECIFIC(doublecop)")
示例#19
0
 def __init__(self, inplace=False):
     COp.__init__(self, ["c_code/blockger.c"], "APPLY_SPECIFIC(blockger)")
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
示例#20
0
文件: linalg.py 项目: devhliu/SAKE
 def __init__(self, inplace=False):
     COp.__init__(self, ['magma_inv.c'], 'APPLY_SPECIFIC(magma_inv)')
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
示例#21
0
文件: dnn.py 项目: hfinger/Theano
 def __init__(self, files=None, c_func=None):
     if files is None:
         files = []
     COp.__init__(self, ["dnn_base.c"] + files, c_func)
示例#22
0
 def __init__(self, complete=True):
     self.complete = complete
     COp.__init__(self, ['c_code/magma_qr.c'], 'APPLY_SPECIFIC(magma_qr)')
示例#23
0
 def __init__(self, inplace=False):
     COp.__init__(self, ["blockger.c"], "APPLY_SPECIFIC(blockger)")
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
示例#24
0
 def __init__(self, UPLO='L', compute_v=True):
     assert UPLO in ['L', 'U']
     self.lower = UPLO == 'L'
     self.compute_v = compute_v
     COp.__init__(self, ['c_code/magma_eigh.c'],
                  'APPLY_SPECIFIC(magma_eigh)')
示例#25
0
 def __init__(self, inplace=False):
     COp.__init__(self, "blockgemv.c", "APPLY_SPECIFIC(blockgemv)")
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
示例#26
0
 def __init__(self, UPLO="L", compute_v=True):
     assert UPLO in ["L", "U"]
     self.lower = UPLO == "L"
     self.compute_v = compute_v
     COp.__init__(self, ["c_code/magma_eigh.c"], "APPLY_SPECIFIC(magma_eigh)")
示例#27
0
文件: linalg.py 项目: Theano/Theano
 def __init__(self, inplace=False):
     COp.__init__(self, ['c_code/magma_inv.c'], 'APPLY_SPECIFIC(magma_inv)')
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
示例#28
0
文件: dnn.py 项目: c0g/Theano
 def __init__(self):
     COp.__init__(self, "dnn_base.c")
示例#29
0
文件: linalg.py 项目: Theano/Theano
 def __init__(self, complete=True):
     self.complete = complete
     COp.__init__(self, ['c_code/magma_qr.c'], 'APPLY_SPECIFIC(magma_qr)')
示例#30
0
文件: dnn.py 项目: wanasit/Theano
 def __init__(self):
     COp.__init__(self, "dnn_base.c")
示例#31
0
 def __init__(self, full_matrices=True, compute_uv=True):
     self.full_matrices = full_matrices
     self.compute_uv = compute_uv
     COp.__init__(self, ["c_code/magma_svd.c"], "APPLY_SPECIFIC(magma_svd)")
示例#32
0
文件: dnn.py 项目: orhanf/Theano
 def __init__(self, files=None, c_func=None):
     if files is None:
         files = []
     COp.__init__(self, ["dnn_base.c"] + files, c_func)
示例#33
0
文件: dnn.py 项目: c0g/Theano
 def __init__(self):
     COp.__init__(self, ["dnn_base.c", "dnn_conv_base.c", "dnn_gi.c"],
                  "APPLY_SPECIFIC(conv_gi)")
示例#34
0
 def __init__(self, inplace=False):
     COp.__init__(self, ["c_code/magma_inv.c"], "APPLY_SPECIFIC(magma_inv)")
     self.inplace = inplace
     if self.inplace:
         self.destroy_map = {0: [0]}
示例#35
0
文件: dnn.py 项目: wanasit/Theano
 def __init__(self):
     COp.__init__(self, ["dnn_base.c", "dnn_conv_base.c", "dnn_gi.c"],
                  "APPLY_SPECIFIC(conv_gi)")
示例#36
0
 def __init__(self, complete=True):
     self.complete = complete
     COp.__init__(self, ["c_code/magma_qr.c"], "APPLY_SPECIFIC(magma_qr)")