Skip to content

Instantly share code, notes, and snippets.

View amirshamaei's full-sized avatar
😄

Amir Shamaei amirshamaei

😄
View GitHub Profile
@amirshamaei
amirshamaei / simple_code_for_deep_learning_in_MR_spectroscopy.ipynb
Created March 22, 2023 17:48
a simple code for the demonstration of deep learning in MR spectroscopy utilizing Pytorch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@amirshamaei
amirshamaei / mlp-mixer-1d.py
Created April 1, 2022 10:59
MLP-Mixer: An all-MLP Architecture for Vision for 1D signal
import torch
import numpy as np
from torch import nn
from einops.layers.torch import Rearrange
# adapted for 1d signal by Amir Shamaei
# The main code is from:
# https://github.com/rishikksh20/MLP-Mixer-pytorch/tree/8badd62ba03c5c1f478f6380cfa71ef8ed528f4c
class FeedForward(nn.Module):
def __init__(self, dim, hidden_dim, dropout = 0.):
@amirshamaei
amirshamaei / convnext.py
Created April 1, 2022 08:52
A ConvNet for the 2020s (1D version)
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn