Create models/decision_agent.py
Browse files- models/decision_agent.py +15 -0
models/decision_agent.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
|
| 4 |
+
class DecisionAgent(nn.Module):
|
| 5 |
+
def __init__(self, config):
|
| 6 |
+
super(DecisionAgent, self).__init__()
|
| 7 |
+
self.fc_layers = nn.Sequential(
|
| 8 |
+
nn.Linear(config["perception_output_size"], 128),
|
| 9 |
+
nn.ReLU(),
|
| 10 |
+
nn.Linear(128, config["decision_output_size"])
|
| 11 |
+
)
|
| 12 |
+
|
| 13 |
+
def forward(self, x):
|
| 14 |
+
x = self.fc_layers(x)
|
| 15 |
+
return x
|