sparselinear · PyPI
https://pypi.org/project/sparselinear13.07.2020 · SparseLinear is a pytorch package that allows a user to create extremely wide and sparse linear layers efficiently. A sparsely connected network is a network where each node is connected to a fraction of available nodes. This differs from a fully connected network, where each node in one layer is connected to every node in the next layer.
torch.sparse — PyTorch 1.10.1 documentation
pytorch.org › docs › stableIn PyTorch, the fill value of a sparse tensor cannot be specified explicitly and is assumed to be zero in general. However, there exists operations that may interpret the fill value differently. For instance, torch.sparse.softmax () computes the softmax with the assumption that the fill value is negative infinity.
torch.sparse — PyTorch 1.10.1 documentation
https://pytorch.org/docs/stable/sparse.htmlConstruction¶. A sparse COO tensor can be constructed by providing the two tensors of indices and values, as well as the size of the sparse tensor (when it cannot be inferred from the indices and values tensors) to a function torch.sparse_coo_tensor(). Suppose we want to define a sparse tensor with the entry 3 at location (0, 2), entry 4 at location (1, 0), and entry 5 at location (1, 2).
Linear layer with local connections - PyTorch Forums
discuss.pytorch.org › t › linear-layer-with-localSep 14, 2020 · I want to implement linear regression in Pytorch with sparse connections. To build such a network I cannot use nn.Linear because it is a densely connected layer. I have first tried to make a binary matrix with 0’s and 1’s to indicate the presence and absence of connections. But it won’t work in my case because it is not computationally efficient. I am looking for a sparse weight matrix ...