如何在后端conv2d(而不是Conv2D层)上使用Keras TimeDistributed

时间:2019-08-02 14:45:49

标签: python-3.x keras

我需要在同时使用TimeDistributed的同时将自定义内核发送到conv2d。 timeDistributed仅使用图层,但是如果使用Conv2D(图层),则无法设置自定义内核。

注意:我正在构建覆盖Conv2D的自定义图层,必须在该图层上设置self.Kernal作为build方法,并在调用conv2D时重新使用它。

有什么方法可以通过使用包裹器“ TimeDistributed”在构建方法上初始化的那一层来设置Conv2D层上的内核。

/* Send email to customer on cancelled order in WooCommerce */
add_action('woocommerce_subscription_status_updated', 'send_custom_email_notifications', 10, 3 );
function send_custom_email_notifications( $subscription, $new_status, $old_status ){

    if ( $new_status == 'cancelled' || $new_status == 'pending-cancel' ){
        $customer_email = $subscription->get_billing_email();
        $orderid = $subscription->get_order_number();
        $wc_emails = WC()->mailer()->get_emails();

        // Send email to both admin and customer
        // $wc_emails['WC_Email_Cancelled_Order']->recipient .= ',' . $customer_email;

        // Send email to admin only
        $wc_emails['WC_Email_Cancelled_Order']->recipient;
        $wc_emails['WC_Email_Cancelled_Order']->trigger( $orderid );

        // Send email to customer only
        $mailer = WC()->mailer();
        $subject = __('Subscription Cancelled', 'custom');
        $content = get_cancelled_subscription_content( $subscription, $subject, $mailer );
        $headers = "Content-Type: text/html\r\n";

        $mailer->send( $customer_email, $subject, $content, $headers );        

    } 
}

function get_cancelled_subscription_content( $subscription, $heading = false, $mailer ) {

    $template = 'woocommerce/emails/cancelled-subscription.php';

    return wc_get_template_html( $template, array(
        'order'         => $subscription,
        'email_heading' => $heading,
        'sent_to_admin' => true,
        'plain_text'    => false,
        'email'         => $mailer
    ) );
}

0 个答案:

没有答案