MCPcopy Create free account
hub / github.com/akira-l/SEEG / unnormalize_data

Method unnormalize_data

scripts/data_loader/data_preprocessor.py:191–215  ·  view source on GitHub ↗

this method is from https://github.com/asheshjain399/RNNexp/blob/srnn/structural_rnn/CRFProblems/H3.6m/generateMotionData.py#L12

(normalized_data, data_mean, data_std, dimensions_to_ignore)

Source from the content-addressed store, hash-verified

189
190 @staticmethod
191 def unnormalize_data(normalized_data, data_mean, data_std, dimensions_to_ignore):
192 """
193 this method is from https://github.com/asheshjain399/RNNexp/blob/srnn/structural_rnn/CRFProblems/H3.6m/generateMotionData.py#L12
194 """
195 T = normalized_data.shape[0]
196 D = data_mean.shape[0]
197
198 origData = np.zeros((T, D), dtype=np.float32)
199 dimensions_to_use = []
200 for i in range(D):
201 if i in dimensions_to_ignore:
202 continue
203 dimensions_to_use.append(i)
204 dimensions_to_use = np.array(dimensions_to_use)
205
206 origData[:, dimensions_to_use] = normalized_data
207
208 # potentially inefficient, but only done once per experiment
209 stdMat = data_std.reshape((1, D))
210 stdMat = np.repeat(stdMat, T, axis=0)
211 meanMat = data_mean.reshape((1, D))
212 meanMat = np.repeat(meanMat, T, axis=0)
213 origData = np.multiply(origData, stdMat) + meanMat
214
215 return origData

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected