Uploaded image for project: 'Apache MADlib'
  1. Apache MADlib
  2. MADLIB-1309

Change the way we pass compile_params and fit_params to madlib_keras.fit and madlib_keras.predict

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • v1.16
    • Deep Learning
    • None

    Description

      Based on the code in PR https://github.com/apache/madlib/pull/355:

      Currently we have to pass in the compile_params and fit_params as follows

      SELECT madlib.madlib_keras_fit(... , '''optimizer''=SGD(lr=0.01, decay=1e-6, nesterov=True), ''loss''=''categorical_crossentropy'', ''metrics''=[''accuracy'']'::text,
       ,'''batch_size''=2, ''epochs''=1, ''verbose''=0'::text ...)
      

      Internally in the code we use a function called `convert_string_of_args_to_dict` which does some string parsing and then calls eval to create a dictionary. This is bug prone and unsafe. We should look into using the function `extract_keyvalue_params` (might have to change it. We can easily write a unit test for `extract_keyvalue_params`)

      We should also think about how complicated compile_params can get and how can we generalize the code.

      Attachments

        Activity

          People

            fmcquillan Frank McQuillan
            njayaram Nandish Jayaram
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: