Skip to main content

LogLU Activation Function - PyTorch

Project description

Installation

pip install loglu-pytorch

Implementation

import torch
from loglu_pytorch import LogLU

# Define the model
class MyModel(nn.Module):
    def __init__(self):
        super(MyModel, self).__init__()
        self.fc1 = nn.Linear(784, 128)
        self.loglu = LogLU()        # <----- In This Way
        self.fc2 = nn.Linear(128, 10)

    def forward(self, x):
        x = self.fc1(x)
        x = self.loglu(x)
        x = self.fc2(x)
        return F.softmax(x, dim=1)  # Equivalent to 'softmax' activation in final layer

# Instantiate the model
model = MyModel()

# Print the model summary (you can use torchsummary for a detailed view)
from torchsummary import summary
summary(model, input_size=(1, 784))

License

LogLU_Pytorch is released under the Apache License 2.0.

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

loglu_pytorch-0.0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

loglu_pytorch-0.0.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file loglu_pytorch-0.0.1.tar.gz.

File metadata

  • Download URL: loglu_pytorch-0.0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for loglu_pytorch-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4b9ae15f8eab9c21e843080d8ed8af0b7c9eead283daaafefd058ef25c852d6e
MD5 0219ef7d628f08002e87c328a2537fa7
BLAKE2b-256 d44b6132daf21f031744b2bf1f43e25e816ea44e77719b566ebd0e58b8b17e07

See more details on using hashes here.

File details

Details for the file loglu_pytorch-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: loglu_pytorch-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for loglu_pytorch-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 487e3ac18d72a7069e8b86e13bf927705453f16ada8624327fb4571952a1285f
MD5 fc1bc2a672d4e1dc6a3c7db054011088
BLAKE2b-256 adec50ba029d0bbfc83b4b58f7d28af9e26cbc3ea2e77307f8bf31f5dd32d5e4

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