6 types derived from OptionBase
Microsoft.ML.SearchSpace (6)
Option\ChoiceOption.cs (1)
19public sealed class ChoiceOption : OptionBase
Option\NestOption.cs (2)
16public sealed class SearchSpace : OptionBase, IDictionary<string, OptionBase>
Option\UniformNumericOption.cs (1)
17public abstract class UniformNumericOption : OptionBase
SearchSpace.cs (2)
27public class SearchSpace : OptionBase, IDictionary<string, OptionBase>
73 references to OptionBase
Microsoft.ML.SearchSpace (73)
Converter\OptionConverter.cs (3)
14internal class OptionConverter : JsonConverter<OptionBase> 16public override OptionBase Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 46public override void Write(Utf8JsonWriter writer, OptionBase value, JsonSerializerOptions options)
Converter\SearchSpaceConverter.cs (2)
18var optionKVPairs = JsonSerializer.Deserialize<Dictionary<string, OptionBase>>(ref reader, options); 25JsonSerializer.Serialize<IDictionary<string, OptionBase>>(value, options);
Option\NestOption.cs (28)
18private readonly Dictionary<string, OptionBase> _options = new Dictionary<string, OptionBase>(); 21public OptionBase this[string key] { get => ((IDictionary<string, OptionBase>)_options)[key]; set => ((IDictionary<string, OptionBase>)_options)[key] = value; } 70var option = _options[key]; 80public ICollection<string> Keys => ((IDictionary<string, OptionBase>)_options).Keys; 83public ICollection<OptionBase> Values => ((IDictionary<string, OptionBase>)_options).Values; 86public int Count => ((ICollection<KeyValuePair<string, OptionBase>>)_options).Count; 89public bool IsReadOnly => ((ICollection<KeyValuePair<string, OptionBase>>)_options).IsReadOnly; 92public void Add(string key, OptionBase value) 94((IDictionary<string, OptionBase>)_options).Add(key, value); 98public void Add(KeyValuePair<string, OptionBase> item) 100((ICollection<KeyValuePair<string, OptionBase>>)_options).Add(item); 106((ICollection<KeyValuePair<string, OptionBase>>)_options).Clear(); 110public bool Contains(KeyValuePair<string, OptionBase> item) 112return ((ICollection<KeyValuePair<string, OptionBase>>)_options).Contains(item); 118return ((IDictionary<string, OptionBase>)_options).ContainsKey(key); 122public void CopyTo(KeyValuePair<string, OptionBase>[] array, int arrayIndex) 124((ICollection<KeyValuePair<string, OptionBase>>)_options).CopyTo(array, arrayIndex); 128public IEnumerator<KeyValuePair<string, OptionBase>> GetEnumerator() 130return ((IEnumerable<KeyValuePair<string, OptionBase>>)_options).GetEnumerator(); 136return ((IDictionary<string, OptionBase>)_options).Remove(key); 140public bool Remove(KeyValuePair<string, OptionBase> item) 142return ((ICollection<KeyValuePair<string, OptionBase>>)_options).Remove(item); 146public bool TryGetValue(string key, out OptionBase value) 148return ((IDictionary<string, OptionBase>)_options).TryGetValue(key, out value);
SearchSpace.cs (40)
17/// This class is used to represent a set of <see cref="OptionBase"/>, which can be either one of <see cref="ChoiceOption"/>, <see cref="UniformNumericOption"/> or another nested search space. 29private readonly Dictionary<string, OptionBase> _options; 33/// Create <see cref="SearchSpace"/> using a group of <see cref="OptionBase"/>. 36internal SearchSpace(params KeyValuePair<string, OptionBase>[] options) 42internal SearchSpace(IEnumerable<KeyValuePair<string, OptionBase>> options) 51_options = new Dictionary<string, OptionBase>(); 83public ICollection<string> Keys => ((IDictionary<string, OptionBase>)_options).Keys; 86public ICollection<OptionBase> Values => ((IDictionary<string, OptionBase>)_options).Values; 89public int Count => ((ICollection<KeyValuePair<string, OptionBase>>)_options).Count; 92public bool IsReadOnly => ((ICollection<KeyValuePair<string, OptionBase>>)_options).IsReadOnly; 106public OptionBase this[string key] { get => ((IDictionary<string, OptionBase>)_options)[key]; set => ((IDictionary<string, OptionBase>)_options)[key] = value; } 117var option = _options[key]; 138var option = _options[key]; 172private Dictionary<string, OptionBase> GetOptionsFromType(Type typeInfo) 193private Dictionary<string, OptionBase> GetOptionsFromField(Type typeInfo) 196var res = new Dictionary<string, OptionBase>(); 215OptionBase option = attributes.First() switch 240private Dictionary<string, OptionBase> GetOptionsFromProperty(Type typeInfo) 243var res = new Dictionary<string, OptionBase>(); 262OptionBase option = attributes.First() switch 311public void Add(string key, OptionBase value) 313((IDictionary<string, OptionBase>)_options).Add(key, value); 319return ((IDictionary<string, OptionBase>)_options).ContainsKey(key); 325return ((IDictionary<string, OptionBase>)_options).Remove(key); 329public bool TryGetValue(string key, out OptionBase value) 331return ((IDictionary<string, OptionBase>)_options).TryGetValue(key, out value); 335public void Add(KeyValuePair<string, OptionBase> item) 337((ICollection<KeyValuePair<string, OptionBase>>)_options).Add(item); 343((ICollection<KeyValuePair<string, OptionBase>>)_options).Clear(); 347public bool Contains(KeyValuePair<string, OptionBase> item) 349return ((ICollection<KeyValuePair<string, OptionBase>>)_options).Contains(item); 353public void CopyTo(KeyValuePair<string, OptionBase>[] array, int arrayIndex) 355((ICollection<KeyValuePair<string, OptionBase>>)_options).CopyTo(array, arrayIndex); 359public bool Remove(KeyValuePair<string, OptionBase> item) 361return ((ICollection<KeyValuePair<string, OptionBase>>)_options).Remove(item); 365public IEnumerator<KeyValuePair<string, OptionBase>> GetEnumerator() 367return ((IEnumerable<KeyValuePair<string, OptionBase>>)_options).GetEnumerator();