我有MLP的张量流代码。这很好用,但结果不可重复。我添加了种子,但仍无法重现结果。每次运行程序时,都会生成新结果。
public interface IResolver
{
void Add<T>(string key, T keyValue);
T Resolve<T>(string key);
bool ResolvesAll(params string[] keys);
}
public sealed class Resolver : IResolver
{
private Dictionary<string, object> directory;
public void Add<T>(string key, T keyValue)
{
if (directory.ContainsKey(key))
directory[key] = keyValue;
else
directory.Add(key, keyValue);
}
public T Resolve<T>(string key)
{
return directory.ContainsKey(key) ? directory[key] as T : default(T);
}
public bool ResolvesAll(params string[] keys)
{
return keys.All(k => directory.ContainsKey(k));
}
}
我在这里缺少什么?我该如何重现结果?我甚至为重量和偏差添加了相同的种子。我也试过没有种子。但似乎没有用。