FeatureLayers Package
Project description
FeatureLayers
Installation
pip install featurelayers
Usage
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.2.4""
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.2.4.tar.gz
(3.5 kB
view details)
Built Distribution
File details
Details for the file featurelayers-1.2.4.tar.gz
.
File metadata
- Download URL: featurelayers-1.2.4.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f450e8c5a6493a7f002c3fd5e382b9f461f39583922d9edfc497952da958f2f7 |
|
MD5 | 100207f899b2adec7bbb071179f770ed |
|
BLAKE2b-256 | b17f009f027d6e720c75739cc21c7bce60078791eb10a696c3aaf724c8305583 |
File details
Details for the file featurelayers-1.2.4-py3-none-any.whl
.
File metadata
- Download URL: featurelayers-1.2.4-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11088c5da4420e26b3b2ffae120db61c8f07c4a2ec91a186f96eddc5fe2dc662 |
|
MD5 | a495af2866dc9fd164ecce2ec7c35c03 |
|
BLAKE2b-256 | 49f3dd70cb4d71465f62c995fab81dc3e2e6eaca0e254b295e7b2f7584e79747 |