Merge branch 'main' of https://github.com/sisl/InteractionImitation into main
This commit is contained in:
@@ -41,7 +41,7 @@ def test_phi():
|
|||||||
y = phi(torch.rand(input_dim))
|
y = phi(torch.rand(input_dim))
|
||||||
y = phi(torch.rand(7,7,7,input_dim))
|
y = phi(torch.rand(7,7,7,input_dim))
|
||||||
|
|
||||||
assert len(phi.parameters() > 0)
|
assert len(list(phi.parameters())) > 0
|
||||||
|
|
||||||
def test_deepsets():
|
def test_deepsets():
|
||||||
m = ds.DeepSetsModule.from_config(ds_config)
|
m = ds.DeepSetsModule.from_config(ds_config)
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ filestr = 'tests/policies/base_'
|
|||||||
|
|
||||||
|
|
||||||
def test_forward_pass():
|
def test_forward_pass():
|
||||||
batch = pickle.load(open(filestr + '_test_batch.pkl', 'rb'))
|
batch = pickle.load(open(filestr + '_test_batch.pkl', 'rb'))
|
||||||
batch['relative_state'] = batch['relative_state'].float()
|
batch['relative_state'] = batch['relative_state'].float()
|
||||||
policy = BehaviorCloningPolicy.load_model(config, filestr)
|
policy = BehaviorCloningPolicy.load_model(config, filestr)
|
||||||
policy.policy = policy.policy.type(batch['state'].dtype)
|
policy.policy = policy.policy.type(batch['state'].dtype)
|
||||||
action = policy(batch)
|
action = policy(batch)
|
||||||
i = torch.where(action.isnan())[0]
|
i = torch.where(action.isnan())[0]
|
||||||
for key in batch.keys():
|
for key in batch.keys():
|
||||||
print(batch[key][i])
|
print(batch[key][i])
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ with open(config_path, 'r') as cfg:
|
|||||||
config = json5.load(cfg)
|
config = json5.load(cfg)
|
||||||
|
|
||||||
def test_deepsets_policy():
|
def test_deepsets_policy():
|
||||||
module = DeepSetsPolicy(config["ego_state"], config["deepsets"], config["path_encoder"], config["head"])
|
module = DeepSetsPolicy(config)
|
||||||
|
|
||||||
ns = 5
|
ns = 5
|
||||||
nv = 7
|
nv = 7
|
||||||
|
|||||||
Reference in New Issue
Block a user