Skip to content

Instantly share code, notes, and snippets.

View NewJerseyStyle's full-sized avatar

David H. NewJerseyStyle

View GitHub Profile
@NewJerseyStyle
NewJerseyStyle / polis_api_template.py
Created February 21, 2025 00:39
FastAPI based polis compatible API spec in Python (draft)
from typing import Optional, List, Dict, Union
from fastapi import FastAPI, Query, Header, Cookie, Depends, HTTPException, status
from fastapi.responses import JSONResponse
from pydantic import BaseModel, validator
import re # For email validation
app = FastAPI()
# --- Helper Functions (Simplified for demonstration) ---
# Replace these with your actual helper function implementations
@NewJerseyStyle
NewJerseyStyle / vae.py
Created March 4, 2020 04:06
A VAE class in pytorch
# train or use
from dataloader import dataloader
import model
import torch
import torch.nn as nn
from tqdm import trange, tqdm
class vae_module(object):
"""docstring for vae_module"""