Skip to main content

FeatureLayers Package

Project description

FeatureLayers

Installation

pip install featurelayers

Usage

LBC Layers

import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Flatten
from featurelayers.layers.LBC import LBC

# Create a simple Keras model
model = Sequential()
# Add the LBC layer as the first layer in the model
model.add(LBC(filters=32, kernel_size=3, stride=1, padding='same', activation='relu', sparsity=0.9, name='lbc_layer'))
# Add a Flatten layer to convert the output to 1D
model.add(Flatten())
# Add a Dense layer for classification
model.add(Dense(units=10, activation='softmax'))

# Compile the model
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])

# Generate some dummy data
x_train = np.random.rand(100, 28, 28, 1)
y_train = np.random.randint(0, 10, size=(100,))

# Convert the labels to one-hot encoding
y_train = keras.utils.to_categorical(y_train, num_classes=10)

# Train the model
model.fit(x_train, y_train, epochs=10, batch_size=32)

version = ""1.4.7""

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

featurelayers-1.4.7.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

featurelayers-1.4.7-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file featurelayers-1.4.7.tar.gz.

File metadata

  • Download URL: featurelayers-1.4.7.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for featurelayers-1.4.7.tar.gz
Algorithm Hash digest
SHA256 c957e72a6daeaeab0f8d7fb4c50b3de4ec7ceb5b22c3763b660de9ba0bc915ca
MD5 f3ca59253eafc509b107dc38075d72b8
BLAKE2b-256 43a6db5cad74c709a9b4f1c1ed68b21fa86ec7c928d916e3f38dfa2f6059e40c

See more details on using hashes here.

File details

Details for the file featurelayers-1.4.7-py3-none-any.whl.

File metadata

File hashes

Hashes for featurelayers-1.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bfe77ee666cc179e41cb68ba4d36521e3e6a7186a4051b46d9bdd938770b807c
MD5 566812eadc60df06b3b8a9abefed8b34
BLAKE2b-256 929f94bbe825e172dd5f42b2a1caa76bed1943e4526dac6148ceaece61949b1d

See more details on using hashes here.

Supported by

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