qualia2.functions package¶
Submodules¶
qualia2.functions.activation module¶
-
class
qualia2.functions.activation.
BReLU
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Bipolar rectified linear unit
-
class
qualia2.functions.activation.
ELU
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Exponential linear unit
-
class
qualia2.functions.activation.
Gaussian
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise Gaussian function
-
class
qualia2.functions.activation.
Identity
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Identity function
-
class
qualia2.functions.activation.
LeakyReLU
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Leaky rectified linear unit
-
class
qualia2.functions.activation.
ReLU
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Rectified linear unit
-
class
qualia2.functions.activation.
Sigmoid
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Sigmoid function
-
class
qualia2.functions.activation.
SoftMax
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
SoftMax function
-
class
qualia2.functions.activation.
SoftPlus
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
SoftPlus function
-
class
qualia2.functions.activation.
SoftSign
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
SoftSign function
qualia2.functions.array module¶
-
class
qualia2.functions.array.
Concat
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
concatenate given Tensors
qualia2.functions.complex module¶
-
class
qualia2.functions.complex.
CMSELoss
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
MSE Loss for complex neural networks
- Args:
input (Tensor): output of the network target (Tensor): label of the dataset reduce (bool): the losses are averaged or summed over observations for each minibatch depending on size_average. size_average (bool): the losses are averaged over each loss element in the batch.
- Model:
l_n = sum((y_n - x_n)^2/2)
- Shape:
Input: [N, C]
Target: [N, C]
- Output: [1] by default
[N] if not reduce
-
class
qualia2.functions.complex.
CReLU
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.complex.
CTanh
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise hyperbolic tangent function for complex neural networks
qualia2.functions.conv module¶
-
class
qualia2.functions.conv.
Conv1d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel, bias=None, stride=1, padding=1, dilation=1)[source]¶ Applies a 2D convolution over an input signal composed of several input planes.
- Args:
x (Tensor): Input tensor with shepe of [batch, channel, width]
kernel (Tensor): Kernel with shape of [patch, channel, kernel_width]
bias (Tensor): Bias with shape of [patch] to add if needed. Default: None
stride (int): Stride of the convolution. Default: 1
padding (int): Padding controls the amount of implicit zero-paddings on both sides for padding number of points for each dimension. Default: 1
dilation (int): Spacing between kernel elements. Default: 1
- Returns:
(Tensor): Output tensor will have shape of [batch, patch, out_width]
- Shape:
Input: [N, in_channels, W]
Output: [N, out_channels, W_out]
\(W_out = (W+2*padding-dilation*(kernel_size-1)-1)/stride+1\)
-
static
-
class
qualia2.functions.conv.
Conv2d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel, bias=None, stride=(1, 1), padding=(1, 1), dilation=(1, 1))[source]¶ Applies a 2D convolution over an input signal composed of several input planes.
- Args:
x (Tensor): Input tensor with shepe of [batch, channel, height, width]
kernel (Tensor): Kernel with shape of [patch, channel, kernel_height, kernel_width]
bias (Tensor): Bias with shape of [patch] to add if needed. Default: None
stride (tuple of int): Stride of the convolution. Default: (1,1)
padding (tuple of int): Padding controls the amount of implicit zero-paddings on both sides for padding number of points for each dimension. Default: (1,1)
dilation (tuple of int): Spacing between kernel elements. Default: (1,1)
- Returns:
(Tensor): Output tensor will have shape of [batch, patch, out_height, out_width]
- Shape:
Input: [N, in_channels, H, W]
Output: [N, out_channels, H_out, W_out]
:math:`H_out = (H+2*padding[0]-dilation[0]*(kernel_size[0]-1)-1)/stride[0]+1 ` :math:`W_out = (W+2*padding[1]-dilation[1]*(kernel_size[1]-1)-1)/stride[1]+1 `
-
static
-
class
qualia2.functions.conv.
Conv3d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel, bias=None, stride=(1, 1, 1), padding=(1, 1, 1), dilation=(1, 1, 1))[source]¶ Applies a 3D convolution over an input signal composed of several input planes.
- Args:
x (Tensor): Input tensor with shepe of [batch, channel, height, width, depth]
kernel (Tensor): Kernel with shape of [patch, channel, kernel_height, kernel_width, kernel_depth]
bias (Tensor): Bias with shape of [patch] to add if needed. Default: None
stride (tuple of int): Stride of the convolution. Default: (1,1,1)
padding (tuple of int): Padding controls the amount of implicit zero-paddings on both sides for padding number of points for each dimension. Default: (1,1,1)
dilation (tuple of int): Spacing between kernel elements. Default: (1,1,1)
- Returns:
(Tensor): Output tensor will have shape of [batch, patch, out_height, out_width, out_depth]
- Shape:
Input: [N, in_channels, H, W, D]
Output: [N, out_channels, H_out, W_out, D_out]
\(H_out = (H+2*padding[0]-dilation[0]*(kernel_size[0]-1)-1)/stride[0]+1\) \(W_out = (W+2*padding[1]-dilation[1]*(kernel_size[1]-1)-1)/stride[1]+1\) \(D_out = (D+2*padding[2]-dilation[2]*(kernel_size[2]-1)-1)/stride[2]+1\)
-
static
-
class
qualia2.functions.conv.
ConvTranspose1d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel, bias=None, stride=1, padding=1, output_padding=0, dilation=1)[source]¶ Applies a 1D transposed convolution over an input signal composed of several input planes.
- Args:
x (Tensor): Input tensor with shepe of [batch, channel, height]
kernel (Tensor): Kernel with shape of [channel, patch, kernel_height]
bias (Tensor): Bias with shape of [patch] to add if needed. Default: None
stride (tuple of int): Stride of the convolution. Default: 1
padding (tuple of int): Zero-padding added to both sides of the input. Default: 1
output_padding (tuple of int): Zero-padding added to both sides of the output. Default: 0
dilation (tuple of int): Spacing between kernel elements. Default: 1
- Shape:
Input: [N, in_channels, H]
Output: [N, out_channels, H_out]
\(H_out = (H-1)*stride[0]-2*padding[0]+dilation[0]*(kernel_size[0]-1)+1+output_padding[0]\)
- Reference:
-
static
-
class
qualia2.functions.conv.
ConvTranspose2d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel, bias=None, stride=(1, 1), padding=(1, 1), output_padding=(0, 0), dilation=(1, 1))[source]¶ Applies a 2D transposed convolution over an input signal composed of several input planes.
- Args:
x (Tensor): Input tensor with shepe of [batch, channel, height, width]
kernel (Tensor): Kernel with shape of [channel, patch, kernel_height, kernel_width]
bias (Tensor): Bias with shape of [patch] to add if needed. Default: None
stride (tuple of int): Stride of the convolution. Default: (1,1)
padding (tuple of int): Zero-padding added to both sides of the input. Default: (1,1)
output_padding (tuple of int): Zero-padding added to both sides of the output. Default: (0,0)
dilation (tuple of int): Spacing between kernel elements. Default: (1,1)
- Shape:
Input: [N, in_channels, H, W]
Output: [N, out_channels, H_out, W_out]
\(H_out = (H-1)*stride[0]-2*padding[0]+dilation[0]*(kernel_size[0]-1)+1+output_padding[0]\) \(W_out = (W-1)*stride[1]-2*padding[1]+dilation[1]*(kernel_size[1]-1)+1+output_padding[1]\)
- Reference:
-
static
-
class
qualia2.functions.conv.
ConvTranspose3d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel, bias=None, stride=(1, 1, 1), padding=(1, 1, 1), output_padding=(0, 0, 0), dilation=(1, 1, 1))[source]¶ Applies a 2D transposed convolution over an input signal composed of several input planes.
- Args:
x (Tensor): Input tensor with shepe of [batch, channel, height, width, depth]
kernel (Tensor): Kernel with shape of [channel, patch, kernel_height, kernel_width, kernel_depth]
bias (Tensor): Bias with shape of [patch] to add if needed. Default: None
stride (tuple of int): Stride of the convolution. Default: (1,1,1)
padding (tuple of int): Zero-padding added to both sides of the input. Default: (1,1,1)
output_padding (tuple of int): Zero-padding added to both sides of the output. Default: (0,0,0)
dilation (tuple of int): Spacing between kernel elements. Default: (1,1,1)
- Shape:
Input: [N, in_channels, H, W, D]
Output: [N, out_channels, H_out, W_out, D_out]
\(H_out = (H-1)*stride[0]-2*padding[0]+dilation[0]*(kernel_size[0]-1)+1+output_padding[0]\) \(W_out = (W-1)*stride[1]-2*padding[1]+dilation[1]*(kernel_size[1]-1)+1+output_padding[1]\) \(D_out = (D-1)*stride[2]-2*padding[2]+dilation[2]*(kernel_size[2]-1)+1+output_padding[2]\)
- Reference:
-
static
qualia2.functions.distance module¶
qualia2.functions.dropout module¶
-
class
qualia2.functions.dropout.
Dropout
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, p=0.5, training=True)[source]¶ During training, randomly zeroes some of the elements of the input tensor with probability p using samples from a Bernoulli distribution. Each channel will be zeroed out independently on every forward call. Args:
x (Tensor): Input tensor with any shepe p (float): probability that randomly zeroes some of the elements of the input tensor training (bool): True if the model is in training
-
static
qualia2.functions.linear_algebra module¶
-
class
qualia2.functions.linear_algebra.
Dot
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.linear_algebra.
Linear
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
qualia2.functions.loss module¶
-
class
qualia2.functions.loss.
BinaryCrossEntropy
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Creates a criterion that measures the Binary Cross Entropy between the target and the output
- Args:
input (Tensor): output of the network target (Tensor): label of the dataset reduce (bool): the losses are averaged or summed over observations for each minibatch depending on size_average. size_average (bool): the losses are averaged over each loss element in the batch.
- Model:
l_n = -y_n*log(x_n)-(1-y_n)*log(1-x_n)
- Shape:
Input: [N, 1]
Target: [N, 1]
- Output: [1] by default
[N] if not reduce
-
class
qualia2.functions.loss.
CrossEntropy
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
‘Creates a criterion that measures the Cross Entropy between the target and the output
- Args:
input (Tensor): output of the network target (Tensor): one-hot representation of label for the dataset reduce (bool): the losses are averaged or summed over observations for each minibatch depending on size_average. size_average (bool): the losses are averaged over each loss element in the batch.
- Model:
l_n = -sum_over_classes(y_n*log(x_n))
- Shape:
Input: [N, num_class]
Target: [N, num_class]
- Output: [1] by default
[N] if not reduce
-
class
qualia2.functions.loss.
HuberLoss
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
- Args:
input (Tensor): output of the network target (Tensor): label of the dataset reduce (bool): the losses are averaged or summed over observations for each minibatch depending on size_average. size_average (bool): the losses are averaged over each loss element in the batch.
- Model:
- l_n = sum((y_n - x_n)^2/2) for |y_n - x_n| < 1
sum(|y_n - x_n|) otherwise
- Shape:
Input: [N, C]
Target: [N, C]
- Output: [1] by default
[N] if not reduce
-
class
qualia2.functions.loss.
LogisticBinaryCrossEntropy
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Creates a criterion that measures the Binary Cross Entropy between the target and the logistic of output
- Args:
input (Tensor): output of the network target (Tensor): label of the dataset reduce (bool): the losses are averaged or summed over observations for each minibatch depending on size_average. size_average (bool): the losses are averaged over each loss element in the batch.
- Model:
l_n = y_n*log(1+exp(-x_n))+(1-y_n)*log(1+exp(x_n))
- Shape:
Input: [N, 1]
Target: [N, 1]
- Output: [1] by default
[N] if not reduce
-
class
qualia2.functions.loss.
MSELoss
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
- Args:
input (Tensor): output of the network target (Tensor): label of the dataset reduce (bool): the losses are averaged or summed over observations for each minibatch depending on size_average. size_average (bool): the losses are averaged over each loss element in the batch.
- Model:
l_n = sum((y_n - x_n)^2/2)
- Shape:
Input: [N, C]
Target: [N, C]
- Output: [1] by default
[N] if not reduce
-
class
qualia2.functions.loss.
SoftmaxCrossEntropy
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
‘Creates a criterion that measures the Cross Entropy between the target and the softmax of output
- Args:
input (Tensor): output of the network target (Tensor): one-hot representation of label for the dataset reduce (bool): the losses are averaged or summed over observations for each minibatch depending on size_average. size_average (bool): the losses are averaged over each loss element in the batch.
- Model:
l_n = -sum_over_classes(y_n*log(softmax(x_n)))
- Shape:
Input: [N, num_class]
Target: [N, num_class]
- Output: [1] by default
[N] if not reduce
qualia2.functions.normalize module¶
-
class
qualia2.functions.normalize.
BatchNorm
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, mean, std, weight, bias, axis, eps=1e-05)[source]¶ Applies Batch Normalization for each channel across a batch of data.
- Args:
x (Tensor): input tensor. mean (ndarray): running mean of the input tensor. std (ndarray): running std of the input tensor. weight (Tensor): weight to apply. bias (Tensor): bias to apply. axis (list): axis indicates the all the axis in the input except C dimention eps (float): a value added to the denominator for numerical stability.
- Shape:
Input: [N,C,*]
Output: [N,C,*]
-
static
qualia2.functions.pool module¶
-
class
qualia2.functions.pool.
AvePool1d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel_width=2, stride=2, padding=0, dilation=1)[source]¶ Applies a 1D average pooling over an input signal composed of several input planes.
- Args:
kernel_size (int): the size of the window to take a max over stride (int): the stride of the window. Default value is kernel_size padding (int): implicit zero padding to be added on all three sides dilation (int): a parameter that controls the stride of elements in the window
- Shape:
Input: [N,C,W]
Output: [N,C,W_out]
W_out = (W+2*padding-dilation*(kernel_width-1)-1)/stride + 1
-
static
-
class
qualia2.functions.pool.
AvePool2d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel_size=(2, 2), stride=(2, 2), padding=(0, 0), dilation=(1, 1))[source]¶ Applies a 2D average pooling over an input signal composed of several input planes.
- Args:
kernel_size (tuple of int): the size of the window to take a max over stride (tuple of int): the stride of the window. Default value is kernel_size padding (tuple of int): implicit zero padding to be added on all three sides dilation (tuple of int): a parameter that controls the stride of elements in the window
- Shape:
Input: [N,C,H,W]
Output: [N,C,H_out,W_out]
H_out = (H+2*padding[0]-dilation[0]*(kernel_size[0]-1)-1)/stride[0] + 1 W_out = (W+2*padding[1]-dilation[1]*(kernel_size[1]-1)-1)/stride[1] + 1
-
static
-
class
qualia2.functions.pool.
AvePool3d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel_size=(2, 2, 2), stride=(2, 2, 2), padding=(0, 0, 0), dilation=(1, 1, 1))[source]¶ Applies a 3D max pooling over an input signal composed of several input planes.
- Args:
kernel_size (tuple of int): the size of the window to take a max over stride (tuple of int): the stride of the window. Default value is kernel_size padding (tuple of int): implicit zero padding to be added on all three sides dilation (tuple of int): a parameter that controls the stride of elements in the window
- Shape:
Input: [N,C,H,W,D]
Output: [N,C,H_out,W_out,D_out]
H_out = (H+2*padding[0]-dilation[0]*(kernel_size[0]-1)-1)/stride[0] + 1 W_out = (W+2*padding[1]-dilation[1]*(kernel_size[1]-1)-1)/stride[1] + 1 D_out = (D+2*padding[2]-dilation[2]*(kernel_size[2]-1)-1)/stride[2] + 1
-
static
-
class
qualia2.functions.pool.
GlobalAvePool1d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.pool.
GlobalAvePool2d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.pool.
GlobalAvePool3d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.pool.
MaxPool1d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel_width=2, stride=2, padding=0, dilation=1, return_indices=False)[source]¶ Applies a 1D max pooling over an input signal composed of several input planes.
- Args:
kernel_size (int): the size of the window to take a max over stride (int): the stride of the window. Default value is kernel_size padding (int): implicit zero padding to be added on all three sides dilation (int): a parameter that controls the stride of elements in the window return_indices (bool): if True, will return the max indices along with the outputs.
- Shape:
Input: [N,C,W]
Output: [N,C,W_out]
W_out = (W+2*padding-dilation*(kernel_width-1)-1)/stride + 1
-
static
-
class
qualia2.functions.pool.
MaxPool2d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, kernel_size=(2, 2), stride=(2, 2), padding=(0, 0), dilation=(1, 1), return_indices=False)[source]¶ Applies a 2D max pooling over an input signal composed of several input planes.
- Args:
kernel_size (tuple of int): the size of the window to take a max over stride (tuple of int): the stride of the window. Default value is kernel_size padding (tuple of int): implicit zero padding to be added on all three sides dilation (tuple of int): a parameter that controls the stride of elements in the window return_indices (bool): if True, will return the max indices along with the outputs.
- Shape:
Input: [N,C,H,W]
Output: [N,C,H_out,W_out]
H_out = (H+2*padding[0]-dilation[0]*(kernel_size[0]-1)-1)/stride[0] + 1 W_out = (W+2*padding[1]-dilation[1]*(kernel_size[1]-1)-1)/stride[1] + 1
-
static
-
class
qualia2.functions.pool.
MaxPool3d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
fold
(delta, kernel_size, argmax, oh, ow, od, x_shape, padded_shape, stride, dilation)[source]¶
-
static
forward
(x, kernel_size=(2, 2, 2), stride=(2, 2, 2), padding=(0, 0, 0), dilation=(1, 1, 1), return_indices=False)[source]¶ Applies a 3D max pooling over an input signal composed of several input planes.
- Args:
kernel_size (tuple of int): the size of the window to take a max over stride (tuple of int): the stride of the window. Default value is kernel_size padding (tuple of int): implicit zero padding to be added on all three sides dilation (tuple of int): a parameter that controls the stride of elements in the window return_indices (bool): if True, will return the max indices along with the outputs.
- Shape:
Input: [N,C,H,W,D]
Output: [N,C,H_out,W_out,D_out]
H_out = (H+2*padding[0]-dilation[0]*(kernel_size[0]-1)-1)/stride[0] + 1 W_out = (W+2*padding[1]-dilation[1]*(kernel_size[1]-1)-1)/stride[1] + 1 D_out = (D+2*padding[2]-dilation[2]*(kernel_size[2]-1)-1)/stride[2] + 1
-
static
-
class
qualia2.functions.pool.
MaxUnpool1d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, indices, kernel_size=2, stride=2, padding=0, dilation=1)[source]¶ Computes a partial inverse of MaxPool2d. Args:
x (Tensor): the input Tensor to invertc indices (ndarray): the indices given out by MaxPool2d kernel_size (tuple of int): the size of the window to take a max over stride (tuple of int): the stride of the window. Default value is kernel_size padding (tuple of int): implicit zero padding to be added on all three sides dilation (tuple of int): a parameter that controls the stride of elements in the window
- Shape:
Input: [N,C,W]
Output: [N,C,W_out]
W_out = (W-1)*stride+dilation*(kernel_size-1)+1-2*padding
-
static
-
class
qualia2.functions.pool.
MaxUnpool2d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, indices, kernel_size=(2, 2), stride=(2, 2), padding=(0, 0), dilation=(1, 1))[source]¶ Computes a partial inverse of MaxPool2d. Args:
x (Tensor): the input Tensor to invertc indices (ndarray): the indices given out by MaxPool2d kernel_size (tuple of int): the size of the window to take a max over stride (tuple of int): the stride of the window. Default value is kernel_size padding (tuple of int): implicit zero padding to be added on all three sides dilation (tuple of int): a parameter that controls the stride of elements in the window
- Shape:
Input: [N,C,H,W]
Output: [N,C,H_out,W_out]
H_out = (H-1)*stride[0]+dilation[0]*(kernel_size[0]-1)+1-2*padding[0] W_out = (W-1)*stride[1]+dilation[1]*(kernel_size[1]-1)+1-2*padding[1]
-
static
-
class
qualia2.functions.pool.
MaxUnpool3d
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, indices, kernel_size=(2, 2, 2), stride=(2, 2, 2), padding=(0, 0, 0), dilation=(1, 1, 1))[source]¶ Computes a partial inverse of MaxPool2d. Args:
x (Tensor): the input Tensor to invertc indices (ndarray): the indices given out by MaxPool2d kernel_size (tuple of int): the size of the window to take a max over stride (tuple of int): the stride of the window. Default value is kernel_size padding (tuple of int): implicit zero padding to be added on all three sides dilation (tuple of int): a parameter that controls the stride of elements in the window
- Shape:
Input: Input: [N,C,H,W,D]
Output: [N,C,H_out,W_out,D_out]
H_out = (H-1)*stride[0]+dilation[0]*(kernel_size[0]-1)+1-2*padding[0] W_out = (W-1)*stride[1]+dilation[1]*(kernel_size[1]-1)+1-2*padding[1] D_out = (D-1)*stride[2]+dilation[2]*(kernel_size[2]-1)+1-2*padding[2]
-
static
qualia2.functions.recurrent module¶
-
class
qualia2.functions.recurrent.
GRU
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.recurrent.
GRUCell
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.recurrent.
LSTM
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.recurrent.
LSTMCell
(output_shape_h, output_shape_c, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
static
forward
(x, h, c, weight_x, weight_h, bias_x, bias_h)[source]¶ - Shape:
x: [N, input_size]
h: [N, hidden_size]
c: [N, hidden_size]
weight_x: [input_size, 4*hidden_size]
weight_h: [hidden_size, 4*hidden_size]
bias_x: [4*hidden_size]
bias_h: [4*hidden_size]
Output_h: [N, hidden_size]
Output_c: [N, hidden_size]
-
static
-
class
qualia2.functions.recurrent.
RNN
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.recurrent.
RNNCell
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
qualia2.functions.sparse module¶
-
class
qualia2.functions.sparse.
Embedding
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
qualia2.functions.trigonometric module¶
-
class
qualia2.functions.trigonometric.
Arccos
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise inverse-cosine function
-
class
qualia2.functions.trigonometric.
Arccosh
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise inverse of hyperbolic cosine function
-
class
qualia2.functions.trigonometric.
Arcsin
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise inverse-sine function
-
class
qualia2.functions.trigonometric.
Arcsinh
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise inverse of hyperbolic sine function
-
class
qualia2.functions.trigonometric.
Arctan
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise inverse-tangent function
-
class
qualia2.functions.trigonometric.
Arctanh
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise inverse of hyperbolic tangent function
-
class
qualia2.functions.trigonometric.
Cos
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise cosine function
-
class
qualia2.functions.trigonometric.
Cosh
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise hyperbolic cosine function
-
class
qualia2.functions.trigonometric.
Sin
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise sine function
-
class
qualia2.functions.trigonometric.
Sinc
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.trigonometric.
Sinh
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise hyperbolic sine function
-
class
qualia2.functions.trigonometric.
Tan
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
Elementwise tangent function
qualia2.functions.ufunc module¶
-
class
qualia2.functions.ufunc.
Amax
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.ufunc.
Amin
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.ufunc.
Cbrt
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.ufunc.
Exp
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.ufunc.
Log
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.ufunc.
Log10
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.ufunc.
Maximum
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.ufunc.
Mean
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.ufunc.
Minimum
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function
-
class
qualia2.functions.ufunc.
Sqrt
(output_shape, *args, **kwargs)[source]¶ Bases:
qualia2.autograd.Function