[ 
https://issues.apache.org/jira/browse/MADLIB-1482?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Frank McQuillan updated MADLIB-1482:
------------------------------------
    Description: 
metrics_compute_frequency should be >= 1 only. Currently it allows neg numbers:

{code}
SELECT madlib.madlib_keras_fit('balanced2_train_packed',   -- source table
                               'model1',          -- model output table
                               'model_arch_library',  -- model arch table
                                1,                    -- model arch id
                                $$ loss='categorical_crossentropy', 
optimizer='adam', metrics=['accuracy'] $$,  -- compile_params
                                $$ batch_size=64, epochs=1 $$,  -- fit_params
                                10,                   -- num_iterations
                                FALSE,                -- use GPUs
                                'balanced2_test_packed',   -- validation dataset
                                -3,                    -- metrics compute 
frequency
                                FALSE,                -- warm start
                               'Frank',           -- name
                               'Network test run'  -- description
                              );
{code}
produces
{code}
SELECT * FROM model1_summary;
-[ RECORD 1 
]-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
source_table              | balanced2_train_packed
model                     | model1
dependent_varname         | {y}
independent_varname       | {feature_vector}
model_arch_table          | model_arch_library
model_id                  | 1
compile_params            |  loss='categorical_crossentropy', optimizer='adam', 
metrics=['accuracy'] 
fit_params                |  batch_size=64, epochs=1 
num_iterations            | 10
validation_table          | balanced2_test_packed
object_table              | 
metrics_compute_frequency | -3
name                      | Frank
description               | Network test run
model_type                | madlib_keras
model_size                | 5.9853515625
start_training_time       | 2021-03-12 20:24:27.74585
end_training_time         | 2021-03-12 20:24:30.012898
metrics_elapsed_time      | 
{1.13839101791382,1.57564496994019,2.02039790153503,2.26697182655334}
madlib_version            | 1.18.0-dev
num_classes               | {23}
dependent_vartype         | {text}
normalizing_const         | 1
metrics_type              | {accuracy}
loss_type                 | categorical_crossentropy
training_metrics_final    | 0.529687523841858
training_loss_final       | 470.371795654297
training_metrics          | 
{0.283894240856171,0.344591349363327,0.489182680845261,0.529687523841858}
training_loss             | 
{3195.37939453125,1194.63610839844,508.576507568359,470.371795654297}
validation_metrics_final  | 0.52836537361145
validation_loss_final     | 11892.33203125
validation_metrics        | 
{0.289903849363327,0.35432693362236,0.482692301273346,0.52836537361145}
validation_loss           | 
{35025.0390625,23250.08984375,12720.3359375,11892.33203125}
metrics_iters             | {3,6,9,10}
y_class_values            | 
{class01,class02,class03,class04,class05,class06,class07,class08,class09,class10,class11,class12,class13,class14,class15,class16,class17,class18,class19,class20,class21,class22,normal}
{code}
Also if you make it 0 you get this cryptic error
{code}
InternalError: (psycopg2.errors.InternalError_) ZeroDivisionError: integer 
division or modulo by zero (plpython.c:5038)
CONTEXT:  Traceback (most recent call last):
  PL/Python function "madlib_keras_fit", line 23, in <module>
    madlib_keras.fit(**globals())
  PL/Python function "madlib_keras_fit", line 42, in wrapper
  PL/Python function "madlib_keras_fit", line 273, in fit
  PL/Python function "madlib_keras_fit", line 542, in 
should_compute_metrics_this_iter
PL/Python function "madlib_keras_fit"

[SQL: SELECT madlib.madlib_keras_fit('balanced2_train_packed',   -- source table
                               'model1',          -- model output table
                               'model_arch_library',  -- model arch table
                                1,                    -- model arch id
                                $$ loss='categorical_crossentropy', 
optimizer='adam', metrics=['accuracy'] $$,  -- compile_params
                                $$ batch_size=64, epochs=1 $$,  -- fit_params
                                10,                   -- num_iterations
                                FALSE,                -- use GPUs
                                'balanced2_test_packed',   -- validation dataset
                                0,                    -- metrics compute 
frequency
                                FALSE,                -- warm start
                               'Frank',           -- name
                               'Network test run'  -- description
                          );]
{code}

fix in:
{code}
fit()
fit_multiple()
autoML()
{code}


  was:
metrics_compute_frequency should be >= 1 only. Currently it allows neg numbers:

{code}
SELECT madlib.madlib_keras_fit('balanced2_train_packed',   -- source table
                               'model1',          -- model output table
                               'model_arch_library',  -- model arch table
                                1,                    -- model arch id
                                $$ loss='categorical_crossentropy', 
optimizer='adam', metrics=['accuracy'] $$,  -- compile_params
                                $$ batch_size=64, epochs=1 $$,  -- fit_params
                                10,                   -- num_iterations
                                FALSE,                -- use GPUs
                                'balanced2_test_packed',   -- validation dataset
                                -3,                    -- metrics compute 
frequency
                                FALSE,                -- warm start
                               'Frank',           -- name
                               'Network test run'  -- description
                              );
{code}
produces
{code}
SELECT * FROM model1_summary;
-[ RECORD 1 
]-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
source_table              | balanced2_train_packed
model                     | model1
dependent_varname         | {y}
independent_varname       | {feature_vector}
model_arch_table          | model_arch_library
model_id                  | 1
compile_params            |  loss='categorical_crossentropy', optimizer='adam', 
metrics=['accuracy'] 
fit_params                |  batch_size=64, epochs=1 
num_iterations            | 10
validation_table          | balanced2_test_packed
object_table              | 
metrics_compute_frequency | -3
name                      | Frank
description               | Network test run
model_type                | madlib_keras
model_size                | 5.9853515625
start_training_time       | 2021-03-12 20:24:27.74585
end_training_time         | 2021-03-12 20:24:30.012898
metrics_elapsed_time      | 
{1.13839101791382,1.57564496994019,2.02039790153503,2.26697182655334}
madlib_version            | 1.18.0-dev
num_classes               | {23}
dependent_vartype         | {text}
normalizing_const         | 1
metrics_type              | {accuracy}
loss_type                 | categorical_crossentropy
training_metrics_final    | 0.529687523841858
training_loss_final       | 470.371795654297
training_metrics          | 
{0.283894240856171,0.344591349363327,0.489182680845261,0.529687523841858}
training_loss             | 
{3195.37939453125,1194.63610839844,508.576507568359,470.371795654297}
validation_metrics_final  | 0.52836537361145
validation_loss_final     | 11892.33203125
validation_metrics        | 
{0.289903849363327,0.35432693362236,0.482692301273346,0.52836537361145}
validation_loss           | 
{35025.0390625,23250.08984375,12720.3359375,11892.33203125}
metrics_iters             | {3,6,9,10}
y_class_values            | 
{class01,class02,class03,class04,class05,class06,class07,class08,class09,class10,class11,class12,class13,class14,class15,class16,class17,class18,class19,class20,class21,class22,normal}
{code}
Also if you make it 0 you get this cryptic error
{code}
InternalError: (psycopg2.errors.InternalError_) ZeroDivisionError: integer 
division or modulo by zero (plpython.c:5038)
CONTEXT:  Traceback (most recent call last):
  PL/Python function "madlib_keras_fit", line 23, in <module>
    madlib_keras.fit(**globals())
  PL/Python function "madlib_keras_fit", line 42, in wrapper
  PL/Python function "madlib_keras_fit", line 273, in fit
  PL/Python function "madlib_keras_fit", line 542, in 
should_compute_metrics_this_iter
PL/Python function "madlib_keras_fit"

[SQL: SELECT madlib.madlib_keras_fit('balanced2_train_packed',   -- source table
                               'model1',          -- model output table
                               'model_arch_library',  -- model arch table
                                1,                    -- model arch id
                                $$ loss='categorical_crossentropy', 
optimizer='adam', metrics=['accuracy'] $$,  -- compile_params
                                $$ batch_size=64, epochs=1 $$,  -- fit_params
                                10,                   -- num_iterations
                                FALSE,                -- use GPUs
                                'balanced2_test_packed',   -- validation dataset
                                0,                    -- metrics compute 
frequency
                                FALSE,                -- warm start
                               'Frank',           -- name
                               'Network test run'  -- description
                          );]
{code}



> DL: metrics compute frequency should be >=1 only
> ------------------------------------------------
>
>                 Key: MADLIB-1482
>                 URL: https://issues.apache.org/jira/browse/MADLIB-1482
>             Project: Apache MADlib
>          Issue Type: Bug
>          Components: Deep Learning
>            Reporter: Frank McQuillan
>            Priority: Minor
>             Fix For: v1.19.0
>
>
> metrics_compute_frequency should be >= 1 only. Currently it allows neg 
> numbers:
> {code}
> SELECT madlib.madlib_keras_fit('balanced2_train_packed',   -- source table
>                                'model1',          -- model output table
>                                'model_arch_library',  -- model arch table
>                                 1,                    -- model arch id
>                                 $$ loss='categorical_crossentropy', 
> optimizer='adam', metrics=['accuracy'] $$,  -- compile_params
>                                 $$ batch_size=64, epochs=1 $$,  -- fit_params
>                                 10,                   -- num_iterations
>                                 FALSE,                -- use GPUs
>                                 'balanced2_test_packed',   -- validation 
> dataset
>                                 -3,                    -- metrics compute 
> frequency
>                                 FALSE,                -- warm start
>                                'Frank',           -- name
>                                'Network test run'  -- description
>                               );
> {code}
> produces
> {code}
> SELECT * FROM model1_summary;
> -[ RECORD 1 
> ]-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> source_table              | balanced2_train_packed
> model                     | model1
> dependent_varname         | {y}
> independent_varname       | {feature_vector}
> model_arch_table          | model_arch_library
> model_id                  | 1
> compile_params            |  loss='categorical_crossentropy', 
> optimizer='adam', metrics=['accuracy'] 
> fit_params                |  batch_size=64, epochs=1 
> num_iterations            | 10
> validation_table          | balanced2_test_packed
> object_table              | 
> metrics_compute_frequency | -3
> name                      | Frank
> description               | Network test run
> model_type                | madlib_keras
> model_size                | 5.9853515625
> start_training_time       | 2021-03-12 20:24:27.74585
> end_training_time         | 2021-03-12 20:24:30.012898
> metrics_elapsed_time      | 
> {1.13839101791382,1.57564496994019,2.02039790153503,2.26697182655334}
> madlib_version            | 1.18.0-dev
> num_classes               | {23}
> dependent_vartype         | {text}
> normalizing_const         | 1
> metrics_type              | {accuracy}
> loss_type                 | categorical_crossentropy
> training_metrics_final    | 0.529687523841858
> training_loss_final       | 470.371795654297
> training_metrics          | 
> {0.283894240856171,0.344591349363327,0.489182680845261,0.529687523841858}
> training_loss             | 
> {3195.37939453125,1194.63610839844,508.576507568359,470.371795654297}
> validation_metrics_final  | 0.52836537361145
> validation_loss_final     | 11892.33203125
> validation_metrics        | 
> {0.289903849363327,0.35432693362236,0.482692301273346,0.52836537361145}
> validation_loss           | 
> {35025.0390625,23250.08984375,12720.3359375,11892.33203125}
> metrics_iters             | {3,6,9,10}
> y_class_values            | 
> {class01,class02,class03,class04,class05,class06,class07,class08,class09,class10,class11,class12,class13,class14,class15,class16,class17,class18,class19,class20,class21,class22,normal}
> {code}
> Also if you make it 0 you get this cryptic error
> {code}
> InternalError: (psycopg2.errors.InternalError_) ZeroDivisionError: integer 
> division or modulo by zero (plpython.c:5038)
> CONTEXT:  Traceback (most recent call last):
>   PL/Python function "madlib_keras_fit", line 23, in <module>
>     madlib_keras.fit(**globals())
>   PL/Python function "madlib_keras_fit", line 42, in wrapper
>   PL/Python function "madlib_keras_fit", line 273, in fit
>   PL/Python function "madlib_keras_fit", line 542, in 
> should_compute_metrics_this_iter
> PL/Python function "madlib_keras_fit"
> [SQL: SELECT madlib.madlib_keras_fit('balanced2_train_packed',   -- source 
> table
>                                'model1',          -- model output table
>                                'model_arch_library',  -- model arch table
>                                 1,                    -- model arch id
>                                 $$ loss='categorical_crossentropy', 
> optimizer='adam', metrics=['accuracy'] $$,  -- compile_params
>                                 $$ batch_size=64, epochs=1 $$,  -- fit_params
>                                 10,                   -- num_iterations
>                                 FALSE,                -- use GPUs
>                                 'balanced2_test_packed',   -- validation 
> dataset
>                                 0,                    -- metrics compute 
> frequency
>                                 FALSE,                -- warm start
>                                'Frank',           -- name
>                                'Network test run'  -- description
>                           );]
> {code}
> fix in:
> {code}
> fit()
> fit_multiple()
> autoML()
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to