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 yaml | |
import numpy as np | |
import rasterio as rio | |
import torch | |
from prithvi import MaskedAutoencoderViT | |
from huggingface_hub import hf_hub_download | |
# Constants | |
REPO_ID = "ibm-nasa-geospatial/Prithvi-100M" | |
CONFIG = "Prithvi_100M_config.yaml" |
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 os | |
import torch | |
from torch import nn | |
from torch.utils.data import DataLoader, TensorDataset | |
import lightning as L | |
# Generate a synthetic dataset | |
def generate_data(num_samples): | |
# Generate random integers |
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 torch.nn as nn | |
import torch.nn.functional as F | |
def _conv(ni, nf, ks): | |
return nn.Conv1d(ni, nf, kernel_size=ks, stride=1, padding=ks // 2) | |
def _conv_layer(ni, nf, ks, drop=0.0): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.