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.2.tar.gz (5.1 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.2-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rr_block-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 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.2.tar.gz
Algorithm Hash digest
SHA256 c729efd82d5f30181bc5b524320bead241d86b64a24a35d5ef33796a06ee016f
MD5 6810c1cd176820b0338f945c8bc221d5
BLAKE2b-256 c9a5da100d0e88b7367f25004d1fdc7617f846a6f692eec50a31a111789da88c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rr_block-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 87787f071acc24c779ee705f8507054379ffe0e5261a3ccfe63a4b810c3b02a3
MD5 0ae1641cb66754ab867915ef272fcbdb
BLAKE2b-256 cb86cead9b3b3f96e4b1596108e571c249fa3a921fdd146f3cc809fc22b6c11d

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