Git Product home page Git Product logo

cybo's Introduction

Hi there 👋

  • 🎯 I’m currently working on nlp. 😎
  • 🌱 I’m currently learning go. 😅
  • 🤔 I'm thinking about how to write better code. 😁
  • 💬 Ask me about python、go、nlp.
  • 📫 How to reach me: kebo.site

rfyiamcool's github stats

visitor badge

cybo's People

Contributors

bo-ke avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

ramaneswaran

cybo's Issues

bug: sequence classification acc 计算错误

sparse_categorical_accuracy 跟 categorical_accuracy区分

if len(intent_pred.shape) == 2 and intent_pred.shape[1] == 1:
    intent_acc = tf.keras.metrics.categorical_accuracy(
        y_true=intent_true, y_pred=intent_pred)
else:
    intent_acc = tf.keras.metrics.sparse_categorical_accuracy(
        y_true=intent_true, y_pred=intent_pred)

crf layer use kernel 重复

sf_id 使用crf layer的时候,crf_layer 内部使用了units=tags_size的Dense,但是sf_id最后一层也是用的units=tags_size的Dense,重复了,可以设置use_kernel=False,去掉这个Dense

if self.use_kernel:
    self._dense_layer = tf.keras.layers.Dense(
        units=self.units, dtype=self.dtype
    )
else:
    self._dense_layer = lambda x: tf.cast(x, dtype=self.dtype)

feature: 使用tf.stack 处理seqeval 不支持tf.function的问题

tf.stack example
https://stackoverflow.com/questions/64567161/tensorflow-cannot-be-accessed-here-it-is-defined-in-another-function-or-code-b

x = tf.TensorArray(dtype=tf.float32, size=0, dynamic_size=True)

a = tf.ones((2, 3))
b = tf.zeros((2, 3))
x.write(tf.constant(0), a)
x.write(tf.constant(1), b)
>>> list(x.stack())
[<tf.Tensor: shape=(2, 3), dtype=float32, numpy=
array([[1., 1., 1.],
       [1., 1., 1.]], dtype=float32)>, <tf.Tensor: shape=(2, 3), dtype=float32, numpy=
array([[0., 0., 0.],
       [0., 0., 0.]], dtype=float32)>]

>>> tf.transpose(x.stack(), [0, 2, 1])
<tf.Tensor: shape=(2, 3, 2), dtype=float32, numpy=
array([[[1., 1.],
        [1., 1.],
        [1., 1.]],

       [[0., 0.],
        [0., 0.],
        [0., 0.]]], dtype=float32)>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.