(args)
| 164 | |
| 165 | |
| 166 | def visualize_main(args): |
| 167 | |
| 168 | def load_data(file_name): |
| 169 | extension = os.path.splitext(file_name)[1] |
| 170 | if extension == ".txt": |
| 171 | data = np.loadtxt(file_name) |
| 172 | elif extension == ".npy": |
| 173 | data = np.load(file_name) |
| 174 | else: |
| 175 | raise ValueError("Can't solve file type `%s`" % extension) |
| 176 | return data |
| 177 | |
| 178 | vectors = load_data(args.file) |
| 179 | if args.label: |
| 180 | labels = load_data(args.label) |
| 181 | else: |
| 182 | labels = None |
| 183 | |
| 184 | gv.init_logging(logging.WARNING) |
| 185 | |
| 186 | app = gap.VisualizationApplication(args.dim, [0]) |
| 187 | app.load(vectors=vectors, perplexity=args.perplexity) |
| 188 | app.build() |
| 189 | app.train() |
| 190 | app.visualization(Y=labels, save_file=args.save) |
| 191 | |
| 192 | |
| 193 | def baseline_main(args): |
nothing calls this directly
no test coverage detected