Git Product home page Git Product logo

silab_dda's Introduction

silab_dda


silab_dda's People

Contributors

zymrael avatar

Stargazers

 avatar

Watchers

 avatar  avatar

silab_dda's Issues

Try to avoid not to use 'Try-except' phrase

silab_dda/TDDAdata.py

Lines 91 to 103 in 5f60ace

try:
testloader = DataLoader(test, batch_size=batch_size,
shuffle=shuffle, num_workers=num_workers)
print('Number of examples in train and test dataloaders: train = {}, test = {}.'\
.format(len(trainloader), len(testloader)))
print('Source, target domain data points in train dataloader: {}, {}; test dataloader: {}, {}.'\
.format(src_count[0], tgt_count[0], src_count[1], tgt_count[1]))
return (trainloader, testloader)
except:
print('Number of examples in the dataloader: {}'.format(len(trainloader)))
print('Source, target domain data points in train dataloader: {}, {}.'\
.format(src_count[0], tgt_count[0]))
return trainloader

It might be done by checking whether 'self.split' == 0

name the chunk of data as a new variable for better visibility

silab_dda/TDDAdata.py

Lines 112 to 114 in 5f60ace

if self.rpm:
sr_train, sr_test, sr_y_train, sr_y_test = train_test_split(self.data[0][:,:self.data[0][0,:].shape[0]-2],\
self.data[0][:,self.data[0][0,:].shape[0]-2:self.data[0][0,:].shape[0]], test_size=1-self.split)

a = self.data[0][:,:self.data[0][0,:].shape[0]-2]
b = self.data[0][:,self.data[0][0,:].shape[0]-2:self.data[0][0,:].shape[0]]

Understanding what a and b refer to is so harsh to me :(

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.