mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] seujung commented on a change in pull request #13735: update wavenet codes
Date Fri, 01 Feb 2019 06:13:21 GMT
seujung commented on a change in pull request #13735: update wavenet codes
URL: https://github.com/apache/incubator-mxnet/pull/13735#discussion_r252942411
 
 

 ##########
 File path: example/gluon/wavenet/models.py
 ##########
 @@ -0,0 +1,118 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""
+Module: WaveNet network modulep
+"""
+from mxnet import nd
+from mxnet.gluon import nn
+import mxnet.ndarray as F
+# pylint: disable=invalid-name, too-many-arguments, arguments-differ, attribute-defined-outside-init,
too-many-instance-attributes, invalid-sequence-index, no-self-use
+class One_Hot(nn.Block):
+    """
+    Description : generate one hot result
+    """
+    def __init__(self, depth):
+        super(One_Hot, self).__init__()
+        self.depth = depth
+
+    def forward(self, X_in):
+        with X_in.context:
+            X_in = X_in
+            self.ones = nd.one_hot(nd.arange(self.depth), self.depth)
+            return self.ones[X_in, :]
+
+    def __repr__(self):
+        return self.__class__.__name__ + "({})".format(self.depth)
+
+class WaveNet(nn.Block):
 
 Review comment:
   I try to change code using HybridBlock. But, I need too much time to apply it. Is it essential
to reflect this? If I have to do it, I will try to change this module.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message