Skip to content

Remove the IFourierDistributionSampler interface #2698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Microsoft.ML.StaticPipe/TransformsStatic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1560,9 +1560,9 @@ private readonly struct Config
public readonly int NewDim;
public readonly bool UseSin;
public readonly int? Seed;
public readonly IComponentFactory<float, IFourierDistributionSampler> Generator;
public readonly KernelBase Generator;

public Config(int newDim, bool useSin, IComponentFactory<float, IFourierDistributionSampler> generator, int? seed = null)
public Config(int newDim, bool useSin, KernelBase generator, int? seed = null)
{
NewDim = newDim;
UseSin = useSin;
Expand Down Expand Up @@ -1612,11 +1612,11 @@ public override IEstimator<ITransformer> Reconcile(IHostEnvironment env, Pipelin
/// <param name="input">The column to apply Random Fourier transfomration.</param>
/// <param name="newDim">Expected size of new vector.</param>
/// <param name="useSin">Create two features for every random Fourier frequency? (one for cos and one for sin) </param>
/// <param name="generator">Which kernel to use. (<see cref="GaussianFourierSampler"/> by default)</param>
/// <param name="generator">Which kernel to use. (if it is null, <see cref="GaussianKernel"/> is used.)</param>
/// <param name="seed">The seed of the random number generator for generating the new features. If not specified global random would be used.</param>
public static Vector<float> LowerVectorSizeWithRandomFourierTransformation(this Vector<float> input,
int newDim = RandomFourierFeaturizingEstimator.Defaults.NewDim, bool useSin = RandomFourierFeaturizingEstimator.Defaults.UseSin,
IComponentFactory<float, IFourierDistributionSampler> generator = null, int? seed = null)
KernelBase generator = null, int? seed = null)
{
Contracts.CheckValue(input, nameof(input));
return new ImplVector<string>(input, new Config(newDim, useSin, generator, seed));
Expand Down
Loading