yuufyu / wahaha Goto Github PK
View Code? Open in Web Editor NEW三人麻雀用AI
License: MIT License
三人麻雀用AI
License: MIT License
I used wahaha_tpu
to train, but I got an error from this block:
class TrainDataset :
"""
Read train dataset from text file
"""
def __init__(self, filename) :
self.filename = filename
with open(filename, 'r') as file :
print("[TrainDataSet]--- start setup ---", filename)
self.content = file.readlines()
print("[TrainDataSet]--- loading is completed ---", filename)
def __len__(self) :
return len(self.content)
def __getitem__(self, idx) :
line = self.content[idx]
inputs, label = line.split(',') # ValueError: too many values to unpack (expected 2)
inputs = inputs.split(' ')
inputs = [int(n) for n in inputs]
label = int(label)
return inputs, label
The text data is generated by this:
filename = "test_data/2020010100gm-00b9-0000-7a6863a8.mjson"
output_dir = "result"
mj2vec = Mj2Vec()
records = load_mjai_records(filename)
mj2vec.process_records(records)
mj2vec.save_to_text(output_dir)
This is obviously incorrect. So I want to ask, what is the correct format of training data? Can you provide a complete data example? Thanks a lot!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.