model_idx_stage2=49999 #799
model_idx_stage3=49999
first_stage_folder_name=EGFR
second_stage_folder_name=EGFR_extra_inner_layer_adam_finetuning_stage2
third_stage_folder_name=EGFR_extra_inner_layer_adam_finetuning_stage3
for seed in 1 2 3 4 5
do
	python train_vae_latent.py $third_stage_folder_name --refine_type whole --sample_size 1000 --encoder_layer_sizes "1024|1024|1024|1024|1024" --layer_sizes "1024|1024|1024|1024|1024" -e -5 --seed $seed --square --data_file outputs/${first_stage_folder_name}/latent_mean_var --sample model.${model_idx_stage3}.pkl --output_latent_file stage3_latent_samples.${model_idx_stage3}.${seed}.npy
	cp 2_stage_vae/${third_stage_folder_name}/stage3_latent_samples.${model_idx_stage3}.${seed}.npy 2_stage_vae/${second_stage_folder_name}/
	python train_vae_latent.py $second_stage_folder_name --refine_type whole --sample_size 1000 --encoder_layer_sizes "1024|1024|1024|1024|1024" --layer_sizes "1024|1024|1024|1024|1024" -e -5 --square --seed $seed --data_file outputs/${first_stage_folder_name}/latent_mean_var --sample model.${model_idx_stage2}.pkl --output_latent_file stage2_latent_samples.${model_idx_stage2}.${seed}.npy --input_latent_file stage3_latent_samples.${model_idx_stage3}.${seed}.npy
	rm outputs/$first_stage_folder_name/*.npy
	cp 2_stage_vae/${second_stage_folder_name}/stage2_latent_samples.${model_idx_stage2}.${seed}.npy outputs/${first_stage_folder_name}/
	molecule_generation sample outputs/${first_stage_folder_name}/ 1000 > outputs/${first_stage_folder_name}/3stage_samples_extra_inner_layer_adam_finetuning_${model_idx_stage2}_${model_idx_stage3}.${seed}.txt
done

