public function optimize(array &$feature_array)
    {
        // whete we will read from where we will write to
        $desrciptorspec = array(
            0=>array('pipe','r'),
            1=>array('pipe','w'),
            2=>STDERR // Should that be redirected to /dev/null or like?
        );

        // Run the optimizer
        $process = proc_open($this->optimizer,$desrciptorspec,$pipes);
        if (!is_resource($process)) {
            return array();
        }

        // send the data
        fwrite($pipes[0],json_encode($feature_array));
        fclose($pipes[0]);

        // get the weights
        $json = stream_get_contents($pipes[1]);

        // decode as an associative array
        $l = json_decode( $json , true );

        // close up the optimizer
        fclose($pipes[1]);
        proc_close($process);

        return $l;
    }