Skip to content

Commit

Permalink
[FEAT][Functional]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed May 16, 2024
1 parent edfb8ea commit f62c750
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 69 deletions.
41 changes: 2 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,6 @@ pip install vision-mamba

# Usage
```python
<<<<<<< HEAD

import torch
from vision_mamba.model import Vim

# Create a random tensor
x = torch.randn(1, 3, 224, 224)

# Create an instance of the Vim model
model = Vim(
dim=256, # Dimension of the model
heads=8, # Number of attention heads
dt_rank=32, # Rank of the dynamic routing tensor
dim_inner=256, # Inner dimension of the model
d_state=256, # State dimension of the model
num_classes=1000, # Number of output classes
image_size=224, # Size of the input image
patch_size=16, # Size of the image patch
channels=3, # Number of input channels
dropout=0.1, # Dropout rate
depth=12, # Depth of the model
)

# Perform a forward pass through the model
out = model(x)

# Print the shape and output of the forward pass
print(out.shape)
print(out)
=======
import torch
from vision_mamba import Vim

Expand All @@ -68,7 +38,6 @@ model = Vim(
out = model(x) # Output tensor from the model
print(out.shape) # Print the shape of the output tensor
print(out) # Print the output tensor
>>>>>>> 9d8b929 ([CLEANUP])



Expand All @@ -92,13 +61,7 @@ print(out) # Print the output tensor
MIT


<<<<<<< HEAD
# Todo
- [ ] Fix the encoder block with the forward and backward convolutions
- [ ] Make a training script for imagenet
=======

# Todo
- [ ] Fix the Encoder block
- [ ] Implement the front and backward convolution
>>>>>>> 9d8b929 ([CLEANUP])
- [ ] Create training script for imagenet
- [ ] Create a visual mamba for facial recognition
33 changes: 3 additions & 30 deletions example.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
import torch
<<<<<<< HEAD
from vision_mamba.model import Vim

# Create a random tensor
x = torch.randn(1, 3, 224, 224)
=======
from vision_mamba import Vim

# Forward pass
x = torch.randn(1, 3, 224, 224) # Input tensor with shape (batch_size, channels, height, width)
>>>>>>> 9d8b929 ([CLEANUP])
x = torch.randn(
1, 3, 224, 224
) # Input tensor with shape (batch_size, channels, height, width)

# Create an instance of the Vim model
model = Vim(
<<<<<<< HEAD
dim=256, # Dimension of the model
heads=8, # Number of attention heads
dt_rank=32, # Rank of the dynamic routing tensor
dim_inner=256, # Inner dimension of the model
d_state=256, # State dimension of the model
num_classes=1000, # Number of output classes
image_size=224, # Size of the input image
patch_size=16, # Size of the image patch
channels=3, # Number of input channels
dropout=0.1, # Dropout rate
depth=12, # Depth of the model
)

# Perform a forward pass through the model
out = model(x)

# Print the shape and output of the forward pass
print(out.shape)
print(out)
=======
dim=256, # Dimension of the transformer model
heads=8, # Number of attention heads
dt_rank=32, # Rank of the dynamic routing matrix
Expand All @@ -51,4 +25,3 @@
out = model(x) # Output tensor from the model
print(out.shape) # Print the shape of the output tensor
print(out) # Print the output tensor
>>>>>>> 9d8b929 ([CLEANUP])

0 comments on commit f62c750

Please sign in to comment.