mirror of
				https://github.com/facebookresearch/pytorch3d.git
				synced 2025-11-04 18:02:14 +08:00 
			
		
		
		
	nesting n_known_frames_for_test
Summary: Use generator.permutation instead of choice so that different options for n_known_frames_for_test are nested. Reviewed By: davnov134 Differential Revision: D37210906 fbshipit-source-id: fd0d34ce62260417c3f63354a3f750aae9998b0d
This commit is contained in:
		
							parent
							
								
									cba26506b6
								
							
						
					
					
						commit
						28c1afaa9d
					
				@ -116,9 +116,11 @@ class SingleSceneDatasetMapProviderBase(DatasetMapProviderBase):
 | 
			
		||||
            if set_eval_batches:
 | 
			
		||||
                generator = np.random.default_rng(seed=0)
 | 
			
		||||
                for batch in eval_batches:
 | 
			
		||||
                    to_add = generator.choice(
 | 
			
		||||
                        len(train_split), self.n_known_frames_for_test
 | 
			
		||||
                    )
 | 
			
		||||
                    # using permutation so that changes to n_known_frames_for_test
 | 
			
		||||
                    # result in consistent batches.
 | 
			
		||||
                    to_add = generator.permutation(len(train_split))[
 | 
			
		||||
                        : self.n_known_frames_for_test
 | 
			
		||||
                    ]
 | 
			
		||||
                    batch.extend((to_add + len(split)).tolist())
 | 
			
		||||
            split = np.concatenate([split, train_split])
 | 
			
		||||
            frame_types.extend([DATASET_TYPE_KNOWN] * len(train_split))
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user