[ 
https://issues.apache.org/jira/browse/MADLIB-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16373243#comment-16373243
 ] 

Frank McQuillan commented on MADLIB-1209:
-----------------------------------------

looks better now
{code}
drop table if exists mlp_input;
create table mlp_input as
select 1 as fc_docid, 1 as responsive, array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as 
feature_vector
union all select 2, 0, array[2, 4, 6, 8, 10, 12, 14, 16, 18, 20];

DROP TABLE IF EXISTS mlp_model, mlp_model_summary, mlp_model_standardization;
SELECT madlib.mlp_classification(
    'mlp_input', -- table containing the first training data set
    'mlp_model', --output_table
    'feature_vector', --independent_varname
    'responsive', --dependent_varname
    ARRAY[3,3], --hidden_layer_sizes
    'learning_rate_init=0.003,n_iterations=10,tolerance=0', --optimizer_params
    'relu', --activation
    NULL, --weights
    FALSE, --warm_start
    TRUE --verbose
    );
{code}
produces
{code}
INFO:  Iteration: 2, Loss: <1.46611919957>
INFO:  Iteration: 3, Loss: <1.45527321383>
INFO:  Iteration: 4, Loss: <1.44470187518>
INFO:  Iteration: 5, Loss: <1.43439130426>
INFO:  Iteration: 6, Loss: <1.42432844068>
INFO:  Iteration: 7, Loss: <1.41562036079>
INFO:  Iteration: 8, Loss: <1.41267718821>
INFO:  Iteration: 9, Loss: <1.40975892711>
 mlp_classification 
--------------------

(1 row)
{code}


> Neural nets fails on Greenplum 4.3.x when verbose argument set to TRUE
> ----------------------------------------------------------------------
>
>                 Key: MADLIB-1209
>                 URL: https://issues.apache.org/jira/browse/MADLIB-1209
>             Project: Apache MADlib
>          Issue Type: Bug
>          Components: Module: Neural Networks
>            Reporter: Frank McQuillan
>            Priority: Minor
>             Fix For: v1.14
>
>
> In 
> {code}
> mlp_classification(
>     source_table,
>     output_table,
>     independent_varname,
>     dependent_varname,
>     hidden_layer_sizes,
>     optimizer_params,
>     activation,
>     weights,
>     warm_start,
>     verbose,
>     grouping_col
>     )
> {code}
> when the `verbose` argument is set to `TRUE` the following error results:
> {code}
> ERROR:  plpy.SPIError: function array_length(double precision[], integer) 
> does not exist (plpython.c:4656)
> LINE 4:                             _state_current[array_length(_sta...
>                                                    ^
> HINT:  No function matches the given name and argument types. You may need to 
> add explicit type casts.
> QUERY: 
>             SELECT
>                
>                             _state_current[array_length(_state_current,1)] AS 
> loss
>                           ,
>                 __madlib_temp_col_grp_key29688300_1519168141_31322353__
>             FROM (
>                 SELECT grp_key AS 
> __madlib_temp_col_grp_key29688300_1519168141_31322353__, state AS 
> _state_current FROM madlib._gen_state($3, NULL, $4)
>            ) subq1
>            
> CONTEXT:  Traceback (most recent call last):
>   PL/Python function "mlp_classification", line 33, in <module>
>     grouping_col
>   PL/Python function "mlp_classification", line 290, in mlp
>   PL/Python function "mlp_classification", line 455, in 
> get_param_value_per_group
> PL/Python function "mlp_classification"
> {code}
> because `array_length` does not exist in Greenplum 4.3.x . 
> It works OK in Greenplum 5.x and Postgres 9.x/10 however.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to