Skip to main content

deepmeta: Deep Meta Learning

This package implements deep meta learning algorithms.

Usage Example

import numpy as np
from tensorflow.keras import layers, models
from deepmeta import MAML

# Define a deep-network model
input_shape = (28, 28, 1)
category_count = 10
model = models.Sequential([
    layers.Conv2D(32, kernel_size=(3, 3), activation='relu', input_shape=input_shape),
    layers.MaxPooling2D(pool_size=(2, 2)),
    layers.Flatten(),
    layers.Dense(128, activation='relu'),
    layers.Dense(category_count, activation='softmax')
])

# Initialize MAML
maml = MAML(model, meta_lr=0.001, task_lr=0.01, inner_steps=5)

# Generate dummy data
train_sample_count = 100
test_sample_count = 50
train_features = np.random.rand(*([train_sample_count] + list(input_shape)))
train_targets = np.random.randint(0, category_count, size=(train_sample_count,))
test_features = np.random.rand(*([test_sample_count] + list(input_shape)))
test_targets = np.random.randint(0, category_count, size=(test_sample_count,))

# Split data into tasks
support_set = [(train_features[i:i+5], train_targets[i:i+5]) for i in range(0, 100, 5)]
query_set = [(test_features[i:i+5], test_targets[i:i+5]) for i in range(0, 50, 5)]

# Train MAML
for epoch in range(10):
    meta_loss = maml.train_step(support_set, query_set)
    print(f"epoch: {epoch}, meta loss: {meta_loss.numpy()}")

Metadata

Release files for deepmeta 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deepmeta 0.0.1
File Size Uploaded Provenance
deepmeta-0.0.1.tar.gz 2.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for deepmeta 0.0.1
File Interpreter ABI Platform
deepmeta-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 kB

Release files / deepmeta-0.0.1.tar.gz

Download URL deepmeta-0.0.1.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d1261fd0dfe47fed6e0e6c71abf284e05af0c597f224eb4493bbcbc39c793a3b
BLAKE2b-256 checksum
How to use checksums
59dd6ae1383ebe34fbde12e38e1980b910ad2232407d2c6cc503fad5ec256654
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / deepmeta-0.0.1-py3-none-any.whl

Download URL deepmeta-0.0.1-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62a6898b6acf96327507b64534ee20255356b9d05ff14842f6cf7231ed4263de
BLAKE2b-256 checksum
How to use checksums
446dea3054e14a85545353e441168c58e1ff0148d1c55ff6baeba930210ff8bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Security for deepmeta 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page