Skip to content

Conversation

@Raj7shekhar
Copy link

The mel_filters function was successfully migrated to Keras ops, replacing NumPy. All tests now pass, ensuring consistent performance within the Keras framework.

Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format the code!


try:
import tensorflow as tf
import keras.ops as ops
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to import keras conditionally. We don't want to assume tf is install, we can assume keras is installed.

}
)
return config
return config No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't remove training newline




def _get_rfftfreq_keras(self): # Inside the class definition
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this comment support to mean?

@@ -92,25 +108,15 @@ def _get_mel_filters(self):

# TODO: Convert to TensorFlow ops (if possible).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this TODO I think.

logstep * (mels[log_t] - min_log_mel)
)

freqs = ops.where(log_t, min_log_hz * ops.exp(logstep * (mels - min_log_mel)), freqs) # using tf.where for conditional replacement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the comment, and reformat to 80 chars


fdiff = np.diff(mel_f)
ramps = np.subtract.outer(mel_f, fftfreqs)
fdiff = mel_f[1:] - mel_f[:-1] #keras diff.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these comments

@sachinprasadhs sachinprasadhs added the WIP Pull requests which are work in progress and not ready yet for review. label Apr 11, 2025
@sachinprasadhs
Copy link
Collaborator

Closing this since there is a continuation PR created for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Pull requests which are work in progress and not ready yet for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants