9cf8f6cdf6a2008843cb37da6e34b8d10353b0bf,ml/rl/preprocessing/sparse_to_dense.py,PythonSparseToDenseProcessor,process,#PythonSparseToDenseProcessor#Any#,73

Before Change


        self, sparse_data: List[Dict[int, float]]
    ) -> Tuple[torch.Tensor, torch.Tensor]:
        dense_data = torch.ones([len(sparse_data), len(self.feature_id_to_index)])
        dense_presence = torch.zeros(
            [len(sparse_data), len(self.feature_id_to_index)]
        ).byte()
        for i, feature_map in enumerate(sparse_data):
            assert (
                feature_map is not None
            ), f"Please make sure that features are not NULL; row {i}"

After Change


        state_features_df = pd.DataFrame(sparse_data).fillna(missing_value)
        // Add columns identified by normalization, but not present in batch
        for col in self.sorted_features:
            if col not in state_features_df.columns:
                state_features_df[col] = missing_value
        values = torch.from_numpy(
            state_features_df[self.sorted_features].values
        ).float()
        if self.set_missing_value_to_zero:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: facebookresearch/Horizon
Commit Name: 9cf8f6cdf6a2008843cb37da6e34b8d10353b0bf
Time: 2019-12-12
Author: kittipat@fb.com
File Name: ml/rl/preprocessing/sparse_to_dense.py
Class Name: PythonSparseToDenseProcessor
Method Name: process


Project Name: LxMLS/lxmls-toolkit
Commit Name: 37256b52520b5820c98dcd8a4c4943e898f90b4b
Time: 2013-07-14
Author: andre.t.martins@gmail.com
File Name: code/big_data_em/em_lib.py
Class Name:
Method Name: partial_seq


Project Name: rusty1s/pytorch_geometric
Commit Name: 9e2a150b630e08a7037c1fd19e01cd5206e84a24
Time: 2020-01-17
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transforms/grid_sampling.py
Class Name: GridSampling
Method Name: __call__