Menu

Module providing Consciousness Exploration Tools for PyTorch.

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.

class consciousnet.models.distributions.ConditionalCategorical(input_dim, final_dim, dense_hidden_dims=None, temperature=1.0, hidden_activation_fn=<class 'torch.nn.modules.activation.ReLU'>, dropout=0)[source]

A relaxed one hot Categorical distribution conditioned on inputs via a dense network.

__init__(input_dim, final_dim, dense_hidden_dims=None, temperature=1.0, hidden_activation_fn=<class 'torch.nn.modules.activation.ReLU'>, dropout=0)[source]

Init class.

Parameters

input_dim : int

the input size.

final_dim : int

the dimension of the random variable.

dense_hidden_dims : list of int, default None

the sizes of the hidden layers of the fully connected network used to condition the distribution on the inputs. If None, then the default is a single-layered dense network.

temperature : float, default 1

degree of how approximately discrete the distribution is. The closer to 0, the more discrete and the closer to infinity, the more uniform.

hidden_activation_fn : @callable, default relu

the activation function to use on the hidden layers of the fully connected network.

dropout : float, default 0

define the dropout rate.

forward(tensor_list)[source]

Creates a RelaxedOneHotCategorical distribution conditioned on the inputs.

Parameters

tensor_list : list of torch.Tensor

a list of tensors that will be first concatenatedd on the last dimension.

Follow us

© 2021, consciousnet developers