mirror of
https://github.com/InternLM/InternBootcamp.git
synced 2026-04-19 12:58:04 +00:00
fix symbolic
This commit is contained in:
commit
9f0c6efee5
21 changed files with 5898 additions and 2 deletions
|
|
@ -1 +1,83 @@
|
||||||
{"bootcamp_name": "SymbolicRegression", "sample_number": 100, "config_file": "Symbolic_Regression", "bootcamp_cls_name": "SymbolicRegressionbootcamp"}
|
{"bootcamp_name": "SymbolicRegression", "sample_number": 100, "config_file": "Symbolic_Regression", "bootcamp_cls_name": "SymbolicRegressionbootcamp"}
|
||||||
|
{"bootcamp_name": "cipher", "sample_number": 3, "config_file": "cipher", "bootcamp_cls_name": "Cipherbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicDefinitions", "sample_number": 64, "config_file": "korLogicDefinitions", "bootcamp_cls_name": "KorLogicDefinitionsbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicCooperativePrinciple", "sample_number": 64, "config_file": "korLogicCooperativePrinciple", "bootcamp_cls_name": "KorLogicCooperativePrinciplebootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicodeffe0", "sample_number": 64, "config_file": "korOperationUnicodeffe0", "bootcamp_cls_name": "KorOperationUnicodeffe0bootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicEpistemicLogic", "sample_number": 64, "config_file": "korLogicEpistemicLogic", "bootcamp_cls_name": "KorLogicEpistemicLogicbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicDerivativeReasoningOfPropositionalLogic", "sample_number": 64, "config_file": "korLogicDerivativeReasoningOfPropositionalLogic", "bootcamp_cls_name": "KorLogicDerivativeReasoningOfPropositionalLogicbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicTruthValueModalPropositions", "sample_number": 64, "config_file": "korLogicTruthValueModalPropositions", "bootcamp_cls_name": "KorLogicTruthValueModalPropositionsbootcamp"}
|
||||||
|
{"bootcamp_name": "BBEHBuggyTables", "sample_number": 64, "config_file": "BBEHBuggyTables", "bootcamp_cls_name": "BBEHBuggyTablesbootcamp"}
|
||||||
|
{"bootcamp_name": "BbehWordSorting", "sample_number": 64, "config_file": "BbehWordSorting", "bootcamp_cls_name": "BbehWordSortingbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicFigureOfTheSyllogism", "sample_number": 64, "config_file": "korLogicFigureOfTheSyllogism", "bootcamp_cls_name": "KorLogicFigureOfTheSyllogismbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicResolution", "sample_number": 64, "config_file": "korLogicResolution", "bootcamp_cls_name": "KorLogicResolutionbootcamp"}
|
||||||
|
{"bootcamp_name": "thermometers", "sample_number": 64, "config_file": "thermometers", "bootcamp_cls_name": "Thermometersbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleCalcudoko", "sample_number": 64, "config_file": "korPuzzleCalcudoko", "bootcamp_cls_name": "KorPuzzleCalcudokobootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzle24Points", "sample_number": 64, "config_file": "korPuzzle24Points", "bootcamp_cls_name": "KorPuzzle24Pointsbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode2295", "sample_number": 64, "config_file": "korOperationUnicode2295", "bootcamp_cls_name": "KorOperationUnicode2295bootcamp"}
|
||||||
|
{"bootcamp_name": "nonograms", "sample_number": 64, "config_file": "nonograms", "bootcamp_cls_name": "Nonogramsbootcamp"}
|
||||||
|
{"bootcamp_name": "bbehboardgameqa", "sample_number": 64, "config_file": "bbeh_boardgame_qa", "bootcamp_cls_name": "Bbehboardgameqabootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicEquivalenceCalculus", "sample_number": 64, "config_file": "korLogicEquivalenceCalculus", "bootcamp_cls_name": "KorLogicEquivalenceCalculusbootcamp"}
|
||||||
|
{"bootcamp_name": "dominosa", "sample_number": 64, "config_file": "dominosa", "bootcamp_cls_name": "Dominosabootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleCryptoMath", "sample_number": 64, "config_file": "korPuzzleCryptoMath", "bootcamp_cls_name": "KorPuzzleCryptoMathbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicAnalogicalReasoning", "sample_number": 64, "config_file": "korLogicAnalogicalReasoning", "bootcamp_cls_name": "KorLogicAnalogicalReasoningbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25bd", "sample_number": 64, "config_file": "korOperationUnicode25bd", "bootcamp_cls_name": "KorOperationUnicode25bdbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleWordBrainTeasers", "sample_number": 64, "config_file": "korPuzzleWordBrainTeasers", "bootcamp_cls_name": "KorPuzzleWordBrainTeasersbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25a1", "sample_number": 64, "config_file": "korOperationUnicode25a1", "bootcamp_cls_name": "KorOperationUnicode25a1bootcamp"}
|
||||||
|
{"bootcamp_name": "kakurasu", "sample_number": 64, "config_file": "kakurasu", "bootcamp_cls_name": "Kakurasubootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicLogicalMethodsForExploringCauseAndEffectRelationships", "sample_number": 64, "config_file": "korLogicLogicalMethodsForExploringCauseAndEffectRelationships", "bootcamp_cls_name": "KorLogicLogicalMethodsForExploringCauseAndEffectRelationshipsbootcamp"}
|
||||||
|
{"bootcamp_name": "binairo", "sample_number": 64, "config_file": "binairo", "bootcamp_cls_name": "Binairobootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicInductionParadox", "sample_number": 64, "config_file": "korLogicInductionParadox", "bootcamp_cls_name": "KorLogicInductionParadoxbootcamp"}
|
||||||
|
{"bootcamp_name": "galaxies", "sample_number": 64, "config_file": "galaxies", "bootcamp_cls_name": "Galaxiesbootcamp"}
|
||||||
|
{"bootcamp_name": "BbehMultistepArithmetic", "sample_number": 64, "config_file": "BbehMultistepArithmetic", "bootcamp_cls_name": "BbehMultistepArithmeticbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicPropositionalLogicFormalization", "sample_number": 64, "config_file": "korLogicPropositionalLogicFormalization", "bootcamp_cls_name": "KorLogicPropositionalLogicFormalizationbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25cb", "sample_number": 64, "config_file": "korOperationUnicode25cb", "bootcamp_cls_name": "KorOperationUnicode25cbbootcamp"}
|
||||||
|
{"bootcamp_name": "LightUp", "sample_number": 64, "config_file": "Light_Up", "bootcamp_cls_name": "LightUpbootcamp"}
|
||||||
|
{"bootcamp_name": "starbattle", "sample_number": 64, "config_file": "starbattle", "bootcamp_cls_name": "Starbattlebootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25b3", "sample_number": 64, "config_file": "korOperationUnicode25b3", "bootcamp_cls_name": "KorOperationUnicode25b3bootcamp"}
|
||||||
|
{"bootcamp_name": "sudoku", "sample_number": 64, "config_file": "sudoku", "bootcamp_cls_name": "Sudokubootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicSpeechActs", "sample_number": 64, "config_file": "korLogicSpeechActs", "bootcamp_cls_name": "KorLogicSpeechActsbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25a0", "sample_number": 64, "config_file": "korOperationUnicode25a0", "bootcamp_cls_name": "KorOperationUnicode25a0bootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicStatisticalReasoning", "sample_number": 64, "config_file": "korLogicStatisticalReasoning", "bootcamp_cls_name": "KorLogicStatisticalReasoningbootcamp"}
|
||||||
|
{"bootcamp_name": "aquarium", "sample_number": 64, "config_file": "aquarium", "bootcamp_cls_name": "Aquariumbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicEnumerativeInductiveReasoning", "sample_number": 64, "config_file": "korLogicEnumerativeInductiveReasoning", "bootcamp_cls_name": "KorLogicEnumerativeInductiveReasoningbootcamp"}
|
||||||
|
{"bootcamp_name": "minesweeper", "sample_number": 64, "config_file": "minesweeper", "bootcamp_cls_name": "Minesweeperbootcamp"}
|
||||||
|
{"bootcamp_name": "futoshiki", "sample_number": 64, "config_file": "futoshiki", "bootcamp_cls_name": "Futoshikibootcamp"}
|
||||||
|
{"bootcamp_name": "BbehWebOfLies", "sample_number": 64, "config_file": "BbehWebOfLies", "bootcamp_cls_name": "BbehWebOfLiesbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode2605", "sample_number": 64, "config_file": "korOperationUnicode2605", "bootcamp_cls_name": "KorOperationUnicode2605bootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleLogicPuzzle", "sample_number": 64, "config_file": "korPuzzleLogicPuzzle", "bootcamp_cls_name": "KorPuzzleLogicPuzzlebootcamp"}
|
||||||
|
{"bootcamp_name": "BbehGeometricShapes", "sample_number": 64, "config_file": "BbehGeometricShapes", "bootcamp_cls_name": "BbehGeometricShapesbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleWordRootsAndAffixes", "sample_number": 64, "config_file": "korPuzzleWordRootsAndAffixes", "bootcamp_cls_name": "KorPuzzleWordRootsAndAffixesbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleSkyscrapers", "sample_number": 64, "config_file": "korPuzzleSkyscrapers", "bootcamp_cls_name": "KorPuzzleSkyscrapersbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25cf", "sample_number": 64, "config_file": "korOperationUnicode25cf", "bootcamp_cls_name": "KorOperationUnicode25cfbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicPredicateLogicFormalization", "sample_number": 64, "config_file": "korLogicPredicateLogicFormalization", "bootcamp_cls_name": "KorLogicPredicateLogicFormalizationbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleArrowMaze", "sample_number": 64, "config_file": "korPuzzleArrowMaze", "bootcamp_cls_name": "KorPuzzleArrowMazebootcamp"}
|
||||||
|
{"bootcamp_name": "bbehshuffobject", "sample_number": 64, "config_file": "bbeh_shuff_object", "bootcamp_cls_name": "Bbehshuffobjectbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleKukurasu", "sample_number": 64, "config_file": "korPuzzleKukurasu", "bootcamp_cls_name": "KorPuzzleKukurasubootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicDynamicLogic", "sample_number": 64, "config_file": "korLogicDynamicLogic", "bootcamp_cls_name": "KorLogicDynamicLogicbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicDisjunctiveNormalFormAndConjunctiveNormalForm", "sample_number": 64, "config_file": "korLogicDisjunctiveNormalFormAndConjunctiveNormalForm", "bootcamp_cls_name": "KorLogicDisjunctiveNormalFormAndConjunctiveNormalFormbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleWordscapes", "sample_number": 64, "config_file": "korPuzzleWordscapes", "bootcamp_cls_name": "KorPuzzleWordscapesbootcamp"}
|
||||||
|
{"bootcamp_name": "bbehobjectproperties", "sample_number": 64, "config_file": "bbeh_object_properties", "bootcamp_cls_name": "Bbehobjectpropertiesbootcamp"}
|
||||||
|
{"bootcamp_name": "stitches", "sample_number": 64, "config_file": "stitches", "bootcamp_cls_name": "Stitchesbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleWordLadder", "sample_number": 64, "config_file": "korPuzzleWordLadder", "bootcamp_cls_name": "KorPuzzleWordLadderbootcamp"}
|
||||||
|
{"bootcamp_name": "BbehDyckLanguages", "sample_number": 64, "config_file": "BbehDyckLanguages", "bootcamp_cls_name": "BbehDyckLanguagesbootcamp"}
|
||||||
|
{"bootcamp_name": "calcudoku", "sample_number": 64, "config_file": "calcudoku", "bootcamp_cls_name": "Calcudokubootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicodeffe1", "sample_number": 64, "config_file": "korOperationUnicodeffe1", "bootcamp_cls_name": "KorOperationUnicodeffe1bootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleCampsite", "sample_number": 64, "config_file": "korPuzzleCampsite", "bootcamp_cls_name": "KorPuzzleCampsitebootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode20ac", "sample_number": 64, "config_file": "korOperationUnicode20ac", "bootcamp_cls_name": "KorOperationUnicode20acbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicPropositionalLogicConcepts", "sample_number": 64, "config_file": "korLogicPropositionalLogicConcepts", "bootcamp_cls_name": "KorLogicPropositionalLogicConceptsbootcamp"}
|
||||||
|
{"bootcamp_name": "arc", "sample_number": 64, "config_file": "arc", "bootcamp_cls_name": "Arcbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleWordSearch", "sample_number": 64, "config_file": "korPuzzleWordSearch", "bootcamp_cls_name": "KorPuzzleWordSearchbootcamp"}
|
||||||
|
{"bootcamp_name": "cryptomath", "sample_number": 64, "config_file": "crypto_math", "bootcamp_cls_name": "Cryptomathbootcamp"}
|
||||||
|
{"bootcamp_name": "arrowmaze", "sample_number": 64, "config_file": "arrowmaze", "bootcamp_cls_name": "Arrowmazebootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicTemporalPropositions", "sample_number": 64, "config_file": "korLogicTemporalPropositions", "bootcamp_cls_name": "KorLogicTemporalPropositionsbootcamp"}
|
||||||
|
{"bootcamp_name": "bbehbooleanexpressions", "sample_number": 64, "config_file": "bbeh_boolean_expressions", "bootcamp_cls_name": "Bbehbooleanexpressionsbootcamp"}
|
||||||
|
{"bootcamp_name": "tents", "sample_number": 64, "config_file": "tents", "bootcamp_cls_name": "Tentsbootcamp"}
|
||||||
|
{"bootcamp_name": "bbehobjectcounting", "sample_number": 64, "config_file": "bbeh_object_counting", "bootcamp_cls_name": "Bbehobjectcountingbootcamp"}
|
||||||
|
{"bootcamp_name": "game24", "sample_number": 64, "config_file": "game24", "bootcamp_cls_name": "Game24bootcamp"}
|
||||||
|
{"bootcamp_name": "maze", "sample_number": 64, "config_file": "maze", "bootcamp_cls_name": "Mazebootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25ce", "sample_number": 64, "config_file": "korOperationUnicode25ce", "bootcamp_cls_name": "KorOperationUnicode25cebootcamp"}
|
||||||
|
{"bootcamp_name": "campsite", "sample_number": 64, "config_file": "campsite", "bootcamp_cls_name": "Campsitebootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicCanonicalPropositions", "sample_number": 64, "config_file": "korLogicCanonicalPropositions", "bootcamp_cls_name": "KorLogicCanonicalPropositionsbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleConnectWords", "sample_number": 64, "config_file": "korPuzzleConnectWords", "bootcamp_cls_name": "KorPuzzleConnectWordsbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicFormalFallacies", "sample_number": 64, "config_file": "korLogicFormalFallacies", "bootcamp_cls_name": "KorLogicFormalFallaciesbootcamp"}
|
||||||
|
{"bootcamp_name": "BBEHHyperbaton", "sample_number": 64, "config_file": "BBEHHyperbaton", "bootcamp_cls_name": "BBEHHyperbatonbootcamp"}
|
||||||
|
|
|
||||||
|
|
@ -1 +1,83 @@
|
||||||
{"bootcamp_name": "SymbolicRegression", "sample_number": 30000, "config_file": "Symbolic_Regression", "bootcamp_cls_name": "SymbolicRegressionbootcamp"}
|
{"bootcamp_name": "SymbolicRegression", "sample_number": 30000, "config_file": "Symbolic_Regression", "bootcamp_cls_name": "SymbolicRegressionbootcamp"}
|
||||||
|
{"bootcamp_name": "cipher", "sample_number": 200, "config_file": "cipher", "bootcamp_cls_name": "Cipherbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicDisjunctiveNormalFormAndConjunctiveNormalForm", "sample_number": 1000, "config_file": "korLogicDisjunctiveNormalFormAndConjunctiveNormalForm", "bootcamp_cls_name": "KorLogicDisjunctiveNormalFormAndConjunctiveNormalFormbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicFigureOfTheSyllogism", "sample_number": 1000, "config_file": "korLogicFigureOfTheSyllogism", "bootcamp_cls_name": "KorLogicFigureOfTheSyllogismbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzle24Points", "sample_number": 1000, "config_file": "korPuzzle24Points", "bootcamp_cls_name": "KorPuzzle24Pointsbootcamp"}
|
||||||
|
{"bootcamp_name": "stitches", "sample_number": 2000, "config_file": "stitches", "bootcamp_cls_name": "Stitchesbootcamp"}
|
||||||
|
{"bootcamp_name": "bbehobjectproperties", "sample_number": 2000, "config_file": "bbeh_object_properties", "bootcamp_cls_name": "Bbehobjectpropertiesbootcamp"}
|
||||||
|
{"bootcamp_name": "thermometers", "sample_number": 2000, "config_file": "thermometers", "bootcamp_cls_name": "Thermometersbootcamp"}
|
||||||
|
{"bootcamp_name": "BBEHBuggyTables", "sample_number": 2000, "config_file": "BBEHBuggyTables", "bootcamp_cls_name": "BBEHBuggyTablesbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicDynamicLogic", "sample_number": 1000, "config_file": "korLogicDynamicLogic", "bootcamp_cls_name": "KorLogicDynamicLogicbootcamp"}
|
||||||
|
{"bootcamp_name": "futoshiki", "sample_number": 2000, "config_file": "futoshiki", "bootcamp_cls_name": "Futoshikibootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicStatisticalReasoning", "sample_number": 1000, "config_file": "korLogicStatisticalReasoning", "bootcamp_cls_name": "KorLogicStatisticalReasoningbootcamp"}
|
||||||
|
{"bootcamp_name": "nonograms", "sample_number": 2000, "config_file": "nonograms", "bootcamp_cls_name": "Nonogramsbootcamp"}
|
||||||
|
{"bootcamp_name": "bbehboardgameqa", "sample_number": 2000, "config_file": "bbeh_boardgame_qa", "bootcamp_cls_name": "Bbehboardgameqabootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleWordscapes", "sample_number": 1000, "config_file": "korPuzzleWordscapes", "bootcamp_cls_name": "KorPuzzleWordscapesbootcamp"}
|
||||||
|
{"bootcamp_name": "BbehDyckLanguages", "sample_number": 2000, "config_file": "BbehDyckLanguages", "bootcamp_cls_name": "BbehDyckLanguagesbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode2605", "sample_number": 1000, "config_file": "korOperationUnicode2605", "bootcamp_cls_name": "KorOperationUnicode2605bootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicResolution", "sample_number": 1000, "config_file": "korLogicResolution", "bootcamp_cls_name": "KorLogicResolutionbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleCryptoMath", "sample_number": 1000, "config_file": "korPuzzleCryptoMath", "bootcamp_cls_name": "KorPuzzleCryptoMathbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleWordRootsAndAffixes", "sample_number": 1000, "config_file": "korPuzzleWordRootsAndAffixes", "bootcamp_cls_name": "KorPuzzleWordRootsAndAffixesbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleSkyscrapers", "sample_number": 1000, "config_file": "korPuzzleSkyscrapers", "bootcamp_cls_name": "KorPuzzleSkyscrapersbootcamp"}
|
||||||
|
{"bootcamp_name": "cryptomath", "sample_number": 2000, "config_file": "crypto_math", "bootcamp_cls_name": "Cryptomathbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicCanonicalPropositions", "sample_number": 1000, "config_file": "korLogicCanonicalPropositions", "bootcamp_cls_name": "KorLogicCanonicalPropositionsbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicodeffe0", "sample_number": 1000, "config_file": "korOperationUnicodeffe0", "bootcamp_cls_name": "KorOperationUnicodeffe0bootcamp"}
|
||||||
|
{"bootcamp_name": "BbehWebOfLies", "sample_number": 1000, "config_file": "BbehWebOfLies", "bootcamp_cls_name": "BbehWebOfLiesbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicPropositionalLogicFormalization", "sample_number": 1000, "config_file": "korLogicPropositionalLogicFormalization", "bootcamp_cls_name": "KorLogicPropositionalLogicFormalizationbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicDefinitions", "sample_number": 1000, "config_file": "korLogicDefinitions", "bootcamp_cls_name": "KorLogicDefinitionsbootcamp"}
|
||||||
|
{"bootcamp_name": "minesweeper", "sample_number": 2000, "config_file": "minesweeper", "bootcamp_cls_name": "Minesweeperbootcamp"}
|
||||||
|
{"bootcamp_name": "BbehWordSorting", "sample_number": 800, "config_file": "BbehWordSorting", "bootcamp_cls_name": "BbehWordSortingbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicDerivativeReasoningOfPropositionalLogic", "sample_number": 1000, "config_file": "korLogicDerivativeReasoningOfPropositionalLogic", "bootcamp_cls_name": "KorLogicDerivativeReasoningOfPropositionalLogicbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode2295", "sample_number": 1000, "config_file": "korOperationUnicode2295", "bootcamp_cls_name": "KorOperationUnicode2295bootcamp"}
|
||||||
|
{"bootcamp_name": "bbehbooleanexpressions", "sample_number": 2000, "config_file": "bbeh_boolean_expressions", "bootcamp_cls_name": "Bbehbooleanexpressionsbootcamp"}
|
||||||
|
{"bootcamp_name": "starbattle", "sample_number": 2000, "config_file": "starbattle", "bootcamp_cls_name": "Starbattlebootcamp"}
|
||||||
|
{"bootcamp_name": "bbehobjectcounting", "sample_number": 2000, "config_file": "bbeh_object_counting", "bootcamp_cls_name": "Bbehobjectcountingbootcamp"}
|
||||||
|
{"bootcamp_name": "arrowmaze", "sample_number": 2000, "config_file": "arrowmaze", "bootcamp_cls_name": "Arrowmazebootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleLogicPuzzle", "sample_number": 1000, "config_file": "korPuzzleLogicPuzzle", "bootcamp_cls_name": "KorPuzzleLogicPuzzlebootcamp"}
|
||||||
|
{"bootcamp_name": "sudoku", "sample_number": 2000, "config_file": "sudoku", "bootcamp_cls_name": "Sudokubootcamp"}
|
||||||
|
{"bootcamp_name": "arc", "sample_number": 10000, "config_file": "arc", "bootcamp_cls_name": "Arcbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25a1", "sample_number": 1000, "config_file": "korOperationUnicode25a1", "bootcamp_cls_name": "KorOperationUnicode25a1bootcamp"}
|
||||||
|
{"bootcamp_name": "bbehshuffobject", "sample_number": 1000, "config_file": "bbeh_shuff_object", "bootcamp_cls_name": "Bbehshuffobjectbootcamp"}
|
||||||
|
{"bootcamp_name": "game24", "sample_number": 8000, "config_file": "game24", "bootcamp_cls_name": "Game24bootcamp"}
|
||||||
|
{"bootcamp_name": "BbehGeometricShapes", "sample_number": 2000, "config_file": "BbehGeometricShapes", "bootcamp_cls_name": "BbehGeometricShapesbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleKukurasu", "sample_number": 1000, "config_file": "korPuzzleKukurasu", "bootcamp_cls_name": "KorPuzzleKukurasubootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleWordSearch", "sample_number": 1000, "config_file": "korPuzzleWordSearch", "bootcamp_cls_name": "KorPuzzleWordSearchbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicCooperativePrinciple", "sample_number": 1000, "config_file": "korLogicCooperativePrinciple", "bootcamp_cls_name": "KorLogicCooperativePrinciplebootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleCalcudoko", "sample_number": 1000, "config_file": "korPuzzleCalcudoko", "bootcamp_cls_name": "KorPuzzleCalcudokobootcamp"}
|
||||||
|
{"bootcamp_name": "BbehMultistepArithmetic", "sample_number": 2000, "config_file": "BbehMultistepArithmetic", "bootcamp_cls_name": "BbehMultistepArithmeticbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicSpeechActs", "sample_number": 1000, "config_file": "korLogicSpeechActs", "bootcamp_cls_name": "KorLogicSpeechActsbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleWordLadder", "sample_number": 1000, "config_file": "korPuzzleWordLadder", "bootcamp_cls_name": "KorPuzzleWordLadderbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleConnectWords", "sample_number": 1000, "config_file": "korPuzzleConnectWords", "bootcamp_cls_name": "KorPuzzleConnectWordsbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicLogicalMethodsForExploringCauseAndEffectRelationships", "sample_number": 1000, "config_file": "korLogicLogicalMethodsForExploringCauseAndEffectRelationships", "bootcamp_cls_name": "KorLogicLogicalMethodsForExploringCauseAndEffectRelationshipsbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleArrowMaze", "sample_number": 1000, "config_file": "korPuzzleArrowMaze", "bootcamp_cls_name": "KorPuzzleArrowMazebootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleWordBrainTeasers", "sample_number": 1000, "config_file": "korPuzzleWordBrainTeasers", "bootcamp_cls_name": "KorPuzzleWordBrainTeasersbootcamp"}
|
||||||
|
{"bootcamp_name": "LightUp", "sample_number": 2000, "config_file": "Light_Up", "bootcamp_cls_name": "LightUpbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25bd", "sample_number": 1000, "config_file": "korOperationUnicode25bd", "bootcamp_cls_name": "KorOperationUnicode25bdbootcamp"}
|
||||||
|
{"bootcamp_name": "binairo", "sample_number": 2000, "config_file": "binairo", "bootcamp_cls_name": "Binairobootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25b3", "sample_number": 1000, "config_file": "korOperationUnicode25b3", "bootcamp_cls_name": "KorOperationUnicode25b3bootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicFormalFallacies", "sample_number": 1000, "config_file": "korLogicFormalFallacies", "bootcamp_cls_name": "KorLogicFormalFallaciesbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25cb", "sample_number": 1000, "config_file": "korOperationUnicode25cb", "bootcamp_cls_name": "KorOperationUnicode25cbbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicodeffe1", "sample_number": 1000, "config_file": "korOperationUnicodeffe1", "bootcamp_cls_name": "KorOperationUnicodeffe1bootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicTemporalPropositions", "sample_number": 1000, "config_file": "korLogicTemporalPropositions", "bootcamp_cls_name": "KorLogicTemporalPropositionsbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicEquivalenceCalculus", "sample_number": 1000, "config_file": "korLogicEquivalenceCalculus", "bootcamp_cls_name": "KorLogicEquivalenceCalculusbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicEpistemicLogic", "sample_number": 1000, "config_file": "korLogicEpistemicLogic", "bootcamp_cls_name": "KorLogicEpistemicLogicbootcamp"}
|
||||||
|
{"bootcamp_name": "maze", "sample_number": 2000, "config_file": "maze", "bootcamp_cls_name": "Mazebootcamp"}
|
||||||
|
{"bootcamp_name": "calcudoku", "sample_number": 2000, "config_file": "calcudoku", "bootcamp_cls_name": "Calcudokubootcamp"}
|
||||||
|
{"bootcamp_name": "aquarium", "sample_number": 2000, "config_file": "aquarium", "bootcamp_cls_name": "Aquariumbootcamp"}
|
||||||
|
{"bootcamp_name": "kakurasu", "sample_number": 2000, "config_file": "kakurasu", "bootcamp_cls_name": "Kakurasubootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicTruthValueModalPropositions", "sample_number": 1000, "config_file": "korLogicTruthValueModalPropositions", "bootcamp_cls_name": "KorLogicTruthValueModalPropositionsbootcamp"}
|
||||||
|
{"bootcamp_name": "tents", "sample_number": 2000, "config_file": "tents", "bootcamp_cls_name": "Tentsbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicInductionParadox", "sample_number": 1000, "config_file": "korLogicInductionParadox", "bootcamp_cls_name": "KorLogicInductionParadoxbootcamp"}
|
||||||
|
{"bootcamp_name": "korPuzzleCampsite", "sample_number": 1000, "config_file": "korPuzzleCampsite", "bootcamp_cls_name": "KorPuzzleCampsitebootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicAnalogicalReasoning", "sample_number": 1000, "config_file": "korLogicAnalogicalReasoning", "bootcamp_cls_name": "KorLogicAnalogicalReasoningbootcamp"}
|
||||||
|
{"bootcamp_name": "campsite", "sample_number": 2000, "config_file": "campsite", "bootcamp_cls_name": "Campsitebootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25ce", "sample_number": 1000, "config_file": "korOperationUnicode25ce", "bootcamp_cls_name": "KorOperationUnicode25cebootcamp"}
|
||||||
|
{"bootcamp_name": "dominosa", "sample_number": 2000, "config_file": "dominosa", "bootcamp_cls_name": "Dominosabootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode20ac", "sample_number": 1000, "config_file": "korOperationUnicode20ac", "bootcamp_cls_name": "KorOperationUnicode20acbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicEnumerativeInductiveReasoning", "sample_number": 1000, "config_file": "korLogicEnumerativeInductiveReasoning", "bootcamp_cls_name": "KorLogicEnumerativeInductiveReasoningbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicPropositionalLogicConcepts", "sample_number": 1000, "config_file": "korLogicPropositionalLogicConcepts", "bootcamp_cls_name": "KorLogicPropositionalLogicConceptsbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25cf", "sample_number": 1000, "config_file": "korOperationUnicode25cf", "bootcamp_cls_name": "KorOperationUnicode25cfbootcamp"}
|
||||||
|
{"bootcamp_name": "korLogicPredicateLogicFormalization", "sample_number": 1000, "config_file": "korLogicPredicateLogicFormalization", "bootcamp_cls_name": "KorLogicPredicateLogicFormalizationbootcamp"}
|
||||||
|
{"bootcamp_name": "galaxies", "sample_number": 2000, "config_file": "galaxies", "bootcamp_cls_name": "Galaxiesbootcamp"}
|
||||||
|
{"bootcamp_name": "korOperationUnicode25a0", "sample_number": 1000, "config_file": "korOperationUnicode25a0", "bootcamp_cls_name": "KorOperationUnicode25a0bootcamp"}
|
||||||
|
{"bootcamp_name": "BBEHHyperbaton", "sample_number": 1000, "config_file": "BBEHHyperbaton", "bootcamp_cls_name": "BBEHHyperbatonbootcamp"}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"max_atoms": 15,
|
||||||
|
"min_atoms": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"max_atoms": 15,
|
||||||
|
"min_atoms": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"min_len": 5,
|
||||||
|
"max_len": 25
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"min_len": 5,
|
||||||
|
"max_len": 25
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"temperature_range": [
|
||||||
|
-20,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
"temperature_dewpoint_range": [
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"temperature_range": [
|
||||||
|
-15,
|
||||||
|
35
|
||||||
|
],
|
||||||
|
"temperature_dewpoint_range": [
|
||||||
|
0,
|
||||||
|
8
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"temperature_range": [
|
||||||
|
-10,
|
||||||
|
30
|
||||||
|
],
|
||||||
|
"temperature_dewpoint_range": [
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"temperature_range": [
|
||||||
|
-20,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
"temperature_dewpoint_range": [
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"temperature_range": [
|
||||||
|
-15,
|
||||||
|
35
|
||||||
|
],
|
||||||
|
"temperature_dewpoint_range": [
|
||||||
|
0,
|
||||||
|
8
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"temperature_range": [
|
||||||
|
-10,
|
||||||
|
30
|
||||||
|
],
|
||||||
|
"temperature_dewpoint_range": [
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
77
examples/pipelines/puzzle_configs/linearODE_test.json
Normal file
77
examples/pipelines/puzzle_configs/linearODE_test.json
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.15,
|
||||||
|
0.9
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.6,
|
||||||
|
1.8
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
6
|
||||||
|
],
|
||||||
|
"n_points": 60
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.3,
|
||||||
|
2.0
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.7,
|
||||||
|
3.0
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
12
|
||||||
|
],
|
||||||
|
"n_points": 110
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.05,
|
||||||
|
0.4
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.2,
|
||||||
|
1.3
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
8
|
||||||
|
],
|
||||||
|
"n_points": 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.25,
|
||||||
|
1.2
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.4,
|
||||||
|
2.2
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
],
|
||||||
|
"n_points": 70
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.2,
|
||||||
|
1.1
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.3,
|
||||||
|
2.5
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
9
|
||||||
|
],
|
||||||
|
"n_points": 90
|
||||||
|
}
|
||||||
|
]
|
||||||
152
examples/pipelines/puzzle_configs/linearODE_train.json
Normal file
152
examples/pipelines/puzzle_configs/linearODE_train.json
Normal file
|
|
@ -0,0 +1,152 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.1,
|
||||||
|
1.0
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.5,
|
||||||
|
2.0
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"n_points": 50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.2,
|
||||||
|
1.5
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.3,
|
||||||
|
2.5
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"n_points": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.05,
|
||||||
|
0.5
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.4,
|
||||||
|
1.5
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
7
|
||||||
|
],
|
||||||
|
"n_points": 75
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.1,
|
||||||
|
0.8
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.6,
|
||||||
|
2.0
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"n_points": 40
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.3,
|
||||||
|
1.2
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.5,
|
||||||
|
3.0
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
15
|
||||||
|
],
|
||||||
|
"n_points": 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.2,
|
||||||
|
0.8
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.7,
|
||||||
|
2.5
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
6
|
||||||
|
],
|
||||||
|
"n_points": 55
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.5,
|
||||||
|
1.8
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.4,
|
||||||
|
3.0
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
8
|
||||||
|
],
|
||||||
|
"n_points": 90
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.1,
|
||||||
|
0.6
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.3,
|
||||||
|
1.8
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
],
|
||||||
|
"n_points": 60
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.15,
|
||||||
|
1.0
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.5,
|
||||||
|
2.3
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"n_points": 70
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"k_range": [
|
||||||
|
0.3,
|
||||||
|
1.5
|
||||||
|
],
|
||||||
|
"x0_range": [
|
||||||
|
0.6,
|
||||||
|
2.8
|
||||||
|
],
|
||||||
|
"t_span": [
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"n_points": 120
|
||||||
|
}
|
||||||
|
]
|
||||||
29
internbootcamp/bootcamp/ChemStructure2Property/InChI2MRBootCamp.py
Executable file
29
internbootcamp/bootcamp/ChemStructure2Property/InChI2MRBootCamp.py
Executable file
|
|
@ -0,0 +1,29 @@
|
||||||
|
from rdkit import Chem
|
||||||
|
from rdkit.Chem import Crippen
|
||||||
|
from .InChI2logPBootCamp import InChI2logPbootcamp
|
||||||
|
|
||||||
|
class InChI2MRBootCamp(InChI2logPbootcamp):
|
||||||
|
|
||||||
|
def prompt_func(self, InChI) -> str:
|
||||||
|
|
||||||
|
instruction = f"Given the InChI, determine the Molar Refractivity (MR) value of the material. The InChI is: {InChI}"
|
||||||
|
instruction_following = """Let's think step by step and output the final answer within \\boxed{}.The final answer should be one float number. For example "Final Answer: \\boxed{afloat}"."""
|
||||||
|
|
||||||
|
prompt = instruction + '\n' + instruction_following
|
||||||
|
return prompt
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _verify_correction(cls, solution, InChI)->bool:
|
||||||
|
"""
|
||||||
|
Verify the correction of the solution.
|
||||||
|
"""
|
||||||
|
mol = Chem.MolFromInchi(InChI)
|
||||||
|
true_MR = Crippen.MolMR(mol)
|
||||||
|
solution_float = float(solution)
|
||||||
|
|
||||||
|
# Handle case where true_logp is 0
|
||||||
|
if true_MR == 0:
|
||||||
|
return abs(solution_float) <= 0.01 # Just check if solution is close to 0
|
||||||
|
else:
|
||||||
|
return abs(true_MR - solution_float)/abs(true_MR) <= 0.01
|
||||||
|
|
||||||
57
internbootcamp/bootcamp/ChemStructure2Property/InChI2logPBootCamp.py
Executable file
57
internbootcamp/bootcamp/ChemStructure2Property/InChI2logPBootCamp.py
Executable file
|
|
@ -0,0 +1,57 @@
|
||||||
|
from internbootcamp.bootcamp.base import Basebootcamp
|
||||||
|
from internbootcamp.libs.chemStructure2Property.ChemStructureGenerator import InChIGenerator
|
||||||
|
from .utils import last_boxed_only_string, remove_boxed
|
||||||
|
from rdkit import Chem
|
||||||
|
from rdkit.Chem import Crippen
|
||||||
|
|
||||||
|
|
||||||
|
class InChI2logPbootcamp(Basebootcamp):
|
||||||
|
def __init__(self, max_atoms=15, min_atoms=3, elements=None, seed=None):
|
||||||
|
# super.__init__()
|
||||||
|
self.InChIGenerator = InChIGenerator(max_atoms=max_atoms, min_atoms=min_atoms, elements=elements, seed=seed)
|
||||||
|
self.tolerance_factor = tolerance_factor # 1 for 1% error consider true, 0.1 for 0.1% error true, 10 for 10% error
|
||||||
|
|
||||||
|
def case_generator(self) -> str:
|
||||||
|
"""
|
||||||
|
生成一组数字和目标值。
|
||||||
|
"""
|
||||||
|
return self.InChIGenerator.generate_n_valid_inchi(1)[0]
|
||||||
|
|
||||||
|
def prompt_func(self, InChI) -> str:
|
||||||
|
|
||||||
|
instruction = f"Given the InChI, determine the lipophilicity (logP) value of the material. The InChI is: {InChI}"
|
||||||
|
instruction_following = """Let's think step by step and output the final answer within \\boxed{}.The final answer should be one float number. For example "Final Answer: \\boxed{afloat}"."""
|
||||||
|
|
||||||
|
prompt = instruction + '\n' + instruction_following
|
||||||
|
return prompt
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def extract_output(output):
|
||||||
|
"""
|
||||||
|
Extract the output from the solution.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
output: Model output to be processed.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The processed output.
|
||||||
|
"""
|
||||||
|
output = last_boxed_only_string(output)
|
||||||
|
if output is None:
|
||||||
|
return None
|
||||||
|
return remove_boxed(output)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _verify_correction(cls, solution, InChI)->bool:
|
||||||
|
"""
|
||||||
|
Verify the correction of the solution.
|
||||||
|
"""
|
||||||
|
mol = Chem.MolFromInchi(InChI)
|
||||||
|
true_logp = Crippen.MolLogP(mol)
|
||||||
|
solution_float = float(solution)
|
||||||
|
|
||||||
|
# Handle case where true_logp is 0
|
||||||
|
if true_logp == 0:
|
||||||
|
return abs(solution_float) <= 0.01 # Just check if solution is close to 0
|
||||||
|
else:
|
||||||
|
return abs(true_logp - solution_float)/abs(true_logp) <= 0.01
|
||||||
32
internbootcamp/bootcamp/ChemStructure2Property/SMILES2MRBootCamp.py
Executable file
32
internbootcamp/bootcamp/ChemStructure2Property/SMILES2MRBootCamp.py
Executable file
|
|
@ -0,0 +1,32 @@
|
||||||
|
from internbootcamp.bootcamp.base import Basebootcamp
|
||||||
|
from internbootcamp.libs.chemStructure2Property.ChemStructureGenerator import SMILESGenerator
|
||||||
|
from .utils import last_boxed_only_string, remove_boxed
|
||||||
|
from rdkit import Chem
|
||||||
|
from rdkit.Chem import Crippen
|
||||||
|
|
||||||
|
from .SMILES2logPBootCamp import SMILES2logPBootCamp
|
||||||
|
|
||||||
|
class SMILES2MRBootCamp(SMILES2logPBootCamp):
|
||||||
|
|
||||||
|
def prompt_func(self, SMILES) -> str:
|
||||||
|
|
||||||
|
instruction = f"Given the SMILES, determine the Molar Refractivity (MR) value of the material. The SMILES is: {SMILES}"
|
||||||
|
instruction_following = """Let's think step by step and output the final answer within \\boxed{}.The final answer should be one float number. For example "Final Answer: \\boxed{afloat}"."""
|
||||||
|
|
||||||
|
prompt = instruction + '\n' + instruction_following
|
||||||
|
return prompt
|
||||||
|
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _verify_correction(cls, solution, SMILES)->bool:
|
||||||
|
"""
|
||||||
|
Verify the correction of the solution.
|
||||||
|
"""
|
||||||
|
mol = Chem.MolFromSmiles(SMILES)
|
||||||
|
true_MR = Crippen.MolMR(mol)
|
||||||
|
solution_float = float(solution)
|
||||||
|
if true_MR == 0:
|
||||||
|
return abs(solution_float) <= 0.01 # Just check if solution is close to 0
|
||||||
|
else:
|
||||||
|
return abs(true_MR - solution_float)/abs(true_MR) <= 0.01
|
||||||
|
|
||||||
41
internbootcamp/bootcamp/ChemStructure2Property/SMILES2logPBootCamp.py
Executable file
41
internbootcamp/bootcamp/ChemStructure2Property/SMILES2logPBootCamp.py
Executable file
|
|
@ -0,0 +1,41 @@
|
||||||
|
from internbootcamp.bootcamp.base import Basebootcamp
|
||||||
|
from internbootcamp.libs.chemStructure2Property.ChemStructureGenerator import SMILESGenerator
|
||||||
|
from .utils import last_boxed_only_string, remove_boxed
|
||||||
|
from rdkit import Chem
|
||||||
|
from rdkit.Chem import Crippen
|
||||||
|
|
||||||
|
from .InChI2logPBootCamp import InChI2logPbootcamp
|
||||||
|
|
||||||
|
class SMILES2logPBootCamp(InChI2logPbootcamp):
|
||||||
|
def __init__(self,min_len=5, max_len=25,
|
||||||
|
seed=None):
|
||||||
|
# super.__init__()
|
||||||
|
self.SMILESGenerator = SMILESGenerator(min_len=min_len, max_len=max_len, seed=seed)
|
||||||
|
|
||||||
|
def case_generator(self) -> str:
|
||||||
|
"""
|
||||||
|
生成一组数字和目标值。
|
||||||
|
"""
|
||||||
|
return self.SMILESGenerator.generate_n_valid_smiles(1)[0]
|
||||||
|
|
||||||
|
def prompt_func(self, SMILES) -> str:
|
||||||
|
|
||||||
|
instruction = f"Given the SMILES, determine the lipophilicity (logP) value of the material. The SMILES is: {SMILES}"
|
||||||
|
instruction_following = """Let's think step by step and output the final answer within \\boxed{}.The final answer should be one float number. For example "Final Answer: \\boxed{afloat}"."""
|
||||||
|
|
||||||
|
prompt = instruction + '\n' + instruction_following
|
||||||
|
return prompt
|
||||||
|
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _verify_correction(cls, solution, SMILES)->bool:
|
||||||
|
"""
|
||||||
|
Verify the correction of the solution.
|
||||||
|
"""
|
||||||
|
mol = Chem.MolFromSmiles(SMILES)
|
||||||
|
true_logp = Crippen.MolLogP(mol)
|
||||||
|
solution_float = float(solution)
|
||||||
|
if true_logp == 0:
|
||||||
|
return abs(solution_float) <= 0.01 # Just check if solution is close to 0
|
||||||
|
else:
|
||||||
|
return abs(true_logp - solution_float)/abs(true_logp) <= 0.01
|
||||||
43
internbootcamp/bootcamp/ChemStructure2Property/utils.py
Normal file
43
internbootcamp/bootcamp/ChemStructure2Property/utils.py
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
|
||||||
|
def remove_boxed(s):
|
||||||
|
if "\\boxed " in s:
|
||||||
|
left = "\\boxed "
|
||||||
|
assert s[:len(left)] == left
|
||||||
|
return s[len(left):]
|
||||||
|
|
||||||
|
left = "\\boxed{"
|
||||||
|
|
||||||
|
assert s[:len(left)] == left
|
||||||
|
assert s[-1] == "}"
|
||||||
|
|
||||||
|
return s[len(left):-1]
|
||||||
|
|
||||||
|
|
||||||
|
def last_boxed_only_string(string):
|
||||||
|
idx = string.rfind("\\boxed")
|
||||||
|
if "\\boxed " in string:
|
||||||
|
return "\\boxed " + string.split("\\boxed ")[-1].split("$")[0]
|
||||||
|
if idx < 0:
|
||||||
|
idx = string.rfind("\\fbox")
|
||||||
|
if idx < 0:
|
||||||
|
return None
|
||||||
|
|
||||||
|
i = idx
|
||||||
|
right_brace_idx = None
|
||||||
|
num_left_braces_open = 0
|
||||||
|
while i < len(string):
|
||||||
|
if string[i] == "{":
|
||||||
|
num_left_braces_open += 1
|
||||||
|
if string[i] == "}":
|
||||||
|
num_left_braces_open -= 1
|
||||||
|
if num_left_braces_open == 0:
|
||||||
|
right_brace_idx = i
|
||||||
|
break
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
if right_brace_idx is None:
|
||||||
|
retval = None
|
||||||
|
else:
|
||||||
|
retval = string[idx:right_brace_idx + 1]
|
||||||
|
|
||||||
|
return retval
|
||||||
|
|
@ -30,6 +30,13 @@ from .bbeh_hyperbaton.hyperbaton_default import BBEHHyperbatonbootcamp
|
||||||
from .bbeh_boardgame_qa.bbeh_boardgame_qa import Bbehboardgameqabootcamp
|
from .bbeh_boardgame_qa.bbeh_boardgame_qa import Bbehboardgameqabootcamp
|
||||||
from .bbeh_boolean_expressions.bbeh_boolean_expressions import Bbehbooleanexpressionsbootcamp
|
from .bbeh_boolean_expressions.bbeh_boolean_expressions import Bbehbooleanexpressionsbootcamp
|
||||||
|
|
||||||
|
|
||||||
|
from .ChemStructure2Property.InChI2logPBootCamp import InChI2logPbootcamp
|
||||||
|
from .ChemStructure2Property.InChI2MRBootCamp import InChI2MRBootCamp
|
||||||
|
from .ChemStructure2Property.SMILES2logPBootCamp import SMILES2logPBootCamp
|
||||||
|
from .ChemStructure2Property.SMILES2MRBootCamp import SMILES2MRBootCamp
|
||||||
|
|
||||||
|
|
||||||
from .kakurasu.kakurasu import Kakurasubootcamp
|
from .kakurasu.kakurasu import Kakurasubootcamp
|
||||||
from .nonograms.nonograms import Nonogramsbootcamp
|
from .nonograms.nonograms import Nonogramsbootcamp
|
||||||
from .hitori.hitori import Hitoribootcamp
|
from .hitori.hitori import Hitoribootcamp
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
import re
|
||||||
|
import json
|
||||||
|
import numpy as np
|
||||||
|
from internbootcamp.bootcamp.base import Basebootcamp
|
||||||
|
|
||||||
|
|
||||||
|
class earth_dew2humidity(Basebootcamp):
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
temperature_range=(-20, 40),
|
||||||
|
temperature_dewpoint_range=(0, 10),
|
||||||
|
seed=None
|
||||||
|
):
|
||||||
|
self.temperature_range, self.temperature_dewpoint_range = temperature_range, temperature_dewpoint_range
|
||||||
|
if seed is not None:
|
||||||
|
np.random.seed(seed)
|
||||||
|
|
||||||
|
def case_generator(self):
|
||||||
|
# 1. 随机采样参数 dewpoint 和 temperature
|
||||||
|
temperature_original = float(np.random.uniform(*self.temperature_range))
|
||||||
|
dewpoint_original = temperature_original - float(np.random.uniform(*self.temperature_dewpoint_range))
|
||||||
|
# 2. 计算湿度
|
||||||
|
dewpoint = dewpoint_original + 273.15
|
||||||
|
temperature = temperature_original + 273.15
|
||||||
|
e = 611.2 * np.exp(17.67 * (dewpoint - 273.15) / (dewpoint - 29.65))
|
||||||
|
e_s = 611.2 * np.exp(17.67 * (temperature - 273.15) / (temperature - 29.65))
|
||||||
|
rh = e / e_s * 100
|
||||||
|
return {"dewpoint": dewpoint_original, "temperature": temperature_original, "humidity": float(rh)}
|
||||||
|
|
||||||
|
def prompt_func(self, identity) -> str:
|
||||||
|
dewpoint = identity["dewpoint"]
|
||||||
|
temperature = identity["temperature"]
|
||||||
|
return (
|
||||||
|
f"下面给出露点温度(dewpoint)={dewpoint} (摄氏度)\n温度(temperature)={temperature} (摄氏度)\n"
|
||||||
|
"请计算湿度,计算公式为:\n"
|
||||||
|
"dewpoint = dewpoint + 273.15,temperature = temperature + 273.15\n"
|
||||||
|
"e = 611.2 * np.exp(17.67 * (dewpoint - 273.15) / (dewpoint - 29.65))\n"
|
||||||
|
"e_s = 611.2 * np.exp(17.67 * (temperature - 273.15) / (temperature - 29.65))\n"
|
||||||
|
"relative humidity = e / e_s * 100\n"
|
||||||
|
"只需返回 “relative humidity = ”。"
|
||||||
|
)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def extract_output(output: str) -> str:
|
||||||
|
# 用正则提取“relative humidity = …”右侧的表达式
|
||||||
|
m = re.search(r"relative humidity\s*=\s*([^\n\r]+)", output)
|
||||||
|
return m.group(1).strip() if m else None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _verify_correction(cls, solution: str, identity: dict) -> bool:
|
||||||
|
# 解析 LLM 给出的系数 c,形如 “c*x”
|
||||||
|
solution = solution.replace(" ", "")
|
||||||
|
try:
|
||||||
|
c = float(solution)
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
# print(c)
|
||||||
|
# 验证 c ≈ k
|
||||||
|
return abs(c - identity["humidity"]) < 1e-2
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
bootcamp = earth_dew2humidity(seed=123)
|
||||||
|
# 生成几个样例
|
||||||
|
examples = [bootcamp.case_generator() for _ in range(3)]
|
||||||
|
print(examples)
|
||||||
|
print(bootcamp.prompt_func(examples[0]))
|
||||||
|
print(bootcamp.extract_output("xxxxx relative humidity = 111222 "))
|
||||||
|
solution = bootcamp.extract_output("xxxxx relative humidity = 84.79 ")
|
||||||
|
print(bootcamp._verify_correction(solution, examples[0]))
|
||||||
|
solution = bootcamp.extract_output("xxxxx relative humidity = 83.79 ")
|
||||||
|
print(bootcamp._verify_correction(solution, examples[0]))
|
||||||
|
|
||||||
|
for identity in examples:
|
||||||
|
# 构造“模型”返回答案,模拟 LLM 的输出
|
||||||
|
humidity = identity["humidity"]
|
||||||
|
sol = f"{humidity:.4f}"
|
||||||
|
# 调用 Basebootcamp 提供的 verify_score 接口进行验证
|
||||||
|
score = bootcamp.verify_score(sol, identity, short_threshold=1e-2)
|
||||||
|
# 打印结果
|
||||||
|
print(json.dumps({
|
||||||
|
"identity": identity,
|
||||||
|
"solution": sol,
|
||||||
|
"verify_score": score
|
||||||
|
}, ensure_ascii=False, indent=2))
|
||||||
78
internbootcamp/bootcamp/linearODE/linearODE.py
Normal file
78
internbootcamp/bootcamp/linearODE/linearODE.py
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
import re
|
||||||
|
import json
|
||||||
|
import numpy as np
|
||||||
|
from scipy.integrate import odeint
|
||||||
|
from internbootcamp.bootcamp.base import Basebootcamp
|
||||||
|
|
||||||
|
|
||||||
|
class LinearODEBootcamp(Basebootcamp):
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
k_range=(0.1, 1.0),
|
||||||
|
x0_range=(0.5, 2.0),
|
||||||
|
t_span=(0, 5),
|
||||||
|
n_points=50,
|
||||||
|
seed=None
|
||||||
|
):
|
||||||
|
self.k_range, self.x0_range = k_range, x0_range
|
||||||
|
self.t0, self.t1 = t_span
|
||||||
|
self.n_points = n_points
|
||||||
|
if seed is not None:
|
||||||
|
np.random.seed(seed)
|
||||||
|
|
||||||
|
def case_generator(self):
|
||||||
|
# 1. 随机采样参数 k 和初始值 x0
|
||||||
|
k = float(np.random.uniform(*self.k_range))
|
||||||
|
x0 = float(np.random.uniform(*self.x0_range))
|
||||||
|
# 2. 构造时间序列并模拟 dx/dt = -k * x
|
||||||
|
t = np.linspace(self.t0, self.t1, self.n_points).tolist()
|
||||||
|
def model(x, t_val):
|
||||||
|
return -k * x
|
||||||
|
x = odeint(model, x0, t).flatten().tolist()
|
||||||
|
return {"t": t, "x": x, "k": k}
|
||||||
|
|
||||||
|
def prompt_func(self, identity) -> str:
|
||||||
|
# 将 (t, x) 对格式化为提示
|
||||||
|
points = ", ".join(f"({t:.2f}, {x:.2f})"
|
||||||
|
for t, x in zip(identity["t"], identity["x"]))
|
||||||
|
return (
|
||||||
|
f"下面给出变量 x(t) 的观测数据点:\n{points}\n\n"
|
||||||
|
"请找出其满足的微分方程,形式为:dx/dt = f(x)。\n"
|
||||||
|
"只需返回 “dx/dt = <表达式>”。"
|
||||||
|
)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def extract_output(output: str) -> str:
|
||||||
|
# 用正则提取“dx/dt = …”右侧的表达式
|
||||||
|
m = re.search(r"dx/dt\s*=\s*([^\n\r]+)", output)
|
||||||
|
return m.group(1).strip() if m else None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _verify_correction(cls, solution: str, identity: dict) -> bool:
|
||||||
|
# 解析 LLM 给出的系数 c,形如 “c*x”
|
||||||
|
sol = solution.replace(" ", "")
|
||||||
|
match = re.fullmatch(r"([\-0-9\.eE]+)\*x", sol)
|
||||||
|
if not match:
|
||||||
|
return False
|
||||||
|
c = float(match.group(1))
|
||||||
|
# 验证 c ≈ -k
|
||||||
|
return abs(c + identity["k"]) < 1e-2
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
bootcamp = LinearODEBootcamp(seed=123)
|
||||||
|
# 生成几个样例
|
||||||
|
examples = [bootcamp.case_generator() for _ in range(3)]
|
||||||
|
|
||||||
|
for identity in examples:
|
||||||
|
# 构造“模型”返回答案,模拟 LLM 的输出
|
||||||
|
coeff = -identity["k"]
|
||||||
|
sol = f"{coeff:.4f}*x"
|
||||||
|
# 调用 Basebootcamp 提供的 verify_score 接口进行验证
|
||||||
|
score = bootcamp.verify_score(sol, identity, short_threshold=1e-2)
|
||||||
|
# 打印结果
|
||||||
|
print(json.dumps({
|
||||||
|
"identity": identity,
|
||||||
|
"solution": sol,
|
||||||
|
"verify_score": score
|
||||||
|
}, ensure_ascii=False, indent=2))
|
||||||
4755
internbootcamp/bootcamp/med_calculator/med_calculator.json
Normal file
4755
internbootcamp/bootcamp/med_calculator/med_calculator.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,11 @@
|
||||||
import json
|
import json
|
||||||
import math
|
import math
|
||||||
import random
|
import random
|
||||||
|
<<<<<<< HEAD
|
||||||
from bootcamp import Basebootcamp
|
from bootcamp import Basebootcamp
|
||||||
|
=======
|
||||||
|
from internbootcamp.bootcamp.base import Basebootcamp
|
||||||
|
>>>>>>> remotes/origin/main
|
||||||
|
|
||||||
def remove_boxed(s):
|
def remove_boxed(s):
|
||||||
if "\\boxed " in s:
|
if "\\boxed " in s:
|
||||||
|
|
@ -154,7 +158,11 @@ class Medcalculatorbootcamp(Basebootcamp): # 医学计算器类
|
||||||
return cases
|
return cases
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
<<<<<<< HEAD
|
||||||
bootcamp = MedCalculatorbootcamp(seed=42)
|
bootcamp = MedCalculatorbootcamp(seed=42)
|
||||||
|
=======
|
||||||
|
bootcamp = MedCalculatorSandbox(seed=42)
|
||||||
|
>>>>>>> remotes/origin/main
|
||||||
identity = bootcamp.case_generator()
|
identity = bootcamp.case_generator()
|
||||||
print(f'{identity = }')
|
print(f'{identity = }')
|
||||||
|
|
||||||
|
|
|
||||||
279
internbootcamp/libs/chemStructure2Property/ChemStructureGenerator.py
Executable file
279
internbootcamp/libs/chemStructure2Property/ChemStructureGenerator.py
Executable file
|
|
@ -0,0 +1,279 @@
|
||||||
|
import random
|
||||||
|
from rdkit import Chem
|
||||||
|
from rdkit import RDLogger
|
||||||
|
from rdkit.Chem.inchi import MolToInchi
|
||||||
|
from rdkit.Chem import Crippen
|
||||||
|
|
||||||
|
|
||||||
|
class InChIGenerator:
|
||||||
|
def __init__(self, max_atoms=15, min_atoms=3, elements=None,
|
||||||
|
seed=None):
|
||||||
|
RDLogger.DisableLog('rdApp.*')
|
||||||
|
random.seed(42) if seed is None else random.seed(seed)
|
||||||
|
self.max_atoms = max_atoms
|
||||||
|
self.min_atoms = min_atoms
|
||||||
|
if elements is None:
|
||||||
|
self.elements = ['C', 'N', 'O', 'S', 'P', 'F', 'Cl', 'Br', 'I']
|
||||||
|
else:
|
||||||
|
self.elements = elements
|
||||||
|
|
||||||
|
def generate_random_molecule_rdkit(self):
|
||||||
|
"""
|
||||||
|
Generates a random molecule using RDKit's RWMol.
|
||||||
|
Can optionally try to assign random stereochemistry.
|
||||||
|
"""
|
||||||
|
|
||||||
|
rw_mol = Chem.RWMol() # Editable molecule
|
||||||
|
num_atoms_to_add = random.randint(self.min_atoms, self.max_atoms)
|
||||||
|
|
||||||
|
if num_atoms_to_add == 0:
|
||||||
|
return None
|
||||||
|
|
||||||
|
# Add the first atom
|
||||||
|
atom_symbol = random.choice(self.elements)
|
||||||
|
rw_mol.AddAtom(Chem.Atom(atom_symbol))
|
||||||
|
|
||||||
|
# Add subsequent atoms and connect them
|
||||||
|
for i in range(1, num_atoms_to_add):
|
||||||
|
if not rw_mol.GetNumAtoms(): break
|
||||||
|
|
||||||
|
existing_atom_idx = random.randrange(rw_mol.GetNumAtoms())
|
||||||
|
new_atom_symbol = random.choice(self.elements)
|
||||||
|
new_atom_idx = rw_mol.AddAtom(Chem.Atom(new_atom_symbol))
|
||||||
|
|
||||||
|
bond_type = random.choice([Chem.BondType.SINGLE, Chem.BondType.SINGLE, Chem.BondType.DOUBLE, Chem.BondType.TRIPLE])
|
||||||
|
|
||||||
|
rw_mol.AddBond(existing_atom_idx, new_atom_idx, bond_type)
|
||||||
|
|
||||||
|
# Attempt to form rings
|
||||||
|
if rw_mol.GetNumAtoms() > 2:
|
||||||
|
num_rings_to_try = random.randint(0, rw_mol.GetNumAtoms() // 3)
|
||||||
|
for _ in range(num_rings_to_try):
|
||||||
|
if rw_mol.GetNumAtoms() < 2: break
|
||||||
|
|
||||||
|
atom_indices = list(range(rw_mol.GetNumAtoms()))
|
||||||
|
if len(atom_indices) < 2: break
|
||||||
|
|
||||||
|
idx1, idx2 = random.sample(atom_indices, 2)
|
||||||
|
|
||||||
|
if rw_mol.GetBondBetweenAtoms(idx1, idx2) is None:
|
||||||
|
rw_mol.AddBond(idx1, idx2, Chem.BondType.SINGLE) # Usually single for new rings
|
||||||
|
|
||||||
|
try:
|
||||||
|
mol = rw_mol.GetMol()
|
||||||
|
Chem.SanitizeMol(mol) # Crucial: checks valency, aromaticity, etc.
|
||||||
|
|
||||||
|
if mol.GetNumAtoms() > 0:
|
||||||
|
# It might create non-physical or conflicting assignments.
|
||||||
|
# InChI will represent whatever stereo is defined.
|
||||||
|
Chem.AssignStereochemistryFrom3D(mol) # If 3D coords were present (not here)
|
||||||
|
# Or, more directly, find potential chiral centers and assign randomly
|
||||||
|
chiral_centers = Chem.FindMolChiralCenters(mol, includeUnassigned=True)
|
||||||
|
for center_idx, stereo_val in chiral_centers:
|
||||||
|
if stereo_val == '?': # Unassigned
|
||||||
|
atom = mol.GetAtomWithIdx(center_idx)
|
||||||
|
if random.choice([True, False]):
|
||||||
|
atom.SetChiralTag(Chem.ChiralType.CHI_TETRAHEDRAL_CW)
|
||||||
|
else:
|
||||||
|
atom.SetChiralTag(Chem.ChiralType.CHI_TETRAHEDRAL_CCW)
|
||||||
|
# Re-sanitize after modifying chiral tags might be good practice
|
||||||
|
Chem.SanitizeMol(mol)
|
||||||
|
return mol
|
||||||
|
except Exception as e:
|
||||||
|
# print(f"Debug: RDKit molecule construction/sanitization failed: {e}")
|
||||||
|
return None
|
||||||
|
|
||||||
|
def generate_n_valid_inchi(self, n):
|
||||||
|
"""
|
||||||
|
Generates N valid, unique InChI strings.
|
||||||
|
kwargs_for_mol_gen are passed to generate_random_molecule_rdkit.
|
||||||
|
"""
|
||||||
|
valid_inchi_set = set()
|
||||||
|
total_attempts_overall = 0
|
||||||
|
|
||||||
|
while len(valid_inchi_set) < n:
|
||||||
|
attempts_for_current_inchi = 0
|
||||||
|
generated_this_round = False
|
||||||
|
while not generated_this_round:
|
||||||
|
total_attempts_overall += 1
|
||||||
|
attempts_for_current_inchi += 1
|
||||||
|
|
||||||
|
mol = self.generate_random_molecule_rdkit()
|
||||||
|
|
||||||
|
if mol:
|
||||||
|
try:
|
||||||
|
inchi_string = MolToInchi(mol)
|
||||||
|
mol = Chem.MolFromInchi(inchi_string)
|
||||||
|
logp = Crippen.MolLogP(mol)
|
||||||
|
if inchi_string and inchi_string not in valid_inchi_set:
|
||||||
|
|
||||||
|
valid_inchi_set.add(inchi_string)
|
||||||
|
generated_this_round = True
|
||||||
|
break # Found one
|
||||||
|
except Exception as e:
|
||||||
|
# This can happen if the molecule is somehow malformed even after sanitization,
|
||||||
|
# or if InChI generation itself encounters an issue (rare).
|
||||||
|
print(f"Debug: MolToInchi failed: {e} for SMILES: {Chem.MolToSmiles(mol)}")
|
||||||
|
pass
|
||||||
|
|
||||||
|
return list(valid_inchi_set)
|
||||||
|
|
||||||
|
|
||||||
|
class SMILESGenerator:
|
||||||
|
def __init__(self, min_len=5, max_len=25,
|
||||||
|
seed=None):
|
||||||
|
RDLogger.DisableLog('rdApp.*')
|
||||||
|
random.seed(42) if seed is None else random.seed(seed)
|
||||||
|
self.min_len = min_len
|
||||||
|
self.max_len = max_len
|
||||||
|
|
||||||
|
|
||||||
|
def is_valid_smiles(self, smi):
|
||||||
|
"""Checks if a SMILES string is valid using RDKit."""
|
||||||
|
if not smi:
|
||||||
|
return False
|
||||||
|
mol = Chem.MolFromSmiles(smi, sanitize=False) # Parse without sanitization first
|
||||||
|
if mol is None:
|
||||||
|
return False
|
||||||
|
try:
|
||||||
|
Chem.SanitizeMol(mol)
|
||||||
|
return True
|
||||||
|
except Exception as e:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def generate_random_smiles_candidate(self):
|
||||||
|
"""
|
||||||
|
Generates a random string that might be a SMILES string.
|
||||||
|
This is a VERY naive generator and will produce many invalid SMILES.
|
||||||
|
"""
|
||||||
|
# A basic set of SMILES characters
|
||||||
|
# More comprehensive: C,c,N,n,O,o,S,s,P,p,F,Cl,Br,I,B,Si,Se,*,[nH],[nH+],[cH-],...
|
||||||
|
# Also: -,=,#,$,:,.,(,),[,],%,0-9 (for ring closures and isotopes/charges)
|
||||||
|
atom_chars = ['C', 'N', 'O', 'S', 'F', 'Cl', 'Br', 'I', 'P']
|
||||||
|
aromatic_chars = ['c', 'n', 'o', 's']
|
||||||
|
bond_chars = ['-', '=', '#']
|
||||||
|
branch_chars = ['(', ')']
|
||||||
|
ring_digits = [str(i) for i in range(1, 10)] # 1-9
|
||||||
|
# More complex elements like charges, isotopes, chiral centers are harder to randomize simply
|
||||||
|
# For simplicity, we'll stick to a subset.
|
||||||
|
|
||||||
|
all_chars = atom_chars + aromatic_chars + bond_chars + branch_chars + ring_digits
|
||||||
|
|
||||||
|
length = random.randint(self.min_len, self.max_len)
|
||||||
|
candidate = ""
|
||||||
|
|
||||||
|
candidate += random.choice(atom_chars + aromatic_chars)
|
||||||
|
|
||||||
|
open_parentheses = 0
|
||||||
|
open_rings = {}
|
||||||
|
|
||||||
|
for _ in range(length - 1):
|
||||||
|
choices = []
|
||||||
|
weights = []
|
||||||
|
|
||||||
|
choices.extend(atom_chars + aromatic_chars)
|
||||||
|
weights.extend([10] * (len(atom_chars) + len(aromatic_chars)))
|
||||||
|
|
||||||
|
if candidate and (candidate[-1].isalpha() or candidate[-1] == ')' or candidate[-1].isdigit()):
|
||||||
|
choices.extend(bond_chars)
|
||||||
|
weights.extend([5] * len(bond_chars))
|
||||||
|
|
||||||
|
|
||||||
|
if candidate and (candidate[-1].isalpha() or candidate[-1] == ')' or candidate[-1].isdigit()):
|
||||||
|
choices.append('(')
|
||||||
|
weights.append(3)
|
||||||
|
|
||||||
|
if open_parentheses > 0:
|
||||||
|
choices.append(')')
|
||||||
|
weights.append(3)
|
||||||
|
|
||||||
|
# Ring closures
|
||||||
|
if candidate and (candidate[-1].isalpha() or candidate[-1] == ')'):
|
||||||
|
# Try to close an open ring
|
||||||
|
open_ring_digits = [d for d, status in open_rings.items() if status == 'open']
|
||||||
|
if open_ring_digits and random.random() < 0.5: # 50% chance to close an open ring
|
||||||
|
digit_to_close = random.choice(open_ring_digits)
|
||||||
|
choices.append(digit_to_close)
|
||||||
|
weights.append(5)
|
||||||
|
else: # Try to open a new ring
|
||||||
|
available_digits = [d for d in ring_digits if d not in open_rings or open_rings[d] == 'closed']
|
||||||
|
if available_digits:
|
||||||
|
choices.extend(available_digits)
|
||||||
|
weights.extend([2] * len(available_digits))
|
||||||
|
|
||||||
|
if not choices: # Fallback if no valid options (e.g., after certain bonds)
|
||||||
|
chosen_char = random.choice(atom_chars)
|
||||||
|
else:
|
||||||
|
chosen_char = random.choices(choices, weights=weights, k=1)[0]
|
||||||
|
|
||||||
|
# Update state
|
||||||
|
if chosen_char == '(':
|
||||||
|
open_parentheses += 1
|
||||||
|
elif chosen_char == ')':
|
||||||
|
if open_parentheses > 0:
|
||||||
|
open_parentheses -= 1
|
||||||
|
else:
|
||||||
|
continue # Don't add a closing parenthesis if none are open
|
||||||
|
elif chosen_char in ring_digits:
|
||||||
|
if chosen_char not in open_rings or open_rings[chosen_char] == 'closed':
|
||||||
|
open_rings[chosen_char] = 'open'
|
||||||
|
elif open_rings[chosen_char] == 'open':
|
||||||
|
open_rings[chosen_char] = 'closed'
|
||||||
|
|
||||||
|
candidate += chosen_char
|
||||||
|
|
||||||
|
# Attempt to close any remaining open parentheses
|
||||||
|
candidate += ')' * open_parentheses
|
||||||
|
|
||||||
|
# Attempt to close any remaining open rings (very crudely)
|
||||||
|
for digit, status in open_rings.items():
|
||||||
|
if status == 'open':
|
||||||
|
# Find a suitable place to close it - this is hard without graph info
|
||||||
|
# For now, just append another atom and the digit if possible
|
||||||
|
if candidate and (candidate[-1].isalpha() or candidate[-1] == ')'):
|
||||||
|
if random.random() < 0.7 and len(candidate) < self.max_len -1 : # Add another atom then close
|
||||||
|
candidate += random.choice(atom_chars) + digit
|
||||||
|
else: # Just append the digit (might be invalid)
|
||||||
|
candidate += digit
|
||||||
|
|
||||||
|
|
||||||
|
return candidate
|
||||||
|
|
||||||
|
def generate_n_valid_smiles(self, n):
|
||||||
|
"""Generates N valid, unique (canonical) SMILES strings."""
|
||||||
|
valid_smiles_set = set()
|
||||||
|
total_attempts_overall = 0
|
||||||
|
|
||||||
|
print(f"Attempting to generate {n} valid SMILES (min_len={self.min_len}, max_len={self.max_len})...")
|
||||||
|
while len(valid_smiles_set) < n:
|
||||||
|
attempts_for_current_smiles = 0
|
||||||
|
generated_this_round = False
|
||||||
|
while not generated_this_round:
|
||||||
|
total_attempts_overall += 1
|
||||||
|
attempts_for_current_smiles += 1
|
||||||
|
candidate = self.generate_random_smiles_candidate()
|
||||||
|
|
||||||
|
if self.is_valid_smiles(candidate):
|
||||||
|
mol = Chem.MolFromSmiles(candidate) # Re-parse to be sure and for canonicalization
|
||||||
|
if mol: # Should be true if is_valid_smiles passed
|
||||||
|
canonical_smi = Chem.MolToSmiles(mol, isomericSmiles=True, canonical=True)
|
||||||
|
try:
|
||||||
|
mol = Chem.MolFromSmiles(canonical_smi)
|
||||||
|
logp = Crippen.MolLogP(mol)
|
||||||
|
if canonical_smi not in valid_smiles_set:
|
||||||
|
valid_smiles_set.add(canonical_smi)
|
||||||
|
# print(f"Generated ({len(valid_smiles_set)}/{n}): {canonical_smi} (after {attempts_for_current_smiles} attempts for this one, {total_attempts_overall} total)")
|
||||||
|
generated_this_round = True
|
||||||
|
break # Found one, move to the next
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
|
||||||
|
return list(valid_smiles_set)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
aInChIGenerator = InChIGenerator(max_atoms=15, min_atoms=3)
|
||||||
|
inchi_10 = aInChIGenerator.generate_n_valid_inchi(10)
|
||||||
|
print(inchi_10)
|
||||||
|
aSMILESGenerator = SMILESGenerator(min_len=5, max_len=25)
|
||||||
|
smiles_10 = aSMILESGenerator.generate_n_valid_smiles(10)
|
||||||
|
print(smiles_10)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue