numpy_backend.py 528 Bytes
Newer Older
maming's avatar
maming committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import numpy as np
from keras import backend as K


def extract_image_patches(X, ksizes, strides,
                          padding='valid',
                          data_format='channels_first'):
    raise NotImplementedError


def depth_to_space(input, scale, data_format=None):
    raise NotImplementedError


def moments(x, axes, shift=None, keep_dims=False):
    mean_batch = np.mean(x, axis=tuple(axes), keepdims=keep_dims)
    var_batch = np.var(x, axis=tuple(axes), keepdims=keep_dims)
    return mean_batch, var_batch