InterceptPredictor (444,860 parameters)
├── Network (Sequential)
│ ├── Linear(28 → 512) + BatchNorm + ReLU + Dropout(0.05)
│ ├── Linear(512 → 512) + BatchNorm + ReLU + Dropout(0.05)
│ ├── Linear(512 → 256) + BatchNorm + ReLU + Dropout(0.05)
│ ├── Linear(256 → 128) + BatchNorm + ReLU + Dropout(0.05)
│ └── Linear(128 → 2)
└── Skip Connection: Linear(28 → 2)
1 import torch
2 import torch . nn as nn
3 import joblib
4 import numpy as np
5
6 # Load model
7 class InterceptPredictorModel ( nn . Module ) :
8 def __init__ ( self , input_dim = 28 , hidden_dims = [ 512 , 512 , 256 , 128 ] , dropout = 0.05 ) :
9 super ( ) . __init__ ( )
10 layers = [ ]
11 prev_dim = input_dim
12 for h_dim in hidden_dims :
13 layers . extend ( [ nn . Linear ( prev_dim , h_dim ) , nn . BatchNorm1d ( h_dim ) , nn . ReLU ( ) , nn . Dropout ( dropout ) ] )
14 prev_dim = h_dim
15 layers . append ( nn . Linear ( prev_dim , 2 ) )
16 self . network = nn . Sequential ( * layers )
17 self . skip = nn . Linear ( input_dim , 2 )
18 def forward ( self , x ) :
19 return self . network ( x ) + self . skip ( x )
20
21 checkpoint = torch . load ( 'intercept_model_full.pth' , map_location = 'cpu' , weights_only = True )
22 model = InterceptPredictorModel ( )
23 model . load_state_dict ( checkpoint [ 'model_state_dict' ] )
24 model . eval ( )
25
26 scaler_X = joblib . load ( 'scaler_X.pkl' )
27 scaler_y = joblib . load ( 'scaler_y.pkl' )
28
29 # Predict (see inference.py for the full feature engineering pipeline)
1 from inference import InterceptPredictor
2
3 predictor = InterceptPredictor ( )
4 result = predictor . predict_single (
5 R = 8000 , LOS = 0.5 , Vc = 400 , Target_H = 1.2 ,
6 Missile_H = 0.8 , Aspect = 0.3 , Tgo_Input = 15
7 )
8 print ( f"Intercept: ( { result [ 'IX' ] : .1f } , { result [ 'IY' ] : .1f } )" )