Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
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.): |
This file contains hidden or 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
# 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 |