Skip to main content

The remix and reactivate (RR) Block for PyTorch

Project description

Remix and Reactivate (RR)

The remix and reactivate (RR) Block official implementation for PyTorch.

Installation

You can install this package using pip:

pip install rr-block

Usage

Here is a simple example of how to use the RR block in your PyTorch model:

import torch
import torch.nn as nn
from rr_block import RR

class SimpleModel(nn.Module):
    def __init__(self, input_dim, output_dim):
        super(SimpleModel, self).__init__()
        self.fc1 = nn.Linear(input_dim, 128)
        self.rr = RR(128, [nn.ReLU(), nn.Sigmoid()])
        self.fc2 = nn.Linear(128, output_dim)

    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.rr(x)
        x = self.fc2(x)
        return x

Build and Development

To build the package from source, you can use the following commands:

pip install -e .

This will install the package in editable mode, allowing you to make changes to the source code and have them reflected in your Python environment.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rr_block-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rr_block-0.1.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file rr_block-0.1.1.tar.gz.

File metadata

  • Download URL: rr_block-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for rr_block-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9f0707615de2bc13ee368ba4633c42f5d7b4cc7a44307ff3c2cae40121712c71
MD5 a76684629650c88054ab5ba1e53159eb
BLAKE2b-256 f1e1a2b28464288689c987737bdd74b9a4648ab2a780dd76c9679a7da91e6024

See more details on using hashes here.

File details

Details for the file rr_block-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: rr_block-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for rr_block-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eca796dbad5ca5bde439787ebbe34661a31d6a43d0decdb584129a88461af092
MD5 4fa75b60a5d9751f1fcc1bcc58319b07
BLAKE2b-256 7f7bea379240cfba123ef97324372194f8636ac2d66b0d50736812f493a0b884

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page