Spaces:
Running
Running
File size: 5,961 Bytes
5c05315 aa71778 bb1767b 5c05315 bb1767b 0393444 dfa5a19 bb1767b 5c05315 bb1767b dfa5a19 bb1767b 5c05315 bb1767b 5c05315 bb1767b 5c05315 bb1767b 5c05315 dfa5a19 bb1767b 5c05315 bb1767b a380586 bb1767b 000e826 bb1767b 5c05315 bb1767b 000e826 dfa5a19 000e826 0393444 000e826 0393444 000e826 0393444 000e826 0393444 000e826 0393444 000e826 745834e 000e826 0393444 000e826 745834e 000e826 96385b4 745834e bb1767b dfa5a19 bb1767b dfa5a19 bb1767b edbd3ed bb1767b dfa5a19 bb1767b 5c05315 aa71778 a380586 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
export enum LayerType {
INPUT = 'Input',
LINEAR = 'Linear',
CONV1D = 'Conv1D',
CONV2D = 'Conv2D',
CONV3D = 'Conv3D',
CONV_TRANSPOSE2D = 'ConvTranspose2D',
DEFORMABLE_CONV = 'DeformConv2d',
SEPARABLE_CONV2D = 'SeparableConv2D', // New
DEPTHWISE_CONV2D = 'DepthwiseConv2D', // New
RELU = 'ReLU',
LEAKYRELU = 'LeakyReLU',
PRELU = 'PReLU',
GELU = 'GELU',
SILU = 'SiLU',
SWIGLU = 'SwiGLU',
SIGMOID = 'Sigmoid',
TANH = 'Tanh',
SOFTPLUS = 'Softplus', // New
SOFTSIGN = 'Softsign', // New
MAXPOOL = 'MaxPool2D',
MAXPOOL3D = 'MaxPool3D',
AVGPOOL = 'AvgPool2D',
GLOBAL_AVG_POOL = 'GlobalAvgPool',
ADAPTIVEAVGPOOL = 'AdaptiveAvgPool2D',
UPSAMPLE = 'Upsample',
PIXEL_SHUFFLE = 'PixelShuffle',
DROPOUT = 'Dropout',
DROPPATH = 'DropPath',
SPATIAL_DROPOUT = 'SpatialDropout', // New
BATCHNORM = 'BatchNorm2D',
GROUPNORM = 'GroupNorm',
LAYERNORM = 'LayerNorm',
RMSNORM = 'RMSNorm',
INSTANCENORM = 'InstanceNorm2d',
FLATTEN = 'Flatten',
RESHAPE = 'Reshape',
PERMUTE = 'Permute',
UNFLATTEN = 'Unflatten',
EMBEDDING = 'Embedding',
PATCH_EMBED = 'PatchEmbed',
POS_EMBED = 'PositionalEmbed',
ROPE = 'RotaryPosEmbed',
TIME_EMBEDDING = 'TimeEmbedding',
LSTM = 'LSTM',
GRU = 'GRU',
ATTENTION = 'SelfAttention',
CROSS_ATTENTION = 'CrossAttention',
WINDOW_ATTENTION = 'WindowAttention',
TRANSFORMER_BLOCK = 'TransformerBlock',
TRANSFORMER_ENCODER = 'TransformerEncoderLayer',
TRANSFORMER_DECODER = 'TransformerDecoderLayer',
MOE_BLOCK = 'SparseMoEBlock',
SE_BLOCK = 'SqueezeExcitation',
ACTION_HEAD = 'ActionHead',
SAM_PROMPT_ENCODER = 'SamPromptEncoder',
SAM_MASK_DECODER = 'SamMaskDecoder',
// TensorFlow / Keras Preprocessing
RESCALING = 'Rescaling',
RESIZING = 'Resizing',
CENTER_CROP = 'CenterCrop',
RANDOM_FLIP = 'RandomFlip',
RANDOM_ROTATION = 'RandomRotation',
RANDOM_ZOOM = 'RandomZoom',
RANDOM_CONTRAST = 'RandomContrast',
TEXT_VECTORIZATION = 'TextVectorization',
NORMALIZATION_LAYER = 'NormalizationLayer', // Keras style mean/var
DISCRETIZATION = 'Discretization',
CATEGORY_ENCODING = 'CategoryEncoding',
// YOLO / Detection
C2F_BLOCK = 'C2fBlock',
SPPF_BLOCK = 'SPPFBlock',
DARKNET_BLOCK = 'DarknetBlock',
DETECT_HEAD = 'DetectHead',
ANCHOR_BOX = 'AnchorBox',
NMS = 'NMS',
// Audio / Speech
STFT = 'STFT',
MEL_SPECTROGRAM = 'MelSpectrogram',
SPEC_AUGMENT = 'SpecAugment',
CONFORMER_BLOCK = 'ConformerBlock',
WAVENET_BLOCK = 'WaveNetBlock',
WAV2VEC2_ENC = 'Wav2Vec2Encoder',
RVC_ENCODER = 'HubertContentEncoder',
VOCODER = 'Vocoder',
AUDIO_EMBEDDING = 'AudioEmbedding',
SINC_CONV = 'SincConv',
// 3D / NeRF / Point Cloud
NERF_BLOCK = 'NeRFBlock',
POINTNET_BLOCK = 'PointNetBlock',
POINT_TRANSFORMER = 'PointTransformer',
TRIPLANE_ENC = 'TriplaneEncoder',
GAUSSIAN_SPLAT = 'GaussianSplatDecoder',
MESH_CONV = 'MeshConv',
// OCR (Text Recognition)
TPS_TRANSFORM = 'TPSTransform',
CRNN_BLOCK = 'CRNNBlock',
CTC_DECODER = 'CTCDecoder',
// Depth / Motion / Robotics
DEPTH_DECODER = 'DepthDecoder',
DISPARITY_HEAD = 'DisparityHead',
OPTICAL_FLOW = 'OpticalFlowBlock',
VELOCITY_HEAD = 'VelocityHead',
KALMAN_FILTER = 'KalmanFilter',
BEV_TRANSFORM = 'BEVTransformer',
RADAR_ENCODER = 'RadarEncoder',
// Video / Generation
VIDEO_DIFFUSION_BLOCK = 'VideoDiffusionBlock',
SPATIO_TEMPORAL_ATTN = 'SpatioTemporalAttention',
VIDEO_TOKENIZER = 'VideoTokenizer',
FRAME_INTERPOLATOR = 'FrameInterpolator',
TEMPORAL_SHIFT = 'TemporalShift',
NON_LOCAL_BLOCK = 'NonLocalBlock',
MULTIMODAL_FUSION = 'MultimodalFusion',
// Graph Neural Networks (GNN)
GCN_CONV = 'GCNConv',
GRAPH_SAGE = 'GraphSAGE',
GAT_CONV = 'GATConv',
GIN_CONV = 'GINConv',
// Physics & SciML
NEURAL_ODE = 'NeuralODE',
PINN_LINEAR = 'PINNLinear',
HAMILTONIAN_NN = 'HamiltonianNN',
PROTEIN_FOLDING = 'ProteinFoldingBlock',
// Spiking & Neuromorphic
LIF_NEURON = 'LIFNeuron',
SPIKING_LAYER = 'SpikingLayer',
// Reinforcement Learning (RL)
DUELING_HEAD = 'DuelingHead',
PPO_HEAD = 'PPOHead',
SAC_HEAD = 'SACHead',
// Advanced / Niche / Future
CAPSULE = 'CapsuleLayer',
HYPER_NET = 'HyperNetwork',
MAMBA_BLOCK = 'MambaBlock', // SSM
RWKV_BLOCK = 'RWKVBlock', // RNN-Transformer Hybrid
HOPFIELD = 'HopfieldLayer', // Energy Based
NORMALIZING_FLOW = 'NormalizingFlow', // Probabilistic
DNC_MEMORY = 'DNCMemory', // Memory Augmented
ARCFACE = 'ArcFace', // Metric Learning
ECHO_STATE = 'EchoStateNetwork', // Reservoir
CONCAT = 'Concat',
ADD = 'Add',
SUBTRACT = 'Subtract', // New
MULTIPLY = 'Multiply', // New
AVERAGE = 'Average', // New
MAXIMUM = 'Maximum', // New
MINIMUM = 'Minimum', // New
DOT = 'Dot', // New
OUTPUT = 'Output',
CUSTOM = 'CustomLayer',
LAMBDA = 'Lambda', // New
IDENTITY = 'Identity'
}
export interface LayerParameter {
name: string;
type: 'number' | 'string' | 'select' | 'boolean' | 'text';
label: string;
default: any;
options?: string[]; // For select types
description?: string;
}
export interface LayerDefinition {
type: LayerType;
label: string;
description: string;
category: 'Core' | 'Convolution' | 'Preprocessing' | 'Recurrent' | 'Normalization' | 'Transformer' | 'GenAI' | 'Utility' | 'Merge' | 'Detection' | 'Audio' | '3D' | 'OCR' | 'Robotics' | 'Video' | 'Graph' | 'Physics' | 'Spiking' | 'RL' | 'Advanced';
parameters: LayerParameter[];
}
export interface NodeData {
label: string;
type: LayerType;
params: Record<string, any>;
isValid?: boolean;
error?: string;
onDelete?: (id: string) => void;
}
export interface GraphTemplate {
id: string;
name: string;
description: string;
nodes: any[];
edges: any[];
}
export interface GeneratedCodeResponse {
code: string;
explanation: string;
}
export interface LogEntry {
id: string;
timestamp: Date;
message: string;
type: 'info' | 'success' | 'warning' | 'error';
} |