小编Man*_*rma的帖子

Keras 中的图像序列处理 ConvLSTM 与 LSTM 架构

我需要训练基于序列的 10x10 图像分割。以下是我要使用的 lstm 和 convlstm 模型:

def lstmModel():
    # Model definition
    model = Sequential()
    model.add(LSTM(50, batch_input_shape=(1, None, inp.shape[1]*inp.shape[2]), return_sequences=True, stateful=True))
    model.add(Dense(out.shape[1]*out.shape[2], activation='softmax'))
    model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
    model.summary()
    return model


def convlstmModel():
    # Model definition
    model = Sequential()
    model.add(ConvLSTM2D(12, kernel_size=5, padding = "same", batch_input_shape=(1, None, inp.shape[1], inp.shape[2], 1), return_sequences=True, stateful=True))
    model.add(Conv2D(20, 3, padding='same', activation='softmax'))
    model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
    model.summary()
    return model
Run Code Online (Sandbox Code Playgroud)

我为 10 个随机 10x10 图像序列的序列训练模型。LSTM 模型对我来说似乎工作正常,但 ConvLSTM 模型显示 Conv2D 层的维度不匹配:

ValueError: Input 0 is incompatible with layer conv2d_1: expected ndim=4, found …
Run Code Online (Sandbox Code Playgroud)

python lstm keras tensorflow keras-layer

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

如何在锚定智能合约指令中传输SOL

我正在创建一个 dapp,多个用户可以将 SOL 存入一个活动帐户,并且根据谁赢得了活动,他们可以将 SOL 兑换回他们的钱包。

如何在锚定智能合约指令中将本机 SOL(不是任何其他 spl 代币)直接转移到事件账户的金库地址?

以下锚定指令会起作用吗?PROGRAM_ACCOUNT如果是的话,下面应该是什么?据推测,它应该是处理本机SOL的帐户,但我在文档中找不到它。

token::transfer(
    CpiContext::new(
        PROGRAM_ACCOUNT,
        anchor_spl::token::Transfer {
            from: source_user_info,
            to: destination_user_info,
            authority: source_user_info,
        },
    ),
    1,
)?; 
Run Code Online (Sandbox Code Playgroud)

提前致谢!

rust solana anchor-solana

3
推荐指数
2
解决办法
6021
查看次数

标签 统计

anchor-solana ×1

keras ×1

keras-layer ×1

lstm ×1

python ×1

rust ×1

solana ×1

tensorflow ×1