def nn_preprocesing ( intensity_data , w a ve nu m be r_ ax i s ) : intensity_data = v . reshape ( -1 , intensi ty_data . shape [ -1]) output = model ( torch . Tensor ( inten sity_da ta ) . unsqueeze (1) ) . cpu () . detach () . numpy () output = np . squeeze ( output ) . reshape ( intensi ty_data . shape ) return output , w a ve nu m be r_ ax i s nn_denoiser = ramanspy . preprocessing . P r e p r o c e s s i n g S t e p ( nn _ pr ep ro c es in g ) Integrated methods are automatically rendered fully compatible with the rest of RamanSPy's functionalities in the background, so one can simply use the apply() method of the constructed denoiser to preprocess any data loaded within RamanSPy as any built-in preprocessing class.