Ejemplo n.º 1
0
        private void SetOutputLayers()
        {
            //Settings for output layer
            var outputLayer     = config.GetValueRequired(OUTPUT_LAYER);
            var items           = outputLayer.Split(':');
            var sLayerType      = items[0];
            var outputLayerType = LayerType.None;

            foreach (
                var type in
                Enum.GetValues(typeof(LayerType))
                .Cast <LayerType>()
                .Where(type => sLayerType.Equals(type.ToString(), StringComparison.InvariantCultureIgnoreCase)))
            {
                outputLayerType = type;
                break;
            }

            switch (outputLayerType)
            {
            case LayerType.Softmax:
                var softmaxLayerConfig = new SoftmaxLayerConfig();
                OutputLayerConfig = softmaxLayerConfig;

                Logger.WriteLine("Initialize configuration for softmax layer.");
                break;

            case LayerType.NCESoftmax:
                var nceLayerConfig = new NCELayerConfig {
                    NegativeSampleSize = int.Parse(items[1])
                };
                OutputLayerConfig = nceLayerConfig;

                Logger.WriteLine(
                    $"Initialize configuration for NCESoftmax layer. Negative sample size = '{nceLayerConfig.NegativeSampleSize}'");
                break;
            }
        }
Ejemplo n.º 2
0
 public SoftmaxLayer(SoftmaxLayerConfig config) : base(config)
 {
 }