文档¶
- 安装
- 软件架构
- 设备(Device)
- 张量(Tensor)
- PYTHON API
- class singa.tensor.Tensor(shape=None, device=None, dtype=0)
- T()
- add_column(v)
- add_row(v)
- bernoulli(p)
- clone()
- copy()
- copy_data(t)
- copy_from_numpy(np_array, offset=0)
- deepcopy()
- div_column(v)
- div_row(v)
- gaussian(mean, std)
- is_empty()
- is_transpose()
- l1()
- l2()
- memsize()
- mult_column(v)
- mult_row(v)
- ndim()
- reset_like(t)
- set_value(x)
- size()
- to_device(device)
- to_host()
- uniform(low, high)
- singa.tensor.abs(t)
- singa.tensor.add(lhs, rhs, ret=None)
- singa.tensor.add_column(alpha, v, beta, M)
- singa.tensor.add_row(alpha, v, beta, M)
- singa.tensor.average(t, axis=None)
- singa.tensor.axpy(alpha, x, y)
- singa.tensor.bernoulli(p, t)
- singa.tensor.copy_data_to_from(dst, src, size, dst_offset=0, src_offset=0)
- singa.tensor.div(lhs, rhs, ret=None)
- singa.tensor.eltwise_mult(lhs, rhs, ret=None)
- singa.tensor.exp(t)
- singa.tensor.from_numpy(np_array)
- singa.tensor.gaussian(mean, std, t)
- singa.tensor.ge(t, x)
- singa.tensor.gt(t, x)
- singa.tensor.le(t, x)
- singa.tensor.lt(t, x)
- singa.tensor.log(t)
- singa.tensor.mult(A, B, C=None, alpha=1.0, beta=0.0)
- singa.tensor.pow(t, x, out=None)
- singa.tensor.relu(t)
- singa.tensor.reshape(t, s)
- singa.tensor.sigmoid(t)
- singa.tensor.sign(t)
- singa.tensor.sizeof(dtype)
- singa.tensor.softmax(t, out=None)
- singa.tensor.sqrt(t)
- singa.tensor.square(t)
- singa.tensor.sub(lhs, rhs, ret=None)
- singa.tensor.sum(t, axis=None)
- singa.tensor.sum_columns(M)
- singa.tensor.sum_rows(M)
- singa.tensor.tanh(t)
- singa.tensor.to_host(t)
- singa.tensor.to_numpy(t)
- singa.tensor.uniform(low, high, t)
- class singa.tensor.Tensor(shape=None, device=None, dtype=0)
- PYTHON API
- 层(Layer)
- Python API
- singa.layer.engine = ‘cudnn’
- class singa.layer.Layer(name, conf=None, **kwargs)
- class singa.layer.Dummy(name, input_sample_shape=None)
- class singa.layer.Conv2D(name, nb_kernels, kernel=3, stride=1, border_mode=’same’, cudnn_prefer=’fatest’, data_format=’NCHW’, use_bias=True, W_specs=None, b_specs=None, pad=None, input_sample_shape=None)
- class singa.layer.Conv1D(name, nb_kernels, kernel=3, stride=1, border_mode=’same’, cudnn_prefer=’fatest’, use_bias=True, W_specs={‘init’: ‘Xavier’}, b_specs={‘init’: ‘Constant’, ‘value’: 0}, pad=None, input_sample_shape=None)
- class singa.layer.Pooling2D(name, mode, kernel=3, stride=2, border_mode=’same’, pad=None, data_format=’NCHW’, input_sample_shape=None)
- class singa.layer.MaxPooling2D(name, kernel=3, stride=2, border_mode=’same’, pad=None, data_format=’NCHW’, input_sample_shape=None)
- class singa.layer.AvgPooling2D(name, kernel=3, stride=2, border_mode=’same’, pad=None, data_format=’NCHW’, input_sample_shape=None)
- class singa.layer.MaxPooling1D(name, kernel=3, stride=2, border_mode=’same’, pad=None, data_format=’NCHW’, input_sample_shape=None)
- class singa.layer.AvgPooling1D(name, kernel=3, stride=2, border_mode=’same’, pad=None, data_format=’NCHW’, input_sample_shape=None)
- class singa.layer.BatchNormalization(name, momentum=0.9, beta_specs=None, gamma_specs=None, input_sample_shape=None)
- class singa.layer.LRN(name, size=5, alpha=1, beta=0.75, mode=’cross_channel’, k=1, input_sample_shape=None)
- class singa.layer.Dense(name, num_output, use_bias=True, W_specs=None, b_specs=None, W_transpose=False, input_sample_shape=None)
- class singa.layer.Dropout(name, p=0.5, input_sample_shape=None)
- class singa.layer.Activation(name, mode=’relu’, input_sample_shape=None)
- class singa.layer.Softmax(name, axis=1, input_sample_shape=None)
- class singa.layer.Flatten(name, axis=1, input_sample_shape=None)
- class singa.layer.Merge(name, input_sample_shape=None)
- class singa.layer.Split(name, num_output, input_sample_shape=None)
- class singa.layer.Concat(name, axis, input_sample_shapes=None)
- class singa.layer.Slice(name, axis, slice_point, input_sample_shape=None)
- class singa.layer.RNN(name, hidden_size, rnn_mode=’lstm’, dropout=0.0, num_stacks=1, input_mode=’linear’, bidirectional=False, param_specs=None, input_sample_shape=None)
- class singa.layer.LSTM(name, hidden_size, dropout=0.0, num_stacks=1, input_mode=’linear’, bidirectional=False, param_specs=None, input_sample_shape=None)
- class singa.layer.GRU(name, hidden_size, dropout=0.0, num_stacks=1, input_mode=’linear’, bidirectional=False, param_specs=None, input_sample_shape=None)
- Python API
- 前馈网络
- 初始化器(Initializer)
- 损失(Loss)
- 度量(Metric)
- 优化器(Optimizer)
- class singa.optimizer.Optimizer(lr=None, momentum=None, weight_decay=None, regularizer=None, constraint=None)
- class singa.optimizer.SGD(lr=None, momentum=None, weight_decay=None, regularizer=None, constraint=None)
- class singa.optimizer.Nesterov(lr=None, momentum=0.9, weight_decay=None, regularizer=None, constraint=None)
- class singa.optimizer.RMSProp(rho=0.9, epsilon=1e-08, lr=None, weight_decay=None, regularizer=None, constraint=None)
- class singa.optimizer.AdaGrad(epsilon=1e-08, lr=None, weight_decay=None, lr_gen=None, regularizer=None, constraint=None)
- class singa.optimizer.Adam(beta_1=0.9, beta_2=0.999, epsilon=1e-08, lr=None, weight_decay=None, regularizer=None, constraint=None)
- class singa.optimizer.Regularizer
- class singa.optimizer.CppRegularizer(conf)
- class singa.optimizer.L2Regularizer(coefficient)
- class singa.optimizer.Constraint
- class singa.optimizer.CppConstraint(conf)
- class singa.optimizer.L2Constraint(threshold=None)
- 数据(Data)
- 图像工具
- class singa.image_tool.ImageTool
- color_cast(offset=20, inplace=True)
- crop3(patch, num_case=1, inplace=True)
- crop5(patch, num_case=1, inplace=True)
- crop8(patch, num_case=1, inplace=True)
- enhance(scale=0.2, inplace=True)
- flip(num_case=1, inplace=True)
- num_augmentation()
- random_crop(patch, inplace=True)
- resize_by_list(size_list, num_case=1, inplace=True)
- resize_by_range(rng, inplace=True)
- rotate_by_list(angle_list, num_case=1, inplace=True)
- rotate_by_range(rng, inplace=True)
- singa.image_tool.color_cast(img, offset)
- singa.image_tool.crop(img, patch, position)
- singa.image_tool.crop_and_resize(img, patch, position)
- singa.image_tool.enhance(img, scale)
- singa.image_tool.load_img(path, grayscale=False)
- singa.image_tool.resize(img, small_size)
- class singa.image_tool.ImageTool
- Snapshot
- Utils
- 模型库