我要使用tutorial中所述的
const Maps = () => {
const [events, setEvents] = useState([])
const handleClick = (e) => {
console.log(geoLoc)
e.preventDefault()
setGeoloc({ ...viewport })
}
useEffect(() => {
fetch(`https://api.list.co.uk/v1/events?near=${geoLoc.latitude},${geoLoc.longitude}/5`, {
headers: {
'Authorization': `Bearer ${API_KEY}`
}
})
.then(res => res.json())
.then(res => setEvents(res))
console.log(geoLoc.latitude)
return () => console.log('Unmounting component')
}, [])
const [viewport, setViewport] = useState({
width: '100vw',
height: '100vh',
latitude: 51.45523,
longitude: -2.59665,
zoom: 13.5
})
const [geoLoc, setGeoloc] = useState({
latitude: 51.45523,
longitude: -2.59665
})
if (events.length === 0) {
return <div>Loading...</div>
}
return <div>
<ReactMapGL mapboxApiAccessToken={TOKEN}
mapStyle="mapbox://styles/dredizzle/ck3owxclr138a1cqnzupab2hc"
{...viewport}
onViewportChange={viewport => {
setViewport(viewport)
}}
onClick={handleClick}
>
{events.map(event => (
<Popup
key={event.event_id}
latitude={event.schedules[0].place.lat}
longitude={event.schedules[0].place.lng}
>
</Popup>
))}
{/* <Popup latitude={51.45523} longitude={-2.59665}>
<div>event here</div>
</Popup> */}
<GeolocateControl
positionOptions={{ enableHighAccuracy: true }}
trackUserLocation={false}
/>
</ReactMapGL>
</div>
}
export default Maps
来训练二进制目标深度神经网络模型。我的模型在中间的密集层中有一个triplet semihard loss,不应对其进行“图形正则化”。
来自Github上的nsl.keras.GraphRegularization
definition:
将图正则化合并到
nsl.keras.GraphRegularization
的丢失中。图形正则化仅在训练期间在logits层完成。
这意味着中间的三重态半硬质损耗将不受此正则化影响吗?
答案 0 :(得分:0)
是的,没错。图正则化将仅应用于base_model
的输出。如果您的base_model
在另一层中使用三重态半硬损耗,则该损耗应保持不受影响并保留。如果不是这种情况,请在https://github.com/tensorflow/neural-structured-learning/issues处提交错误。