Changeset 7694


Ignore:
Timestamp:
04/02/12 23:44:17 (10 years ago)
Author:
gkronber
Message:

#1808 updated serialization code for neural network ensembles to work with alglib 3.5.0

Location:
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

    r7294 r7694  
    101101  </PropertyGroup>
    102102  <ItemGroup>
    103     <Reference Include="ALGLIB-3.4.0, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    104       <HintPath>..\..\bin\ALGLIB-3.4.0.dll</HintPath>
     103    <Reference Include="ALGLIB-3.5.0, Version=3.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     104      <HintPath>..\..\bin\ALGLIB-3.5.0.dll</HintPath>
    105105      <Private>False</Private>
    106106    </Reference>
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleModel.cs

    r7259 r7694  
    6363      : base(original, cloner) {
    6464      mlpEnsemble = new alglib.mlpensemble();
    65       mlpEnsemble.innerobj.columnmeans = (double[])original.mlpEnsemble.innerobj.columnmeans.Clone();
    66       mlpEnsemble.innerobj.columnsigmas = (double[])original.mlpEnsemble.innerobj.columnsigmas.Clone();
    67       mlpEnsemble.innerobj.dfdnet = (double[])original.mlpEnsemble.innerobj.dfdnet.Clone();
    68       mlpEnsemble.innerobj.ensemblesize = original.mlpEnsemble.innerobj.ensemblesize;
    69       mlpEnsemble.innerobj.issoftmax = original.mlpEnsemble.innerobj.issoftmax;
    70       mlpEnsemble.innerobj.neurons = (double[])original.mlpEnsemble.innerobj.neurons.Clone();
    71       mlpEnsemble.innerobj.nin = original.mlpEnsemble.innerobj.nin;
    72       mlpEnsemble.innerobj.nout = original.mlpEnsemble.innerobj.nout;
    73       mlpEnsemble.innerobj.postprocessing = original.mlpEnsemble.innerobj.postprocessing;
    74       mlpEnsemble.innerobj.serializedlen = original.mlpEnsemble.innerobj.serializedlen;
    75       mlpEnsemble.innerobj.serializedmlp = (double[])original.mlpEnsemble.innerobj.serializedmlp.Clone();
    76       mlpEnsemble.innerobj.structinfo = (int[])original.mlpEnsemble.innerobj.structinfo.Clone();
    77       mlpEnsemble.innerobj.tmpmeans = (double[])original.mlpEnsemble.innerobj.tmpmeans.Clone();
    78       mlpEnsemble.innerobj.tmpsigmas = (double[])original.mlpEnsemble.innerobj.tmpsigmas.Clone();
    79       mlpEnsemble.innerobj.tmpweights = (double[])original.mlpEnsemble.innerobj.tmpweights.Clone();
    80       mlpEnsemble.innerobj.wcount = original.mlpEnsemble.innerobj.wcount;
    81       mlpEnsemble.innerobj.weights = (double[])original.mlpEnsemble.innerobj.weights.Clone();
    82       mlpEnsemble.innerobj.y = (double[])original.mlpEnsemble.innerobj.y.Clone();
     65      string serializedEnsemble;
     66      alglib.mlpeserialize(original.mlpEnsemble, out serializedEnsemble);
     67      alglib.mlpeunserialize(serializedEnsemble, out this.mlpEnsemble);
    8368      targetVariable = original.targetVariable;
    8469      allowedInputVariables = (string[])original.allowedInputVariables.Clone();
     
    168153    #region persistence
    169154    [Storable]
     155    private string MultiLayerPerceptronEnsembleNetwork {
     156      get {
     157        string serializedNetwork;
     158        alglib.mlpeserialize(this.mlpEnsemble, out serializedNetwork);
     159        return serializedNetwork;
     160      }
     161      set {
     162        alglib.mlpeunserialize(value, out this.mlpEnsemble);
     163      }
     164    }
     165
     166    [Storable]
    170167    private double[] MultiLayerPerceptronEnsembleColumnMeans {
    171       get {
    172         return mlpEnsemble.innerobj.columnmeans;
    173       }
     168      get { return mlpEnsemble.innerobj.columnmeans; }
    174169      set {
    175170        mlpEnsemble.innerobj.columnmeans = value;
     171        mlpEnsemble.innerobj.network.columnmeans = value;
    176172      }
    177173    }
    178174    [Storable]
    179175    private double[] MultiLayerPerceptronEnsembleColumnSigmas {
    180       get {
    181         return mlpEnsemble.innerobj.columnsigmas;
    182       }
     176      get { return mlpEnsemble.innerobj.columnsigmas; }
    183177      set {
    184178        mlpEnsemble.innerobj.columnsigmas = value;
    185       }
    186     }
    187     [Storable]
     179        mlpEnsemble.innerobj.network.columnsigmas = value;
     180      }
     181    }
     182    [Storable(AllowOneWay = true)]
    188183    private double[] MultiLayerPerceptronEnsembleDfdnet {
    189       get {
    190         return mlpEnsemble.innerobj.dfdnet;
    191       }
    192       set {
    193         mlpEnsemble.innerobj.dfdnet = value;
     184      set {
     185        mlpEnsemble.innerobj.network.dfdnet = value;
    194186      }
    195187    }
    196188    [Storable]
    197189    private int MultiLayerPerceptronEnsembleSize {
    198       get {
    199         return mlpEnsemble.innerobj.ensemblesize;
    200       }
     190      get { return mlpEnsemble.innerobj.ensemblesize; }
    201191      set {
    202192        mlpEnsemble.innerobj.ensemblesize = value;
    203       }
    204     }
    205     [Storable]
    206     private bool MultiLayerPerceptronEnsembleIsSoftMax {
    207       get {
    208         return mlpEnsemble.innerobj.issoftmax;
    209       }
    210       set {
    211         mlpEnsemble.innerobj.issoftmax = value;
    212       }
    213     }
    214     [Storable]
     193        mlpEnsemble.innerobj.ensemblesize = value;
     194      }
     195    }
     196    [Storable(AllowOneWay = true)]
    215197    private double[] MultiLayerPerceptronEnsembleNeurons {
    216       get {
    217         return mlpEnsemble.innerobj.neurons;
    218       }
    219       set {
    220         mlpEnsemble.innerobj.neurons = value;
    221       }
    222     }
    223     [Storable]
    224     private int MultiLayerPerceptronEnsembleNin {
    225       get {
    226         return mlpEnsemble.innerobj.nin;
    227       }
    228       set {
    229         mlpEnsemble.innerobj.nin = value;
    230       }
    231     }
    232     [Storable]
    233     private int MultiLayerPerceptronEnsembleNout {
    234       get {
    235         return mlpEnsemble.innerobj.nout;
    236       }
    237       set {
    238         mlpEnsemble.innerobj.nout = value;
    239       }
    240     }
    241     [Storable]
    242     private bool MultiLayerPerceptronEnsemblePostprocessing {
    243       get {
    244         return mlpEnsemble.innerobj.postprocessing;
    245       }
    246       set {
    247         mlpEnsemble.innerobj.postprocessing = value;
    248       }
    249     }
    250     [Storable]
    251     private int MultiLayerPerceptronEnsembleSerializedLen {
    252       get {
    253         return mlpEnsemble.innerobj.serializedlen;
    254       }
    255       set {
    256         mlpEnsemble.innerobj.serializedlen = value;
    257       }
    258     }
    259     [Storable]
     198      set { mlpEnsemble.innerobj.network.neurons = value; }
     199    }
     200    [Storable(AllowOneWay = true)]
    260201    private double[] MultiLayerPerceptronEnsembleSerializedMlp {
    261       get {
    262         return mlpEnsemble.innerobj.serializedmlp;
    263       }
    264       set {
    265         mlpEnsemble.innerobj.serializedmlp = value;
    266       }
    267     }
    268     [Storable]
     202      set {
     203        mlpEnsemble.innerobj.network.dfdnet = value;
     204      }
     205    }
     206    [Storable(AllowOneWay = true)]
    269207    private int[] MultiLayerPerceptronStuctinfo {
    270       get {
    271         return mlpEnsemble.innerobj.structinfo;
    272       }
    273       set {
    274         mlpEnsemble.innerobj.structinfo = value;
    275       }
    276     }
    277     [Storable]
    278     private double[] MultiLayerPerceptronEnsembleTmpMeans {
    279       get {
    280         return mlpEnsemble.innerobj.tmpmeans;
    281       }
    282       set {
    283         mlpEnsemble.innerobj.tmpmeans = value;
    284       }
    285     }
    286     [Storable]
    287     private double[] MultiLayerPerceptronEnsembleTmpSigmas {
    288       get {
    289         return mlpEnsemble.innerobj.tmpsigmas;
    290       }
    291       set {
    292         mlpEnsemble.innerobj.tmpsigmas = value;
    293       }
    294     }
    295     [Storable]
    296     private double[] MultiLayerPerceptronEnsembleTmpWeights {
    297       get {
    298         return mlpEnsemble.innerobj.tmpweights;
    299       }
    300       set {
    301         mlpEnsemble.innerobj.tmpweights = value;
    302       }
    303     }
    304     [Storable]
    305     private int MultiLayerPerceptronEnsembleWCount {
    306       get {
    307         return mlpEnsemble.innerobj.wcount;
    308       }
    309       set {
    310         mlpEnsemble.innerobj.wcount = value;
     208      set {
     209        mlpEnsemble.innerobj.network.structinfo = value;
    311210      }
    312211    }
     
    319218      set {
    320219        mlpEnsemble.innerobj.weights = value;
     220        mlpEnsemble.innerobj.network.weights = value;
    321221      }
    322222    }
     
    328228      set {
    329229        mlpEnsemble.innerobj.y = value;
     230        mlpEnsemble.innerobj.network.y = value;
    330231      }
    331232    }
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Plugin.cs.frame

    r7294 r7694  
    2828  [Plugin("HeuristicLab.Algorithms.DataAnalysis", "Provides wrappers for data analysis algorithms implemented in external libraries (linear regression, linear discriminant analysis, k-means clustering, support vector classification and regression)", "3.4.2.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Algorithms.DataAnalysis-3.4.dll", PluginFileType.Assembly)]
    30   [PluginDependency("HeuristicLab.ALGLIB", "3.4.0")]
     30  [PluginDependency("HeuristicLab.ALGLIB", "3.5.0")]
    3131  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3232  [PluginDependency("HeuristicLab.Common", "3.3")]
Note: See TracChangeset for help on using the changeset viewer.