2028dffb2a29570c72f10bcb3e35e33fa7fb1c03,finetune/base.py,BaseModel,_inference,#BaseModel#Any#Any#,214

Before Change


        input_func = self.input_pipeline.get_predict_input_fn(Xs)
        length = len(Xs) if not callable(Xs) else None

        pred_gen = list(
            map(
                lambda y: y[mode] if mode else y,
                tqdm.tqdm(
                    estimator.predict(
                        input_fn=input_func, predict_keys=mode
                    ),
                    total=length,
                    desc="Inference"
                )
            )
        )
        return pred_gen

    def fit(self, *args, **kwargs):
         An alias for finetune. 

After Change


        self._data = self.input_pipeline._format_for_inference(Xs)
        self._iter_idx = 0

        n = len(self._data)

        if not getattr(self, "estimator", None):
            self.estimator = self.get_estimator()
            self._input_fn = lambda: self.input_pipeline._dataset_without_targets(
                self._data_generator, train=None
            ).batch(self.config.batch_size)
            self._predictions = self.estimator.predict(input_fn=self._input_fn)

        predictions = [None] * n
        for i in range(n):
            y = next(self._predictions)
            y = y[mode] if mode else y
            predictions[i] = y
        return predictions
        
    def fit(self, *args, **kwargs):
         An alias for finetune. 
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: IndicoDataSolutions/finetune
Commit Name: 2028dffb2a29570c72f10bcb3e35e33fa7fb1c03
Time: 2018-11-13
Author: madison@indico.io
File Name: finetune/base.py
Class Name: BaseModel
Method Name: _inference


Project Name: deepfakes/faceswap
Commit Name: 0e0b2faa1a205fe276a7c53bc600fca60b239234
Time: 2019-10-28
Author: vrooman.kyle@gmail.com
File Name: tools/sort.py
Class Name: Sort
Method Name: sort_face_cnn_dissim


Project Name: deepfakes/faceswap
Commit Name: 25a2ac95c3b788834db0808307073047747998dd
Time: 2019-10-21
Author: 36920800+torzdf@users.noreply.github.com
File Name: tools/lib_alignments/media.py
Class Name: Faces
Method Name: process_folder