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.1""
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.1.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file featurelayers-1.2.1.tar.gz
.
File metadata
- Download URL: featurelayers-1.2.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40c9db008d02a34ef65f16010cc8c12d29953846626b127e72aaac5ad33650be |
|
MD5 | f7bea923013b354108f3f1439a8de124 |
|
BLAKE2b-256 | 8900acfdbead5afe072dfd139aef1b97d7ed25450c95e1fc398b1076b7660c35 |
File details
Details for the file featurelayers-1.2.1-py3-none-any.whl
.
File metadata
- Download URL: featurelayers-1.2.1-py3-none-any.whl
- Upload date:
- Size: 3.8 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 | 6d73c1617aefcae3dec1cdff20b0fd509f7cb1cf0947ae3741f9db8658a1c06c |
|
MD5 | b16b34b3d0f74e1453104f4c58f56a51 |
|
BLAKE2b-256 | ca03be23ee677e99510b9a82af12769b58546de328a6638787b770c314ecc8f6 |