Coder Social home page Coder Social logo

emadeldeen24 / ca-tcc Goto Github PK

View Code? Open in Web Editor NEW
108.0 108.0 30.0 466 KB

[TPAMI 2023] Self-supervised Contrastive Representation Learning for Semi-supervised Time-Series Classification

Home Page: https://ieeexplore.ieee.org/document/10233092

Shell 2.24% Python 97.76%
classification contrastive-learning fine-tuning pseudo-label representation-learning self-supervised-learning semi-supervised-learning time-series transfer-learning unsupervised-learning

ca-tcc's Issues

Problem with self_supervised mode training

When i run the main.py with self_supervised mode training

the following error occurs.

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.

def permutation(x, max_segments=5, seg_mode="random"):
orig_steps = np.arange(x.shape[2])

num_segs = np.random.randint(1, max_segments, size=(x.shape[0]))

ret = np.zeros_like(x)
for i, pat in enumerate(x):
    if num_segs[i] > 1:
        if seg_mode == "random":
            split_points = np.random.choice(x.shape[2] - 2, num_segs[i] - 1, replace=False)
            split_points.sort()
            splits = np.split(orig_steps, split_points)
        else:
            splits = np.array_split(orig_steps, num_segs[i])
        warp = np.concatenate(np.random.permutation(splits)).ravel()     (Error comes from this line)
        ret[i] = pat[0,warp]
    else:
        ret[i] = pat
return torch.from_numpy(ret)

how to solve it? Thanks

Format of the dataset

Thank you very much for providing the code, but due to the lack of format details for data storage, I am unable to reproduce the training. Therefore, could you please provide an introduction to the storage details of the data or upload the file. Contact email: [email protected]

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.