Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ML path selection #60

Open
wants to merge 95 commits into
base: main
Choose a base branch
from
Open

ML path selection #60

wants to merge 95 commits into from

Conversation

sergeyrid
Copy link
Collaborator

No description provided.

sergeyrid and others added 30 commits July 7, 2023 12:19
…th-selection

# Conflicts:
#	buildSrc/src/main/kotlin/Versions.kt
#	usvm-core/src/main/kotlin/org/usvm/Machine.kt
#	usvm-core/src/main/kotlin/org/usvm/ps/PathSelectorFactory.kt
#	usvm-jvm/build.gradle.kts
class CoverageCounterStatistics<State : UState<*, *, *, *, State>>(
private val coverageStatistics: CoverageStatistics<*, *, State>,
private val coverageCounter: CoverageCounter,
private val methodName: String
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we include method signature here?

@emnigma emnigma mentioned this pull request Oct 4, 2023
@sergeyrid sergeyrid requested a review from Saloed October 18, 2023 23:26
testStatementsCounts.values.sum(),
testFinished.values.sumOf { if (it) 1.0 else 0.0 }.toFloat(),
)
return Json.encodeToJsonElement(statistics).jsonObject
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to return a statistics object, avoiding serialization to json.

if (path.isEmpty()) {
return
}
val jsonData = buildJsonObject {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to use serializable object instead of creating a json manually.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first field of this object would need to be a multidimensional array of floats of unknown depth. I can think of 2 ways of making it serializabe: writing a custom serializer or making it a JsonArray. Both options seem to me like doing almost the same thing as creating a json manually, but probably even worse.

@sergeyrid sergeyrid requested a review from Saloed October 30, 2023 20:24
return blockList.map { getBlockFeatures(it) }
}

fun saveGraph(filePath: Path) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to split the BlockGraph data structure and graph printer

env, edgesDataBuffer,
edgesShape.map { it.toLong() }.toLongArray()
)
val result = gnnSession!!.run(mapOf(Pair("x", featuresData), Pair("edge_index", edgesData)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mapOf("x" to featuresData)

)
val result = gnnSession!!.run(mapOf(Pair("x", featuresData), Pair("edge_index", edgesData)))
val output = (result.get("output").get().value as Array<*>).map {
(it as FloatArray).toList()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to use FloatArray if possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants