part1 done

This commit is contained in:
2026-07-07 01:41:05 -07:00
parent 121799ce1c
commit bbe6409770
3 changed files with 2314 additions and 73 deletions
@@ -0,0 +1,23 @@
import torch.nn as nn
# Simple Linear Model
class LinearModel(nn.Module):
def __init__(self, input_features):
super(LinearModel, self).__init__()
self.linear = nn.Linear(input_features, 1) # Single output (return prediction)
def forward(self, x):
return self.linear(x)
# Non-Linear Neural Network Model
class NonLinearModel(nn.Module):
def __init__(self, input_features, hidden_size=64):
super(NonLinearModel, self).__init__()
self.network = nn.Sequential(
nn.Linear(input_features, hidden_size),
nn.ReLU(), # Non-linear activation
nn.Linear(hidden_size , 1) # Output layer
)
def forward(self, x):
return self.network(x)
File diff suppressed because one or more lines are too long