小编ibr*_*gon的帖子

Keras的initial_epoch是什么意思?

关于initial_epoch价值fitfit_generator方法,我有点困惑.这是文档:

initial_epoch:整数.开始训练的时期(对于恢复之前的训练运行很有用).

我明白,如果你从头开始训练,它就没用了.如果您训练了数据集并希望提高准确度或其他值(如果我错了就纠正我),这很有用.但我不确定它到底是做什么的.

毕竟,我有两个问题:

  1. 它的initial_epoch作用和用途是什么?
  2. initial_epoch什么时候可以使用?

    • 当我更改数据集时?
    • 当我改变学习率,优化器或丢失功能?
    • 他们都?

machine-learning deep-learning keras

6
推荐指数
2
解决办法
3443
查看次数

Ef-Core-我可以使用什么正则表达式在Db Interceptor中用nolock替换表名

我一直在尝试将我们的EF6项目移植到EF-Core-2.0。

EF6中,我们使用DbNolock拦截器来添加With(NOLOCK)提示,以获取所需的查询。您可以在下面找到我之前运行的Db拦截器代码。

   public class DbNoLockInterceptor : DbCommandInterceptor
    {
    private static readonly Regex TableAliasRegex = new Regex(@"((?<!\){1,5})AS \[Extent\d+\](?! WITH \(NOLOCK\)))", RegexOptions.Multiline | RegexOptions.IgnoreCase);

    public override void ScalarExecuting(DbCommand command,
        DbCommandInterceptionContext<object> interceptionContext)
    {
        command.CommandText =
            TableAliasRegex.Replace(command.CommandText, mt => mt.Groups[0].Value + " WITH (NOLOCK) ");
    }

    public override void ReaderExecuting(DbCommand command, DbCommandInterceptionContext<DbDataReader> interceptionContext)
    {
        command.CommandText = TableAliasRegex.Replace(command.CommandText,  mt => mt.Groups[0].Value + " WITH (NOLOCK) ");
    }
} 
Run Code Online (Sandbox Code Playgroud)

在Ef-Core中,我们可以采用几乎相同的方式进行拦截。但是由于表的命名约定发生变化,因此我无法为新编写正则表达式。您可以在下面找到新的Ef-Core版本:

public class DbNoLockListener
{ …
Run Code Online (Sandbox Code Playgroud)

c# regex entity-framework entity-framework-core .net-core

3
推荐指数
1
解决办法
438
查看次数