check every feature
This commit is contained in:
parent
d42bdb758c
commit
4558abf160
|
@ -124,7 +124,7 @@ impl<'a> Info<'a> {
|
|||
let angle = self.player.get_angle();
|
||||
let gun_angle = self.player.get_gun_angle();
|
||||
|
||||
[
|
||||
let feature=[
|
||||
normalize_angle(target.angle - angle).tanh(),
|
||||
(wall.distance - target.distance).tanh(),
|
||||
(self.player.power as f32).tanh(),
|
||||
|
@ -132,13 +132,15 @@ impl<'a> Info<'a> {
|
|||
(emeny.distance + 1.0).log2(),
|
||||
normalize_angle(emeny.angle - gun_angle).tanh(),
|
||||
normalize_angle(wall.angle - gun_angle).tanh(),
|
||||
]
|
||||
}
|
||||
pub fn into_feature_tensor<B: Backend>(&self, device: &B::Device) -> Tensor<B, 1> {
|
||||
let feature = self.into_feature();
|
||||
];
|
||||
for feature in feature.iter() {
|
||||
assert!(!feature.is_nan());
|
||||
}
|
||||
feature
|
||||
}
|
||||
pub fn into_feature_tensor<B: Backend>(&self, device: &B::Device) -> Tensor<B, 1> {
|
||||
let feature = self.into_feature();
|
||||
|
||||
Tensor::from_floats(feature, device)
|
||||
}
|
||||
fn get_target(&self) -> Target {
|
||||
|
|
Loading…
Reference in New Issue