generated from kyegomez/Python-Package-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kye
committed
Oct 11, 2023
1 parent
f281e4b
commit 6f1923c
Showing
7 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import torch | ||
from swarms_torch.fish_school import Fish, FishSchool | ||
|
||
# Create random source and target sequences | ||
src = torch.randn(10, 32, 512) | ||
tgt = torch.randn(10, 32, 512) | ||
|
||
# Create random labels | ||
labels = torch.randint(0, 512, (10, 32)) | ||
|
||
# Create a fish and train it on the random data | ||
fish = Fish(512, 8, 6) | ||
fish.train(src, tgt, labels) | ||
print(fish.food) # Print the fish's food | ||
|
||
# Create a fish school and optimize it on the random data | ||
school = FishSchool(10, 512, 8, 6, 100) | ||
school.forward(src, tgt, labels) | ||
print(school.fish[0].food) # Print the first fish's food |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "swarms-torch" | ||
version = "0.0.7" | ||
version = "0.0.9" | ||
description = "swarms-torch - Pytorch" | ||
license = "MIT" | ||
authors = ["Kye Gomez <[email protected]>"] | ||
|
@@ -30,6 +30,8 @@ packages = [ | |
[tool.poetry.dependencies] | ||
python = "^3.6" | ||
torch = "*" | ||
einops = "*" | ||
|
||
|
||
|
||
[tool.poetry.dev-dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters