ezhang7423
add lcd models
056e092
diff --git a/src/lcd/apps/train_gcbc.py b/src/lcd/apps/train_gcbc.py
index 2c79d9d..8733059 100644
--- a/src/lcd/apps/train_gcbc.py
+++ b/src/lcd/apps/train_gcbc.py
@@ -61,7 +61,7 @@ def main(
width: int = 256,
upscaled_state_dim: int = 2048,
upscale: bool = False,
- depth: int = 2,
+ depth: int = 3,
num_epochs: int = 100,
num_steps: int = int(1e4),
batch_size: int = 512,
@@ -70,6 +70,7 @@ def main(
use_wandb: bool = False,
skip_eval: bool = True,
clevr: bool = True,
+ weight_decay: float= 1e-4,
):
set_seed(seed)
@@ -85,22 +86,26 @@ def main(
)
args.log_dir = exp_path
exp_path.mkdir(parents=True)
- print("Saving to", exp_path)
if use_wandb:
wandb.init(
project="vanilla-diffuser",
entity="lang-diffusion",
- name=f"{env_name}-ce",
+ name=f"{env_name}-ce-post-activation-weight-decay",
config=vars(args),
)
+ print("Saving to", exp_path)
if not upscale:
upscaled_state_dim = 10
# model
final_dim = 40 if clevr else None
+ num_units = [width] * depth
+ num_units[-1] = diffusion_dim
model = ForwardModel(
- in_dim=upscaled_state_dim * 2, final_dim=final_dim, diffusion_dim=diffusion_dim, num_units=[width] * depth
+ in_dim=upscaled_state_dim, final_dim=final_dim, diffusion_dim=diffusion_dim, num_units=num_units
)
+ # model = torch.load("/home/ubuntu/talar/lcd-iclr24-clevr/submodules/data/clevr/11-19_18:42:51.252737/model_99.pt", )
+ print(model)
summary(model)
# dataset
@@ -132,7 +137,8 @@ def main(
evaluate(eval_arg)
# train
- optimizer = torch.optim.Adam(model.parameters(), lr=lr)
+ optimizer = torch.optim.AdamW(model.parameters(), lr=lr, weight_decay=weight_decay)
+
# optimizer = torch.optim.SGD(model.parameters(), lr=lr, weight_decay=1e-4)
device = "cuda:" + get_best_cuda()
model.to(device)
@@ -156,7 +162,8 @@ def main(
extra_stats = {}
batch = next(dataloader).to(device).float()
pred = model.forward(
- torch.concat((batch["obs"], batch["next_obs"]), dim=-1)
+ # torch.concat((batch["obs"], batch["next_obs"]), dim=-1)
+ batch['obs'], batch['next_obs']
).to(device)
act_int = batch["actions"].to(torch.int64)
@@ -311,8 +318,8 @@ def evaluate(eval_arg: EvalArgs = None):
for ts in range(10):
next_obs = ds['next_obs'][ds_idx:ds_idx+1]
- model_input = torch.concat((obs, next_obs), dim=-1).to(p)
- action = eval_arg.model(model_input).argmax()[None]
+ # model_input = torch.concat((obs, next_obs), dim=-1).to(p)
+ action = eval_arg.model(obs.to(p), next_obs.to(p)).argmax()[None]
obs, rewards, dones, info = eval_arg.env.step(action)
obs = preprocess_obs(obs[0])
print('a_hat:', action)
diff --git a/src/lcd/datasets/__init__.py b/src/lcd/datasets/__init__.py
index 6ff45ff..d8f8a22 100644
--- a/src/lcd/datasets/__init__.py
+++ b/src/lcd/datasets/__init__.py
@@ -1 +1 @@
-from .sequence import HulcDataset
+from .sequence import HulcDataset, ClevrDataset
diff --git a/src/lcd/datasets/sequence.py b/src/lcd/datasets/sequence.py
index b34b912..4566982 100644
--- a/src/lcd/datasets/sequence.py
+++ b/src/lcd/datasets/sequence.py
@@ -79,3 +79,47 @@ class HulcDataset(torch.utils.data.Dataset):
return KwargsBatch(
Batch(traj, lang), {"inpaint": {0: traj[0, self.action_dim :]}}
)
+
+
+class ClevrDataset(torch.utils.data.Dataset):
+ "Characterizes a dataset for PyTorch"
+
+ def __init__(
+ self,
+ *args,
+ buf,
+ lang_embeds,
+ encoder_path,
+ frame_offset=0,
+ horizon=4,
+ clip_stride=16,
+ **kwargs,
+ ):
+ print(f"{buf=}")
+ self.clip_stride = clip_stride
+ self.frame_offset = frame_offset
+ self.horizon = horizon
+ self.buf = buf
+ self.lang_embeds = torch.load(lang_embeds)
+ encoder = torch.load(encoder_path)
+ encoder_type = next(encoder.parameters())
+
+ def encode(buf):
+ with torch.no_grad():
+ buf['obs'] = encoder.encode(buf['obs'].to(encoder_type))
+ buf['next_obs'] = encoder.encode(buf['next_obs'].to(encoder_type))
+
+ encode(self.buf)
+
+ self.observation_dim = kwargs.get("observation_dim")
+ self.action_dim = kwargs.get("action_dim")
+
+ def __len__(self):
+ return self.buf.shape[0]
+
+ def __getitem__(self, index):
+ lang = self.lang_embeds[str(self.buf['obs_goal'][index].int().tolist())]
+ traj = torch.concat((self.buf["obs"][index:index+1], self.buf["next_obs"][index:index+1]), dim=1)
+ return KwargsBatch(
+ Batch(traj, lang), {"inpaint": {0: traj[0, self.action_dim :]}}
+ )
diff --git a/src/lcd/models/mlp.py b/src/lcd/models/mlp.py
index 232db08..416c007 100644
--- a/src/lcd/models/mlp.py
+++ b/src/lcd/models/mlp.py
@@ -1,21 +1,47 @@
+import einops
from torch import nn
-
+import torch
class ForwardModel(nn.Module):
def __init__(
self, in_dim=(39 + 40 + 40 + 1), diffusion_dim=16, final_dim=39, num_units=[512, 512, 512]
):
super(ForwardModel, self).__init__()
- actor_layers = []
+ encoder = []
for out_dim in num_units:
- actor_layers.append(nn.Linear(in_dim, out_dim))
- actor_layers.append(nn.ReLU())
+ encoder.append(nn.Linear(in_dim, out_dim))
+ encoder.append(nn.ReLU())
+ encoder.append(nn.LayerNorm(out_dim))
in_dim = out_dim
+ self.encoder = nn.Sequential(*encoder)
+
+ final_layers = nn.Sequential(
+ nn.Linear(diffusion_dim * 2, num_units[0]),
+ nn.ReLU(),
+ nn.LayerNorm(num_units[0]),
+ nn.Linear(num_units[0], num_units[0]),
+ nn.ReLU(),
+ nn.LayerNorm(num_units[0]),
+ nn.Linear(num_units[0], final_dim)
+ )
+
# Final layers
- actor_layers += [nn.Linear(in_dim, diffusion_dim), nn.ReLU(), nn.Linear(diffusion_dim, final_dim)]
- self.actor_layers = nn.Sequential(*actor_layers)
+ self.final_layers = final_layers
+
self.depth = len(num_units)
- def forward(self, inputs, dropout_rate=0.0):
- return self.actor_layers(inputs)
+ def forward(self, obs, next_obs):
+ # Concatenate obs and next_obs along the feature dimension
+ combined_input = torch.cat([obs, next_obs], dim=0)
+
+ # Pass the combined input through encoder
+ encoded_combined = self.encoder(combined_input)
+
+ # Concatenate the separately encoded obs and next_obs and pass through final layers
+ return self.final_layers(einops.rearrange(encoded_combined, '(t n) f -> n (t f)', t=2))
+
+
+ def encode(self, inputs):
+ return self.encoder(inputs)
+
diff --git a/src/lcd/scripts/diffuser.py b/src/lcd/scripts/diffuser.py
index 0885adf..349c78d 100644
--- a/src/lcd/scripts/diffuser.py
+++ b/src/lcd/scripts/diffuser.py
@@ -9,7 +9,7 @@ from lcd.apps import rollout
from lcd.datasets.sequence import Batch
from lcd.utils.arrays import batch_to_device
from lcd.utils.training import cycle
-
+from lcd.apps.train_gcbc import load_dataset
script_dir = os.path.dirname(os.path.realpath(__file__))
# -----------------------------------------------------------------------------#
# ----------------------------------- setup -----------------------------------#
@@ -17,7 +17,7 @@ script_dir = os.path.dirname(os.path.realpath(__file__))
class Parser(utils.Parser):
- config: str = "lcd.config.calvin"
+ config: str = "lcd.config.clevr"
args = Parser().parse_args("diffusion")
@@ -26,6 +26,9 @@ args.dim_mults = tuple(int(i) for i in args.dim_mults)
# -----------------------------------------------------------------------------#
# ---------------------------------- dataset ----------------------------------#
# -----------------------------------------------------------------------------#
+print("loading dataset...")
+train, val = load_dataset(True, exp_path=None)
+print("done loading!")
dataset_config = utils.Config(
args.loader,
@@ -36,14 +39,15 @@ dataset_config = utils.Config(
use_padding=args.use_padding,
max_path_length=args.max_path_length,
frame_offset=args.frame_offset,
- lang_embeds=DATA_PATH / "t5-v1_1-xxl_embeddings.pt",
- task_to_ann=DATA_PATH / "annotations.json",
- buf=DATA_PATH / f"hulc-trajectories/{args.seed}_all_trajectories.pt",
+ encoder_path="/home/ubuntu/talar/lcd-iclr24-clevr/submodules/data/clevr/11-20_06:41:04.604072/model_30.pt",
+ lang_embeds=DATA_PATH / "clevr_direct_embeddings.pt",
+ # buf=DATA_PATH / f"ball_buf.pt",
observation_dim=args.observation_dim,
action_dim=args.action_dim,
)
-dataset = dataset_config()
+dataset = dataset_config(buf=train)
+val_dataset = dataset_config(buf=val)
observation_dim = dataset.observation_dim
action_dim = dataset.action_dim
@@ -107,7 +111,7 @@ model = model_config()
diffusion = diffusion_config(model)
-trainer = trainer_config(diffusion, dataset)
+trainer = trainer_config(diffusion, dataset, val_dataset)
# -----------------------------------------------------------------------------#
@@ -132,16 +136,11 @@ print("✓")
n_epochs = int(args.n_train_steps // args.n_steps_per_epoch)
-if args.wandb:
- wandb.init(
- project="vanilla-diffuser",
- entity="lang-diffusion",
- name=f"hulc-{args.wandb_name}",
- config=vars(args),
- )
def eval_model(num_evals, epoch=0):
+ print('skipping eval')
+ return
rollout.main(seed=args.seed, num_sequences=num_evals)
dm_args = args.as_dict()
dm_args["epoch"] = epoch
@@ -154,6 +153,14 @@ eval_model(
)
print("✓")
+if args.wandb:
+ wandb.init(
+ project="vanilla-diffuser",
+ entity="lang-diffusion",
+ name=f"hulc-{args.wandb_name}",
+ config=vars(args),
+ )
+
for i in range(n_epochs):
print(f"Epoch {i} / {n_epochs} | {args.savepath}")
diff --git a/src/lcd/scripts/generation/embeddings.py b/src/lcd/scripts/generation/embeddings.py
index f28743b..1e74a44 100644
--- a/src/lcd/scripts/generation/embeddings.py
+++ b/src/lcd/scripts/generation/embeddings.py
@@ -99,10 +99,755 @@ def t5_encode_tokenized_text(
return encoded_text
+# from lcd.apps.train_gcbc import load_dataset
+# k = load_dataset(clevr=True, upscale=False, exp_path=None)
+# sys.path.append(
+# "/home/ubuntu/talar/talar-openreview/talar"
+# )
+# from ball_collect_data import features2goal
+# z = features2goal(k[0]['obs_goal'])
+# unique_z = set(z)
+
+# d = {}
+# for j, v in zip(k[0]['obs_goal'], anns):
+# d[str(j.int().tolist())] = v
+
+
+unique_z = {'Can you help me push the blue ball behind the cyan ball',
+ 'Can you help me push the blue ball behind the green ball',
+ 'Can you help me push the blue ball behind the purple ball',
+ 'Can you help me push the blue ball behind the red ball',
+ 'Can you help me push the blue ball in front of the cyan ball',
+ 'Can you help me push the blue ball in front of the green ball',
+ 'Can you help me push the blue ball in front of the purple ball',
+ 'Can you help me push the blue ball in front of the red ball',
+ 'Can you help me push the blue ball to the left of the cyan ball',
+ 'Can you help me push the blue ball to the left of the green ball',
+ 'Can you help me push the blue ball to the left of the purple ball',
+ 'Can you help me push the blue ball to the left of the red ball',
+ 'Can you help me push the blue ball to the right of the cyan ball',
+ 'Can you help me push the blue ball to the right of the green ball',
+ 'Can you help me push the blue ball to the right of the purple ball',
+ 'Can you help me push the blue ball to the right of the red ball',
+ 'Can you help me push the cyan ball behind the blue ball',
+ 'Can you help me push the cyan ball behind the green ball',
+ 'Can you help me push the cyan ball behind the purple ball',
+ 'Can you help me push the cyan ball behind the red ball',
+ 'Can you help me push the cyan ball in front of the blue ball',
+ 'Can you help me push the cyan ball in front of the green ball',
+ 'Can you help me push the cyan ball in front of the purple ball',
+ 'Can you help me push the cyan ball in front of the red ball',
+ 'Can you help me push the cyan ball to the left of the blue ball',
+ 'Can you help me push the cyan ball to the left of the green ball',
+ 'Can you help me push the cyan ball to the left of the purple ball',
+ 'Can you help me push the cyan ball to the left of the red ball',
+ 'Can you help me push the cyan ball to the right of the blue ball',
+ 'Can you help me push the cyan ball to the right of the green ball',
+ 'Can you help me push the cyan ball to the right of the purple ball',
+ 'Can you help me push the cyan ball to the right of the red ball',
+ 'Can you help me push the green ball behind the blue ball',
+ 'Can you help me push the green ball behind the cyan ball',
+ 'Can you help me push the green ball behind the purple ball',
+ 'Can you help me push the green ball behind the red ball',
+ 'Can you help me push the green ball in front of the blue ball',
+ 'Can you help me push the green ball in front of the cyan ball',
+ 'Can you help me push the green ball in front of the purple ball',
+ 'Can you help me push the green ball in front of the red ball',
+ 'Can you help me push the green ball to the left of the blue ball',
+ 'Can you help me push the green ball to the left of the cyan ball',
+ 'Can you help me push the green ball to the left of the purple ball',
+ 'Can you help me push the green ball to the left of the red ball',
+ 'Can you help me push the green ball to the right of the blue ball',
+ 'Can you help me push the green ball to the right of the cyan ball',
+ 'Can you help me push the green ball to the right of the purple ball',
+ 'Can you help me push the green ball to the right of the red ball',
+ 'Can you help me push the purple ball behind the blue ball',
+ 'Can you help me push the purple ball behind the cyan ball',
+ 'Can you help me push the purple ball behind the green ball',
+ 'Can you help me push the purple ball behind the red ball',
+ 'Can you help me push the purple ball in front of the blue ball',
+ 'Can you help me push the purple ball in front of the cyan ball',
+ 'Can you help me push the purple ball in front of the green ball',
+ 'Can you help me push the purple ball in front of the red ball',
+ 'Can you help me push the purple ball to the left of the blue ball',
+ 'Can you help me push the purple ball to the left of the cyan ball',
+ 'Can you help me push the purple ball to the left of the green ball',
+ 'Can you help me push the purple ball to the left of the red ball',
+ 'Can you help me push the purple ball to the right of the blue ball',
+ 'Can you help me push the purple ball to the right of the cyan ball',
+ 'Can you help me push the purple ball to the right of the green ball',
+ 'Can you help me push the purple ball to the right of the red ball',
+ 'Can you help me push the red ball behind the blue ball',
+ 'Can you help me push the red ball behind the cyan ball',
+ 'Can you help me push the red ball behind the green ball',
+ 'Can you help me push the red ball behind the purple ball',
+ 'Can you help me push the red ball in front of the blue ball',
+ 'Can you help me push the red ball in front of the cyan ball',
+ 'Can you help me push the red ball in front of the green ball',
+ 'Can you help me push the red ball in front of the purple ball',
+ 'Can you help me push the red ball to the left of the blue ball',
+ 'Can you help me push the red ball to the left of the cyan ball',
+ 'Can you help me push the red ball to the left of the green ball',
+ 'Can you help me push the red ball to the left of the purple ball',
+ 'Can you help me push the red ball to the right of the blue ball',
+ 'Can you help me push the red ball to the right of the cyan ball',
+ 'Can you help me push the red ball to the right of the green ball',
+ 'Can you help me push the red ball to the right of the purple ball',
+ 'Can you push the blue ball behind the cyan ball',
+ 'Can you push the blue ball behind the green ball',
+ 'Can you push the blue ball behind the purple ball',
+ 'Can you push the blue ball behind the red ball',
+ 'Can you push the blue ball in front of the cyan ball',
+ 'Can you push the blue ball in front of the green ball',
+ 'Can you push the blue ball in front of the purple ball',
+ 'Can you push the blue ball in front of the red ball',
+ 'Can you push the blue ball to the left of the cyan ball',
+ 'Can you push the blue ball to the left of the green ball',
+ 'Can you push the blue ball to the left of the purple ball',
+ 'Can you push the blue ball to the left of the red ball',
+ 'Can you push the blue ball to the right of the cyan ball',
+ 'Can you push the blue ball to the right of the green ball',
+ 'Can you push the blue ball to the right of the purple ball',
+ 'Can you push the blue ball to the right of the red ball',
+ 'Can you push the cyan ball behind the blue ball',
+ 'Can you push the cyan ball behind the green ball',
+ 'Can you push the cyan ball behind the purple ball',
+ 'Can you push the cyan ball behind the red ball',
+ 'Can you push the cyan ball in front of the blue ball',
+ 'Can you push the cyan ball in front of the green ball',
+ 'Can you push the cyan ball in front of the purple ball',
+ 'Can you push the cyan ball in front of the red ball',
+ 'Can you push the cyan ball to the left of the blue ball',
+ 'Can you push the cyan ball to the left of the green ball',
+ 'Can you push the cyan ball to the left of the purple ball',
+ 'Can you push the cyan ball to the left of the red ball',
+ 'Can you push the cyan ball to the right of the blue ball',
+ 'Can you push the cyan ball to the right of the green ball',
+ 'Can you push the cyan ball to the right of the purple ball',
+ 'Can you push the cyan ball to the right of the red ball',
+ 'Can you push the green ball behind the blue ball',
+ 'Can you push the green ball behind the cyan ball',
+ 'Can you push the green ball behind the purple ball',
+ 'Can you push the green ball behind the red ball',
+ 'Can you push the green ball in front of the blue ball',
+ 'Can you push the green ball in front of the cyan ball',
+ 'Can you push the green ball in front of the purple ball',
+ 'Can you push the green ball in front of the red ball',
+ 'Can you push the green ball to the left of the blue ball',
+ 'Can you push the green ball to the left of the cyan ball',
+ 'Can you push the green ball to the left of the purple ball',
+ 'Can you push the green ball to the left of the red ball',
+ 'Can you push the green ball to the right of the blue ball',
+ 'Can you push the green ball to the right of the cyan ball',
+ 'Can you push the green ball to the right of the purple ball',
+ 'Can you push the green ball to the right of the red ball',
+ 'Can you push the purple ball behind the blue ball',
+ 'Can you push the purple ball behind the cyan ball',
+ 'Can you push the purple ball behind the green ball',
+ 'Can you push the purple ball behind the red ball',
+ 'Can you push the purple ball in front of the blue ball',
+ 'Can you push the purple ball in front of the cyan ball',
+ 'Can you push the purple ball in front of the green ball',
+ 'Can you push the purple ball in front of the red ball',
+ 'Can you push the purple ball to the left of the blue ball',
+ 'Can you push the purple ball to the left of the cyan ball',
+ 'Can you push the purple ball to the left of the green ball',
+ 'Can you push the purple ball to the left of the red ball',
+ 'Can you push the purple ball to the right of the blue ball',
+ 'Can you push the purple ball to the right of the cyan ball',
+ 'Can you push the purple ball to the right of the green ball',
+ 'Can you push the purple ball to the right of the red ball',
+ 'Can you push the red ball behind the blue ball',
+ 'Can you push the red ball behind the cyan ball',
+ 'Can you push the red ball behind the green ball',
+ 'Can you push the red ball behind the purple ball',
+ 'Can you push the red ball in front of the blue ball',
+ 'Can you push the red ball in front of the cyan ball',
+ 'Can you push the red ball in front of the green ball',
+ 'Can you push the red ball in front of the purple ball',
+ 'Can you push the red ball to the left of the blue ball',
+ 'Can you push the red ball to the left of the cyan ball',
+ 'Can you push the red ball to the left of the green ball',
+ 'Can you push the red ball to the left of the purple ball',
+ 'Can you push the red ball to the right of the blue ball',
+ 'Can you push the red ball to the right of the cyan ball',
+ 'Can you push the red ball to the right of the green ball',
+ 'Can you push the red ball to the right of the purple ball',
+ 'Is the blue ball behind the cyan ball',
+ 'Is the blue ball behind the green ball',
+ 'Is the blue ball behind the purple ball',
+ 'Is the blue ball behind the red ball',
+ 'Is the blue ball in front of the cyan ball',
+ 'Is the blue ball in front of the green ball',
+ 'Is the blue ball in front of the purple ball',
+ 'Is the blue ball in front of the red ball',
+ 'Is the blue ball to the left of the cyan ball',
+ 'Is the blue ball to the left of the green ball',
+ 'Is the blue ball to the left of the purple ball',
+ 'Is the blue ball to the left of the red ball',
+ 'Is the blue ball to the right of the cyan ball',
+ 'Is the blue ball to the right of the green ball',
+ 'Is the blue ball to the right of the purple ball',
+ 'Is the blue ball to the right of the red ball',
+ 'Is the cyan ball behind the blue ball',
+ 'Is the cyan ball behind the green ball',
+ 'Is the cyan ball behind the purple ball',
+ 'Is the cyan ball behind the red ball',
+ 'Is the cyan ball in front of the blue ball',
+ 'Is the cyan ball in front of the green ball',
+ 'Is the cyan ball in front of the purple ball',
+ 'Is the cyan ball in front of the red ball',
+ 'Is the cyan ball to the left of the blue ball',
+ 'Is the cyan ball to the left of the green ball',
+ 'Is the cyan ball to the left of the purple ball',
+ 'Is the cyan ball to the left of the red ball',
+ 'Is the cyan ball to the right of the blue ball',
+ 'Is the cyan ball to the right of the green ball',
+ 'Is the cyan ball to the right of the purple ball',
+ 'Is the cyan ball to the right of the red ball',
+ 'Is the green ball behind the blue ball',
+ 'Is the green ball behind the cyan ball',
+ 'Is the green ball behind the purple ball',
+ 'Is the green ball behind the red ball',
+ 'Is the green ball in front of the blue ball',
+ 'Is the green ball in front of the cyan ball',
+ 'Is the green ball in front of the purple ball',
+ 'Is the green ball in front of the red ball',
+ 'Is the green ball to the left of the blue ball',
+ 'Is the green ball to the left of the cyan ball',
+ 'Is the green ball to the left of the purple ball',
+ 'Is the green ball to the left of the red ball',
+ 'Is the green ball to the right of the blue ball',
+ 'Is the green ball to the right of the cyan ball',
+ 'Is the green ball to the right of the purple ball',
+ 'Is the green ball to the right of the red ball',
+ 'Is the purple ball behind the blue ball',
+ 'Is the purple ball behind the cyan ball',
+ 'Is the purple ball behind the green ball',
+ 'Is the purple ball behind the red ball',
+ 'Is the purple ball in front of the blue ball',
+ 'Is the purple ball in front of the cyan ball',
+ 'Is the purple ball in front of the green ball',
+ 'Is the purple ball in front of the red ball',
+ 'Is the purple ball to the left of the blue ball',
+ 'Is the purple ball to the left of the cyan ball',
+ 'Is the purple ball to the left of the green ball',
+ 'Is the purple ball to the left of the red ball',
+ 'Is the purple ball to the right of the blue ball',
+ 'Is the purple ball to the right of the cyan ball',
+ 'Is the purple ball to the right of the green ball',
+ 'Is the purple ball to the right of the red ball',
+ 'Is the red ball behind the blue ball',
+ 'Is the red ball behind the cyan ball',
+ 'Is the red ball behind the green ball',
+ 'Is the red ball behind the purple ball',
+ 'Is the red ball in front of the blue ball',
+ 'Is the red ball in front of the cyan ball',
+ 'Is the red ball in front of the green ball',
+ 'Is the red ball in front of the purple ball',
+ 'Is the red ball to the left of the blue ball',
+ 'Is the red ball to the left of the cyan ball',
+ 'Is the red ball to the left of the green ball',
+ 'Is the red ball to the left of the purple ball',
+ 'Is the red ball to the right of the blue ball',
+ 'Is the red ball to the right of the cyan ball',
+ 'Is the red ball to the right of the green ball',
+ 'Is the red ball to the right of the purple ball',
+ 'Is there any blue ball behind the cyan ball',
+ 'Is there any blue ball behind the green ball',
+ 'Is there any blue ball behind the purple ball',
+ 'Is there any blue ball behind the red ball',
+ 'Is there any blue ball in front of the cyan ball',
+ 'Is there any blue ball in front of the green ball',
+ 'Is there any blue ball in front of the purple ball',
+ 'Is there any blue ball in front of the red ball',
+ 'Is there any blue ball to the left of the cyan ball',
+ 'Is there any blue ball to the left of the green ball',
+ 'Is there any blue ball to the left of the purple ball',
+ 'Is there any blue ball to the left of the red ball',
+ 'Is there any blue ball to the right of the cyan ball',
+ 'Is there any blue ball to the right of the green ball',
+ 'Is there any blue ball to the right of the purple ball',
+ 'Is there any blue ball to the right of the red ball',
+ 'Is there any cyan ball behind the blue ball',
+ 'Is there any cyan ball behind the green ball',
+ 'Is there any cyan ball behind the purple ball',
+ 'Is there any cyan ball behind the red ball',
+ 'Is there any cyan ball in front of the blue ball',
+ 'Is there any cyan ball in front of the green ball',
+ 'Is there any cyan ball in front of the purple ball',
+ 'Is there any cyan ball in front of the red ball',
+ 'Is there any cyan ball to the left of the blue ball',
+ 'Is there any cyan ball to the left of the green ball',
+ 'Is there any cyan ball to the left of the purple ball',
+ 'Is there any cyan ball to the left of the red ball',
+ 'Is there any cyan ball to the right of the blue ball',
+ 'Is there any cyan ball to the right of the green ball',
+ 'Is there any cyan ball to the right of the purple ball',
+ 'Is there any cyan ball to the right of the red ball',
+ 'Is there any green ball behind the blue ball',
+ 'Is there any green ball behind the cyan ball',
+ 'Is there any green ball behind the purple ball',
+ 'Is there any green ball behind the red ball',
+ 'Is there any green ball in front of the blue ball',
+ 'Is there any green ball in front of the cyan ball',
+ 'Is there any green ball in front of the purple ball',
+ 'Is there any green ball in front of the red ball',
+ 'Is there any green ball to the left of the blue ball',
+ 'Is there any green ball to the left of the cyan ball',
+ 'Is there any green ball to the left of the purple ball',
+ 'Is there any green ball to the left of the red ball',
+ 'Is there any green ball to the right of the blue ball',
+ 'Is there any green ball to the right of the cyan ball',
+ 'Is there any green ball to the right of the purple ball',
+ 'Is there any green ball to the right of the red ball',
+ 'Is there any purple ball behind the blue ball',
+ 'Is there any purple ball behind the cyan ball',
+ 'Is there any purple ball behind the green ball',
+ 'Is there any purple ball behind the red ball',
+ 'Is there any purple ball in front of the blue ball',
+ 'Is there any purple ball in front of the cyan ball',
+ 'Is there any purple ball in front of the green ball',
+ 'Is there any purple ball in front of the red ball',
+ 'Is there any purple ball to the left of the blue ball',
+ 'Is there any purple ball to the left of the cyan ball',
+ 'Is there any purple ball to the left of the green ball',
+ 'Is there any purple ball to the left of the red ball',
+ 'Is there any purple ball to the right of the blue ball',
+ 'Is there any purple ball to the right of the cyan ball',
+ 'Is there any purple ball to the right of the green ball',
+ 'Is there any purple ball to the right of the red ball',
+ 'Is there any red ball behind the blue ball',
+ 'Is there any red ball behind the cyan ball',
+ 'Is there any red ball behind the green ball',
+ 'Is there any red ball behind the purple ball',
+ 'Is there any red ball in front of the blue ball',
+ 'Is there any red ball in front of the cyan ball',
+ 'Is there any red ball in front of the green ball',
+ 'Is there any red ball in front of the purple ball',
+ 'Is there any red ball to the left of the blue ball',
+ 'Is there any red ball to the left of the cyan ball',
+ 'Is there any red ball to the left of the green ball',
+ 'Is there any red ball to the left of the purple ball',
+ 'Is there any red ball to the right of the blue ball',
+ 'Is there any red ball to the right of the cyan ball',
+ 'Is there any red ball to the right of the green ball',
+ 'Is there any red ball to the right of the purple ball',
+ 'Push the blue ball behind the cyan ball',
+ 'Push the blue ball behind the green ball',
+ 'Push the blue ball behind the purple ball',
+ 'Push the blue ball behind the red ball',
+ 'Push the blue ball in front of the cyan ball',
+ 'Push the blue ball in front of the green ball',
+ 'Push the blue ball in front of the purple ball',
+ 'Push the blue ball in front of the red ball',
+ 'Push the blue ball to the left of the cyan ball',
+ 'Push the blue ball to the left of the green ball',
+ 'Push the blue ball to the left of the purple ball',
+ 'Push the blue ball to the left of the red ball',
+ 'Push the blue ball to the right of the cyan ball',
+ 'Push the blue ball to the right of the green ball',
+ 'Push the blue ball to the right of the purple ball',
+ 'Push the blue ball to the right of the red ball',
+ 'Push the cyan ball behind the blue ball',
+ 'Push the cyan ball behind the green ball',
+ 'Push the cyan ball behind the purple ball',
+ 'Push the cyan ball behind the red ball',
+ 'Push the cyan ball in front of the blue ball',
+ 'Push the cyan ball in front of the green ball',
+ 'Push the cyan ball in front of the purple ball',
+ 'Push the cyan ball in front of the red ball',
+ 'Push the cyan ball to the left of the blue ball',
+ 'Push the cyan ball to the left of the green ball',
+ 'Push the cyan ball to the left of the purple ball',
+ 'Push the cyan ball to the left of the red ball',
+ 'Push the cyan ball to the right of the blue ball',
+ 'Push the cyan ball to the right of the green ball',
+ 'Push the cyan ball to the right of the purple ball',
+ 'Push the cyan ball to the right of the red ball',
+ 'Push the green ball behind the blue ball',
+ 'Push the green ball behind the cyan ball',
+ 'Push the green ball behind the purple ball',
+ 'Push the green ball behind the red ball',
+ 'Push the green ball in front of the blue ball',
+ 'Push the green ball in front of the cyan ball',
+ 'Push the green ball in front of the purple ball',
+ 'Push the green ball in front of the red ball',
+ 'Push the green ball to the left of the blue ball',
+ 'Push the green ball to the left of the cyan ball',
+ 'Push the green ball to the left of the purple ball',
+ 'Push the green ball to the left of the red ball',
+ 'Push the green ball to the right of the blue ball',
+ 'Push the green ball to the right of the cyan ball',
+ 'Push the green ball to the right of the purple ball',
+ 'Push the green ball to the right of the red ball',
+ 'Push the purple ball behind the blue ball',
+ 'Push the purple ball behind the cyan ball',
+ 'Push the purple ball behind the green ball',
+ 'Push the purple ball behind the red ball',
+ 'Push the purple ball in front of the blue ball',
+ 'Push the purple ball in front of the cyan ball',
+ 'Push the purple ball in front of the green ball',
+ 'Push the purple ball in front of the red ball',
+ 'Push the purple ball to the left of the blue ball',
+ 'Push the purple ball to the left of the cyan ball',
+ 'Push the purple ball to the left of the green ball',
+ 'Push the purple ball to the left of the red ball',
+ 'Push the purple ball to the right of the blue ball',
+ 'Push the purple ball to the right of the cyan ball',
+ 'Push the purple ball to the right of the green ball',
+ 'Push the purple ball to the right of the red ball',
+ 'Push the red ball behind the blue ball',
+ 'Push the red ball behind the cyan ball',
+ 'Push the red ball behind the green ball',
+ 'Push the red ball behind the purple ball',
+ 'Push the red ball in front of the blue ball',
+ 'Push the red ball in front of the cyan ball',
+ 'Push the red ball in front of the green ball',
+ 'Push the red ball in front of the purple ball',
+ 'Push the red ball to the left of the blue ball',
+ 'Push the red ball to the left of the cyan ball',
+ 'Push the red ball to the left of the green ball',
+ 'Push the red ball to the left of the purple ball',
+ 'Push the red ball to the right of the blue ball',
+ 'Push the red ball to the right of the cyan ball',
+ 'Push the red ball to the right of the green ball',
+ 'Push the red ball to the right of the purple ball',
+ 'The blue ball is being pushed behind the cyan ball',
+ 'The blue ball is being pushed behind the green ball',
+ 'The blue ball is being pushed behind the purple ball',
+ 'The blue ball is being pushed behind the red ball',
+ 'The blue ball is being pushed in front of the cyan ball',
+ 'The blue ball is being pushed in front of the green ball',
+ 'The blue ball is being pushed in front of the purple ball',
+ 'The blue ball is being pushed in front of the red ball',
+ 'The blue ball is being pushed to the left of the cyan ball',
+ 'The blue ball is being pushed to the left of the green ball',
+ 'The blue ball is being pushed to the left of the purple ball',
+ 'The blue ball is being pushed to the left of the red ball',
+ 'The blue ball is being pushed to the right of the cyan ball',
+ 'The blue ball is being pushed to the right of the green ball',
+ 'The blue ball is being pushed to the right of the purple ball',
+ 'The blue ball is being pushed to the right of the red ball',
+ 'The blue ball is pushed behind the cyan ball',
+ 'The blue ball is pushed behind the green ball',
+ 'The blue ball is pushed behind the purple ball',
+ 'The blue ball is pushed behind the red ball',
+ 'The blue ball is pushed in front of the cyan ball',
+ 'The blue ball is pushed in front of the green ball',
+ 'The blue ball is pushed in front of the purple ball',
+ 'The blue ball is pushed in front of the red ball',
+ 'The blue ball is pushed to the left of the cyan ball',
+ 'The blue ball is pushed to the left of the green ball',
+ 'The blue ball is pushed to the left of the purple ball',
+ 'The blue ball is pushed to the left of the red ball',
+ 'The blue ball is pushed to the right of the cyan ball',
+ 'The blue ball is pushed to the right of the green ball',
+ 'The blue ball is pushed to the right of the purple ball',
+ 'The blue ball is pushed to the right of the red ball',
+ 'The blue ball moves behind the cyan ball',
+ 'The blue ball moves behind the green ball',
+ 'The blue ball moves behind the purple ball',
+ 'The blue ball moves behind the red ball',
+ 'The blue ball moves in front of the cyan ball',
+ 'The blue ball moves in front of the green ball',
+ 'The blue ball moves in front of the purple ball',
+ 'The blue ball moves in front of the red ball',
+ 'The blue ball moves to the left of the cyan ball',
+ 'The blue ball moves to the left of the green ball',
+ 'The blue ball moves to the left of the purple ball',
+ 'The blue ball moves to the left of the red ball',
+ 'The blue ball moves to the right of the cyan ball',
+ 'The blue ball moves to the right of the green ball',
+ 'The blue ball moves to the right of the purple ball',
+ 'The blue ball moves to the right of the red ball',
+ 'The blue ball was moved behind the cyan ball',
+ 'The blue ball was moved behind the green ball',
+ 'The blue ball was moved behind the purple ball',
+ 'The blue ball was moved behind the red ball',
+ 'The blue ball was moved in front of the cyan ball',
+ 'The blue ball was moved in front of the green ball',
+ 'The blue ball was moved in front of the purple ball',
+ 'The blue ball was moved in front of the red ball',
+ 'The blue ball was moved to the left of the cyan ball',
+ 'The blue ball was moved to the left of the green ball',
+ 'The blue ball was moved to the left of the purple ball',
+ 'The blue ball was moved to the left of the red ball',
+ 'The blue ball was moved to the right of the cyan ball',
+ 'The blue ball was moved to the right of the green ball',
+ 'The blue ball was moved to the right of the purple ball',
+ 'The blue ball was moved to the right of the red ball',
+ 'The cyan ball is being pushed behind the blue ball',
+ 'The cyan ball is being pushed behind the green ball',
+ 'The cyan ball is being pushed behind the purple ball',
+ 'The cyan ball is being pushed behind the red ball',
+ 'The cyan ball is being pushed in front of the blue ball',
+ 'The cyan ball is being pushed in front of the green ball',
+ 'The cyan ball is being pushed in front of the purple ball',
+ 'The cyan ball is being pushed in front of the red ball',
+ 'The cyan ball is being pushed to the left of the blue ball',
+ 'The cyan ball is being pushed to the left of the green ball',
+ 'The cyan ball is being pushed to the left of the purple ball',
+ 'The cyan ball is being pushed to the left of the red ball',
+ 'The cyan ball is being pushed to the right of the blue ball',
+ 'The cyan ball is being pushed to the right of the green ball',
+ 'The cyan ball is being pushed to the right of the purple ball',
+ 'The cyan ball is being pushed to the right of the red ball',
+ 'The cyan ball is pushed behind the blue ball',
+ 'The cyan ball is pushed behind the green ball',
+ 'The cyan ball is pushed behind the purple ball',
+ 'The cyan ball is pushed behind the red ball',
+ 'The cyan ball is pushed in front of the blue ball',
+ 'The cyan ball is pushed in front of the green ball',
+ 'The cyan ball is pushed in front of the purple ball',
+ 'The cyan ball is pushed in front of the red ball',
+ 'The cyan ball is pushed to the left of the blue ball',
+ 'The cyan ball is pushed to the left of the green ball',
+ 'The cyan ball is pushed to the left of the purple ball',
+ 'The cyan ball is pushed to the left of the red ball',
+ 'The cyan ball is pushed to the right of the blue ball',
+ 'The cyan ball is pushed to the right of the green ball',
+ 'The cyan ball is pushed to the right of the purple ball',
+ 'The cyan ball is pushed to the right of the red ball',
+ 'The cyan ball moves behind the blue ball',
+ 'The cyan ball moves behind the green ball',
+ 'The cyan ball moves behind the purple ball',
+ 'The cyan ball moves behind the red ball',
+ 'The cyan ball moves in front of the blue ball',
+ 'The cyan ball moves in front of the green ball',
+ 'The cyan ball moves in front of the purple ball',
+ 'The cyan ball moves in front of the red ball',
+ 'The cyan ball moves to the left of the blue ball',
+ 'The cyan ball moves to the left of the green ball',
+ 'The cyan ball moves to the left of the purple ball',
+ 'The cyan ball moves to the left of the red ball',
+ 'The cyan ball moves to the right of the blue ball',
+ 'The cyan ball moves to the right of the green ball',
+ 'The cyan ball moves to the right of the purple ball',
+ 'The cyan ball moves to the right of the red ball',
+ 'The cyan ball was moved behind the blue ball',
+ 'The cyan ball was moved behind the green ball',
+ 'The cyan ball was moved behind the purple ball',
+ 'The cyan ball was moved behind the red ball',
+ 'The cyan ball was moved in front of the blue ball',
+ 'The cyan ball was moved in front of the green ball',
+ 'The cyan ball was moved in front of the purple ball',
+ 'The cyan ball was moved in front of the red ball',
+ 'The cyan ball was moved to the left of the blue ball',
+ 'The cyan ball was moved to the left of the green ball',
+ 'The cyan ball was moved to the left of the purple ball',
+ 'The cyan ball was moved to the left of the red ball',
+ 'The cyan ball was moved to the right of the blue ball',
+ 'The cyan ball was moved to the right of the green ball',
+ 'The cyan ball was moved to the right of the purple ball',
+ 'The cyan ball was moved to the right of the red ball',
+ 'The green ball is being pushed behind the blue ball',
+ 'The green ball is being pushed behind the cyan ball',
+ 'The green ball is being pushed behind the purple ball',
+ 'The green ball is being pushed behind the red ball',
+ 'The green ball is being pushed in front of the blue ball',
+ 'The green ball is being pushed in front of the cyan ball',
+ 'The green ball is being pushed in front of the purple ball',
+ 'The green ball is being pushed in front of the red ball',
+ 'The green ball is being pushed to the left of the blue ball',
+ 'The green ball is being pushed to the left of the cyan ball',
+ 'The green ball is being pushed to the left of the purple ball',
+ 'The green ball is being pushed to the left of the red ball',
+ 'The green ball is being pushed to the right of the blue ball',
+ 'The green ball is being pushed to the right of the cyan ball',
+ 'The green ball is being pushed to the right of the purple ball',
+ 'The green ball is being pushed to the right of the red ball',
+ 'The green ball is pushed behind the blue ball',
+ 'The green ball is pushed behind the cyan ball',
+ 'The green ball is pushed behind the purple ball',
+ 'The green ball is pushed behind the red ball',
+ 'The green ball is pushed in front of the blue ball',
+ 'The green ball is pushed in front of the cyan ball',
+ 'The green ball is pushed in front of the purple ball',
+ 'The green ball is pushed in front of the red ball',
+ 'The green ball is pushed to the left of the blue ball',
+ 'The green ball is pushed to the left of the cyan ball',
+ 'The green ball is pushed to the left of the purple ball',
+ 'The green ball is pushed to the left of the red ball',
+ 'The green ball is pushed to the right of the blue ball',
+ 'The green ball is pushed to the right of the cyan ball',
+ 'The green ball is pushed to the right of the purple ball',
+ 'The green ball is pushed to the right of the red ball',
+ 'The green ball moves behind the blue ball',
+ 'The green ball moves behind the cyan ball',
+ 'The green ball moves behind the purple ball',
+ 'The green ball moves behind the red ball',
+ 'The green ball moves in front of the blue ball',
+ 'The green ball moves in front of the cyan ball',
+ 'The green ball moves in front of the purple ball',
+ 'The green ball moves in front of the red ball',
+ 'The green ball moves to the left of the blue ball',
+ 'The green ball moves to the left of the cyan ball',
+ 'The green ball moves to the left of the purple ball',
+ 'The green ball moves to the left of the red ball',
+ 'The green ball moves to the right of the blue ball',
+ 'The green ball moves to the right of the cyan ball',
+ 'The green ball moves to the right of the purple ball',
+ 'The green ball moves to the right of the red ball',
+ 'The green ball was moved behind the blue ball',
+ 'The green ball was moved behind the cyan ball',
+ 'The green ball was moved behind the purple ball',
+ 'The green ball was moved behind the red ball',
+ 'The green ball was moved in front of the blue ball',
+ 'The green ball was moved in front of the cyan ball',
+ 'The green ball was moved in front of the purple ball',
+ 'The green ball was moved in front of the red ball',
+ 'The green ball was moved to the left of the blue ball',
+ 'The green ball was moved to the left of the cyan ball',
+ 'The green ball was moved to the left of the purple ball',
+ 'The green ball was moved to the left of the red ball',
+ 'The green ball was moved to the right of the blue ball',
+ 'The green ball was moved to the right of the cyan ball',
+ 'The green ball was moved to the right of the purple ball',
+ 'The green ball was moved to the right of the red ball',
+ 'The purple ball is being pushed behind the blue ball',
+ 'The purple ball is being pushed behind the cyan ball',
+ 'The purple ball is being pushed behind the green ball',
+ 'The purple ball is being pushed behind the red ball',
+ 'The purple ball is being pushed in front of the blue ball',
+ 'The purple ball is being pushed in front of the cyan ball',
+ 'The purple ball is being pushed in front of the green ball',
+ 'The purple ball is being pushed in front of the red ball',
+ 'The purple ball is being pushed to the left of the blue ball',
+ 'The purple ball is being pushed to the left of the cyan ball',
+ 'The purple ball is being pushed to the left of the green ball',
+ 'The purple ball is being pushed to the left of the red ball',
+ 'The purple ball is being pushed to the right of the blue ball',
+ 'The purple ball is being pushed to the right of the cyan ball',
+ 'The purple ball is being pushed to the right of the green ball',
+ 'The purple ball is being pushed to the right of the red ball',
+ 'The purple ball is pushed behind the blue ball',
+ 'The purple ball is pushed behind the cyan ball',
+ 'The purple ball is pushed behind the green ball',
+ 'The purple ball is pushed behind the red ball',
+ 'The purple ball is pushed in front of the blue ball',
+ 'The purple ball is pushed in front of the cyan ball',
+ 'The purple ball is pushed in front of the green ball',
+ 'The purple ball is pushed in front of the red ball',
+ 'The purple ball is pushed to the left of the blue ball',
+ 'The purple ball is pushed to the left of the cyan ball',
+ 'The purple ball is pushed to the left of the green ball',
+ 'The purple ball is pushed to the left of the red ball',
+ 'The purple ball is pushed to the right of the blue ball',
+ 'The purple ball is pushed to the right of the cyan ball',
+ 'The purple ball is pushed to the right of the green ball',
+ 'The purple ball is pushed to the right of the red ball',
+ 'The purple ball moves behind the blue ball',
+ 'The purple ball moves behind the cyan ball',
+ 'The purple ball moves behind the green ball',
+ 'The purple ball moves behind the red ball',
+ 'The purple ball moves in front of the blue ball',
+ 'The purple ball moves in front of the cyan ball',
+ 'The purple ball moves in front of the green ball',
+ 'The purple ball moves in front of the red ball',
+ 'The purple ball moves to the left of the blue ball',
+ 'The purple ball moves to the left of the cyan ball',
+ 'The purple ball moves to the left of the green ball',
+ 'The purple ball moves to the left of the red ball',
+ 'The purple ball moves to the right of the blue ball',
+ 'The purple ball moves to the right of the cyan ball',
+ 'The purple ball moves to the right of the green ball',
+ 'The purple ball moves to the right of the red ball',
+ 'The purple ball was moved behind the blue ball',
+ 'The purple ball was moved behind the cyan ball',
+ 'The purple ball was moved behind the green ball',
+ 'The purple ball was moved behind the red ball',
+ 'The purple ball was moved in front of the blue ball',
+ 'The purple ball was moved in front of the cyan ball',
+ 'The purple ball was moved in front of the green ball',
+ 'The purple ball was moved in front of the red ball',
+ 'The purple ball was moved to the left of the blue ball',
+ 'The purple ball was moved to the left of the cyan ball',
+ 'The purple ball was moved to the left of the green ball',
+ 'The purple ball was moved to the left of the red ball',
+ 'The purple ball was moved to the right of the blue ball',
+ 'The purple ball was moved to the right of the cyan ball',
+ 'The purple ball was moved to the right of the green ball',
+ 'The purple ball was moved to the right of the red ball',
+ 'The red ball is being pushed behind the blue ball',
+ 'The red ball is being pushed behind the cyan ball',
+ 'The red ball is being pushed behind the green ball',
+ 'The red ball is being pushed behind the purple ball',
+ 'The red ball is being pushed in front of the blue ball',
+ 'The red ball is being pushed in front of the cyan ball',
+ 'The red ball is being pushed in front of the green ball',
+ 'The red ball is being pushed in front of the purple ball',
+ 'The red ball is being pushed to the left of the blue ball',
+ 'The red ball is being pushed to the left of the cyan ball',
+ 'The red ball is being pushed to the left of the green ball',
+ 'The red ball is being pushed to the left of the purple ball',
+ 'The red ball is being pushed to the right of the blue ball',
+ 'The red ball is being pushed to the right of the cyan ball',
+ 'The red ball is being pushed to the right of the green ball',
+ 'The red ball is being pushed to the right of the purple ball',
+ 'The red ball is pushed behind the blue ball',
+ 'The red ball is pushed behind the cyan ball',
+ 'The red ball is pushed behind the green ball',
+ 'The red ball is pushed behind the purple ball',
+ 'The red ball is pushed in front of the blue ball',
+ 'The red ball is pushed in front of the cyan ball',
+ 'The red ball is pushed in front of the green ball',
+ 'The red ball is pushed in front of the purple ball',
+ 'The red ball is pushed to the left of the blue ball',
+ 'The red ball is pushed to the left of the cyan ball',
+ 'The red ball is pushed to the left of the green ball',
+ 'The red ball is pushed to the left of the purple ball',
+ 'The red ball is pushed to the right of the blue ball',
+ 'The red ball is pushed to the right of the cyan ball',
+ 'The red ball is pushed to the right of the green ball',
+ 'The red ball is pushed to the right of the purple ball',
+ 'The red ball moves behind the blue ball',
+ 'The red ball moves behind the cyan ball',
+ 'The red ball moves behind the green ball',
+ 'The red ball moves behind the purple ball',
+ 'The red ball moves in front of the blue ball',
+ 'The red ball moves in front of the cyan ball',
+ 'The red ball moves in front of the green ball',
+ 'The red ball moves in front of the purple ball',
+ 'The red ball moves to the left of the blue ball',
+ 'The red ball moves to the left of the cyan ball',
+ 'The red ball moves to the left of the green ball',
+ 'The red ball moves to the left of the purple ball',
+ 'The red ball moves to the right of the blue ball',
+ 'The red ball moves to the right of the cyan ball',
+ 'The red ball moves to the right of the green ball',
+ 'The red ball moves to the right of the purple ball',
+ 'The red ball was moved behind the blue ball',
+ 'The red ball was moved behind the cyan ball',
+ 'The red ball was moved behind the green ball',
+ 'The red ball was moved behind the purple ball',
+ 'The red ball was moved in front of the blue ball',
+ 'The red ball was moved in front of the cyan ball',
+ 'The red ball was moved in front of the green ball',
+ 'The red ball was moved in front of the purple ball',
+ 'The red ball was moved to the left of the blue ball',
+ 'The red ball was moved to the left of the cyan ball',
+ 'The red ball was moved to the left of the green ball',
+ 'The red ball was moved to the left of the purple ball',
+ 'The red ball was moved to the right of the blue ball',
+ 'The red ball was moved to the right of the cyan ball',
+ 'The red ball was moved to the right of the green ball',
+ 'The red ball was moved to the right of the purple ball'}
+
NAME = "t5-v1_1-xxl"
-anns = sum(json.load(open("/data2/eddie/calvin/annotations.json")).values(), [])
+anns = list(unique_z)
embeds = {}
+
+
embeddings = t5_encode_text(anns, name=f"google/{NAME}")
for a, e in zip(anns, embeddings):
embeds[a] = e.cpu()
-torch.save(embeds, f"{NAME}_embeddings.pt")
+
+
+torch.save(embeds, f"clevr_{NAME}_embeddings.pt")
+
+# final = {}
+# for k in d:
+# final[k] = embed[d[k]]
+
+# torch.save(final, f"clevr_{NAME}_direct_embeddings.pt")
diff --git a/src/lcd/utils/training.py b/src/lcd/utils/training.py
index c2e17a1..966ba33 100644
--- a/src/lcd/utils/training.py
+++ b/src/lcd/utils/training.py
@@ -51,6 +51,7 @@ class Trainer:
self,
diffusion_model,
dataset,
+ val_dataset,
ema_decay=0.995,
train_batch_size=32,
train_lr=2e-5,
@@ -58,6 +59,7 @@ class Trainer:
step_start_ema=2000,
update_ema_every=10,
log_freq=100,
+ validation_freq=100,
sample_freq=1000,
save_freq=1000,
label_freq=100000,
@@ -71,7 +73,7 @@ class Trainer:
self.ema = EMA(ema_decay)
self.ema_model = copy.deepcopy(self.model)
self.update_ema_every = update_ema_every
-
+ self.validation_freq = validation_freq
self.step_start_ema = step_start_ema
self.log_freq = log_freq
self.sample_freq = sample_freq
@@ -92,6 +94,17 @@ class Trainer:
pin_memory=True,
)
)
+
+ self.val_dataset = val_dataset
+ self.val_dataloader = cycle(
+ torch.utils.data.DataLoader(
+ self.dataset,
+ batch_size=train_batch_size,
+ num_workers=1,
+ shuffle=True,
+ pin_memory=True,
+ )
+ )
self.dataloader_vis = cycle(
torch.utils.data.DataLoader(
self.dataset, batch_size=1, num_workers=0, shuffle=True, pin_memory=True
@@ -138,6 +151,15 @@ class Trainer:
self.optimizer.step()
self.optimizer.zero_grad()
+ if self.step % self.validation_freq == 0:
+ batch = next(self.val_dataloader)
+ batch = batch_to_device(batch)
+ if isinstance(batch, Batch):
+ loss, infos = self.model.loss(*batch)
+ else:
+ loss, infos = self.model.loss(*batch[0], **batch[1])
+ wlog({"val/loss": loss, **infos})
+
if self.step % self.update_ema_every == 0:
self.step_ema()
diff --git a/submodules/data b/submodules/data
index 7776fef..89f6b5b 160000
--- a/submodules/data
+++ b/submodules/data
@@ -1 +1 @@
-Subproject commit 7776fef1cbdede520b049f1a8c3a2c632971966c
+Subproject commit 89f6b5b54efd6b560881e090602ec57f820ca935-dirty
diff --git a/submodules/talar-openreview-fork b/submodules/talar-openreview-fork
index d36bbf7..83416d7 160000
--- a/submodules/talar-openreview-fork
+++ b/submodules/talar-openreview-fork
@@ -1 +1 @@
-Subproject commit d36bbf7be863298a3b3d0d27e5ffc75963ff0cfc
+Subproject commit 83416d76fa9a782dcd0a00a0e673b73a3a224fb4-dirty