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.9""
Project details
Release history Release notifications | RSS feed
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.9.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for featurelayers-1.4.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b4b7faad5226d37c358bf9bac947e9d3ccdbba9816ede1c8ce84f50a6a10d3f |
|
MD5 | c6d65a1139cfc59b4a7bc5fe8483a340 |
|
BLAKE2b-256 | 296aa56ae7ca944a62801fae4d19b0d341a4e0bef531767b6f80debe109cbd74 |