Language

SearchSpace クラス

定義

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

[System.Text.Json.Serialization.JsonConverter(typeof(Microsoft.ML.SearchSpace.Converter.SearchSpaceConverter))]
public class SearchSpace : Microsoft.ML.SearchSpace.Option.OptionBase, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,Microsoft.ML.SearchSpace.Option.OptionBase>>, System.Collections.Generic.IDictionary<string,Microsoft.ML.SearchSpace.Option.OptionBase>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,Microsoft.ML.SearchSpace.Option.OptionBase>>
public class SearchSpace : Microsoft.ML.SearchSpace.Option.OptionBase, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,Microsoft.ML.SearchSpace.Option.OptionBase>>, System.Collections.Generic.IDictionary<string,Microsoft.ML.SearchSpace.Option.OptionBase>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,Microsoft.ML.SearchSpace.Option.OptionBase>>
[<System.Text.Json.Serialization.JsonConverter(typeof(Microsoft.ML.SearchSpace.Converter.SearchSpaceConverter))>]
type SearchSpace = class
    inherit OptionBase
    interface IDictionary<string, OptionBase>
    interface ICollection<KeyValuePair<string, OptionBase>>
    interface seq<KeyValuePair<string, OptionBase>>
    interface IEnumerable
type SearchSpace = class
    inherit OptionBase
    interface IDictionary<string, OptionBase>
    interface ICollection<KeyValuePair<string, OptionBase>>
    interface seq<KeyValuePair<string, OptionBase>>
    interface IEnumerable
Public Class SearchSpace
Inherits OptionBase
Implements ICollection(Of KeyValuePair(Of String, OptionBase)), IDictionary(Of String, OptionBase), IEnumerable(Of KeyValuePair(Of String, OptionBase))
継承
SearchSpace
派生
属性
実装

例

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Text;
using System.Text.Json;
using Microsoft.ML.SearchSpace;
using Microsoft.ML.SearchSpace.Option;

namespace Microsoft.ML.AutoML.Samples
{
    public static class SearchSpaceExample
    {
        public static void Run()
        {
            // The following code shows how to create a SearchSpace for MyParameter.
            var myParameterSearchSpace = new SearchSpace<MyParameter>();

            // Equivalently, you can also create myParameterSearchSpace from scratch.
            var myParameterSearchSpace2 = new SearchSpace.SearchSpace();

            // numeric options
            myParameterSearchSpace2["IntOption"] = new UniformIntOption(min: -10, max: 10, logBase: false, defaultValue: 0);
            myParameterSearchSpace2["SingleOption"] = new UniformSingleOption(min: 1, max: 10, logBase: true, defaultValue: 1);
            myParameterSearchSpace2["DoubleOption"] = new UniformDoubleOption(min: -10, max: 10, logBase: false, defaultValue: 0);

            // choice options
            myParameterSearchSpace2["BoolOption"] = new ChoiceOption(true, false);
            myParameterSearchSpace2["StrOption"] = new ChoiceOption("a", "b", "c");

            // nest options
            var nestedSearchSpace = new SearchSpace.SearchSpace();
            nestedSearchSpace["IntOption"] = new UniformIntOption(min: -10, max: 10, logBase: false, defaultValue: 0);
            myParameterSearchSpace2["Nest"] = nestedSearchSpace;

            // the two search space should be equal
            Debug.Assert(myParameterSearchSpace.GetHashCode() == myParameterSearchSpace2.GetHashCode());
        }

        public class MyParameter
        {
            [Range((int)-10, 10, 0, false)]
            public int IntOption { get; set; }

            [Range(1f, 10f, 1f, true)]
            public float SingleOption { get; set; }

            [Range(-10, 10, false)]
            public double DoubleOption { get; set; }

            [BooleanChoice]
            public bool BoolOption { get; set; }

            [Choice("a", "b", "c")]
            public string StrOption { get; set; }

            [NestOption]
            public NestParameter Nest { get; set; }
        }

        public class NestParameter
        {
            [Range((int)-10, 10, 0, false)]
            public int IntOption { get; set; }
        }
    }
}

コンストラクター

名前 説明
SearchSpace()

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

SearchSpace(Type, Parameter)

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

プロパティ

名前 説明
Count

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

Default

機能空間にマッピングされる既定値を取得します (存在する場合)。

FeatureSpaceDim

SampleFromFeatureSpace(Double[])の出力長と等しい特徴空間の寸法。

IsReadOnly

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

Item[String]

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

Keys

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

Step

このオプションのステップを取得します。 Stepを使用して、このオプションを分割するグリッドの数を決定します。 ChoiceOptionでは、常にChoicesの長さです。 UniformNumericOptionでは、常に [null] です。 SearchSpaceでは、オプション内のすべてのStepの組み合わせです。

Values

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

メソッド

名前 説明
Add(KeyValuePair<String,OptionBase>)

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

Add(String, OptionBase)

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

Clear()

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

Contains(KeyValuePair<String,OptionBase>)

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

ContainsKey(String)

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

CopyTo(KeyValuePair<String,OptionBase>[], Int32)

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

GetEnumerator()

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

GetHashCode()

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

MappingToFeatureSpace(Parameter)

マッピング値を [0, 1) 均一分布に設定します。

Remove(KeyValuePair<String,OptionBase>)

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

Remove(String)

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

SampleFromFeatureSpace(Double[])

[0,1)均一分布からのサンプル。

TryGetValue(String, OptionBase)

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

明示的なインターフェイスの実装

名前 説明
IEnumerable.GetEnumerator()

このクラスは、 OptionBaseのセットを表すために使用されます。これは、 ChoiceOption、 UniformNumericOption 、または別の入れ子になった検索空間のいずれかになります。

適用対象