Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keras dev example #477

Merged
merged 12 commits into from
Aug 14, 2023
Merged

Conversation

Onoyiza
Copy link
Contributor

@Onoyiza Onoyiza commented Aug 11, 2023

Hi @pgleeson.

I have done the following:

  • Updated the keras_to_mdf function to include the activation within the dense node calling on the "add_activation" function
  • After various trials on why the output was not the same for the IRIS dataset I discovered that to handle numeric instability that occurs due to large exponential, Keras first centers the values in the numpy array or tensor around 0 by subtracting by the maximum value before getting the exponential and dividing by its sum. I tried to subtract the max value from the array in the script with the keras_to_mdf function but was unsuccessful because the expression could not be evaluated due to the addition of "max" in the string(expression). The code where I created the expression to be evaluated for subtracting the max value from each value in the array is a comment in the script.
  • I downloaded and ran the notebook(and script) on the 3-D convolutional model on the CT-scan dataset and I have saved the model in h5 format to use to test when I am done creating the respective nodes for the layers (Conv, MaxPool, BatchNorm, GloabalAveragePool, Dropout) in the model. I wanted to successfully get the softmax function to work well before I start creating the nodes for this task but I want unsuccessful with it. I just started working on this since I noticed uses the sigmoid function for classification.

@pgleeson
Copy link
Member

Thanks @Onoyiza. Merging in current changes and will test locally also.

@pgleeson pgleeson merged commit db5c3ed into ModECI:keras_interface Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants