This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs in NAS UI (deferred from previous releases) (#2552)
* Fix NASUI bugs * Add pipeline for NASUI * update log * Move graph utils test to test folder
- Loading branch information
Showing
10 changed files
with
953 additions
and
16 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Graph } from '../graphUtils'; | ||
import * as fs from 'fs'; | ||
|
||
describe('Graph utils test', () => { | ||
it('Graph constructor darts', () => { | ||
const graph = new Graph(JSON.parse(fs.readFileSync('assets/darts/graph.json').toString()), true); | ||
const activation = JSON.parse(fs.readFileSync('assets/darts/log').toString().split('\n')[0]); | ||
expect(graph.nodes.length).toEqual(1842); | ||
expect(graph.edges.length).toEqual(927); | ||
const weights = graph.weightFromMutables(activation); | ||
expect(weights.get('["CNN/ModuleList[cells]/Cell[1]/ModuleList[mutable_ops]/Node[0]/InputChoice[input_switch]/input.228",' + | ||
'"CNN/ModuleList[cells]/Cell[1]/ModuleList[mutable_ops]/Node[1]/ModuleList[ops]/' + | ||
'LayerChoice[2]/PoolBN[maxpool]/MaxPool2d[pool]/input.229"]')).toBeCloseTo(0.125, 3); | ||
}); | ||
|
||
it('Graph constructor naive', () => { | ||
const graph = new Graph(JSON.parse(fs.readFileSync('assets/naive/graph.json').toString()), true); | ||
expect(graph.nodes.length).toEqual(51); | ||
expect(graph.edges.length).toEqual(37); | ||
expect(graph.mutableEdges.get('LayerChoice1')![0].length).toEqual(5); | ||
expect(graph.mutableEdges.get('LayerChoice1')![1].length).toEqual(5); | ||
expect(graph.mutableEdges.get('LayerChoice2')![0].length).toEqual(5); | ||
expect(graph.mutableEdges.get('LayerChoice2')![1].length).toEqual(5); | ||
expect(graph.mutableEdges.get('InputChoice3')![0].length).toEqual(4); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters